Subversion Repositories DevTools

Rev

Rev 119 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 119 Rev 129
Line 1... Line 1...
1
<%@LANGUAGE="VBSCRIPT"%>
1
<%@LANGUAGE="VBSCRIPT"%>
2
<%
2
<%
3
'=====================================================
3
'=====================================================
4
' 			 	   ADD NEW Project
4
'                 ADD NEW Project
5
'               --- PROCESS FORM ---
5
'               --- PROCESS FORM ---
6
'=====================================================
6
'=====================================================
7
%>
7
%>
8
<%
8
<%
9
Option explicit
9
Option explicit
10
' Good idea to set when using redirect
10
' Good idea to set when using redirect
11
Response.Expires = 0	' always load the page, dont store
11
Response.Expires = 0   ' always load the page, dont store
12
%>
12
%>
13
 
13
 
14
<!--#include file="common/conf.asp"-->
14
<!--#include file="common/conf.asp"-->
15
<!--#include file="common/globals.asp"-->
15
<!--#include file="common/globals.asp"-->
16
<!--#include file="common/formating.asp"-->
16
<!--#include file="common/formating.asp"-->
Line 32... Line 32...
32
parProj = QStrPar("FRproj")
32
parProj = QStrPar("FRproj")
33
'----------------------------------------------
33
'----------------------------------------------
34
%>
34
%>
35
<%
35
<%
36
Function Create_New_Project( SSprojectname )
36
Function Create_New_Project( SSprojectname )
37
	Dim SEQ_proj_id
37
   Dim SEQ_proj_id
38
	SEQ_proj_id = Get_From_DUAL("SEQ_PROJ_ID.nextval")
38
   SEQ_proj_id = Get_From_DUAL("SEQ_PROJ_ID.nextval")
-
 
39
   objEH.TryORA ( OraSession )
39
	OraSession.BeginTrans
40
   On Error Resume Next
40
	OraDatabase.ExecuteSQL _
41
   OraDatabase.ExecuteSQL _
41
		" INSERT INTO projects (proj_id, proj_name)"&_
42
      " INSERT INTO projects (proj_id, proj_name)"&_
42
		" VALUES ("& SEQ_proj_id &", '"& UCase(SSprojectname) &"')"
43
      " VALUES ("& SEQ_proj_id &", '"& UCase(SSprojectname) &"')"
43
  	OraSession.CommitTrans
44
   objEH.CatchORA ( OraSession )
44
End Function
45
End Function
45
 
46
 
46
Function Project_Name_Exists ( SSprojectname )
47
Function Project_Name_Exists ( SSprojectname )
47
	Dim rsTemp, Query_String
48
   Dim rsTemp, Query_String
48
	Query_String = _
49
   Query_String = _
49
	" SELECT proj_name"&_
50
   " SELECT proj_name"&_
50
	"  FROM projects"&_
51
   "  FROM projects"&_
51
	" WHERE proj_name = '"& UCase(SSprojectname) &"'"
52
   " WHERE proj_name = '"& UCase(SSprojectname) &"'"
52
	Set rsTemp = OraDatabase.DbCreateDynaset( Query_String, cint(0))
53
   Set rsTemp = OraDatabase.DbCreateDynaset( Query_String, cint(0))
53
	If rsTemp.RecordCount > 0 Then
54
   If rsTemp.RecordCount > 0 Then
54
		Project_Name_Exists = TRUE
55
      Project_Name_Exists = TRUE
55
	Else
56
   Else
56
		Project_Name_Exists = FALSE
57
      Project_Name_Exists = FALSE
57
	End If
58
   End If
58
	rsTemp.Close
59
   rsTemp.Close
59
	Set rsTemp = nothing
60
   Set rsTemp = nothing
60
End Function
61
End Function
61
%>
62
%>
62
<%
63
<%
63
'-----------------------  MAIN LINE  ---------------------------
64
'-----------------------  MAIN LINE  ---------------------------
64
 
65
 
65
'--- Process submition ---
66
'--- Process submition ---
66
If (parProj <> "") Then
67
If (parProj <> "") Then
67
	' All mendatory parameters FOUND
68
   ' All mendatory parameters FOUND
68
	
69
 
69
	' report errors if found
70
   ' report errors if found
70
	If Project_Name_Exists( parProj ) Then 
71
   If Project_Name_Exists( parProj ) Then
71
		Session("reqParam") = ""
72
      Session("reqParam") = ""
72
		Session("ERRlog") = ""
73
      Session("ERRlog") = ""
73
		Session("ERRlogFULL") = ""
74
      Session("ERRlogFULL") = ""
74
		Session("AdditionalParams") = "$PROJECTNAME$,"& parProj
75
      Session("AdditionalParams") = "$PROJECTNAME$,"& parProj
75
		Response.Redirect("message.asp?msg=202-7")
76
      Response.Redirect("message.asp?msg=202-7")
76
	End If
77
   End If
77
	
78
 
78
	'COMPLETE THE REQUEST...
79
   'COMPLETE THE REQUEST...
79
	Call Create_New_Project ( parProj )
80
   Call Create_New_Project ( parProj )
80
	
81
 
81
	Response.Redirect("index.asp")
82
   Response.Redirect("index.asp")
82
Else
83
Else
83
	Response.write "Some mendatory parameters are missing!" & "<br>" 'TODO
84
   Response.write "Some mendatory parameters are missing!" & "<br>" 'TODO
84
	Response.write QSTR_All 
85
   Response.write QSTR_All
85
End If
86
End If
86
%>
87
%>
87
 
88
 
88
<!-- DESTRUCTOR ------->
89
<!-- DESTRUCTOR ------->
89
<!--#include file="common/destructor.asp"-->
-
 
90
90
<!--#include file="common/destructor.asp"-->
-
 
91