Subversion Repositories DevTools

Rev

Details | Last modification | View Log | RSS feed

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