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