Subversion Repositories DevTools

Rev

Rev 7286 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
5357 dpurdie 1
<%@LANGUAGE="VBSCRIPT"%>
2
<%
3
'=====================================================
4
'|                                                   |
5
'|                   wAddLicence                     |
6
'|                                                   |
7
'=====================================================
8
%>
9
<%
10
Option explicit
11
Response.Expires = 0
12
%>
13
<!--#include file="common/conf.asp"-->
14
<!--#include file="common/globals.asp"-->
15
<!--#include file="common/formating.asp"-->
16
<!--#include file="common/qstr.asp"-->
17
<!--#include file="common/common_subs.asp"-->
7286 dpurdie 18
<!--#include file="common/_popup_window_common.asp"-->
5357 dpurdie 19
<!--#include file="common/_form_window_common.asp"-->
20
<%
21
'------------ ACCESS CONTROL ------------------
22
%>
23
<!--#include file="_access_control_general.asp"-->
24
<!--#include file="_access_control_login.asp"-->
25
<%
26
'------------ VARIABLE DEFINITION -------------
27
Dim rsQry
28
Dim sMessage
29
Dim LICENCE_NAME
30
Dim Query_String
31
Dim dual
32
Dim LICENCE_ID
33
Dim Query_Stringx
34
'------------ CONSTANTS DECLARATION -----------
35
'------------ VARIABLE INIT -------------------
36
sMessage = NULL
37
Set objFormCollector = CreateObject("Scripting.Dictionary")
38
'------------ CONDITIONS ----------------------
39
'----------------------------------------------
40
'------------ RUN BEFORE PAGE RENDER ----------
41
 
42
If CBool(Request("action")) Then
43
 
44
   If Request("LICENCE_NAME") = "" Then
45
 
5590 dpurdie 46
      sMessage = "Cannot add an empty string as a licence name"
5357 dpurdie 47
 
48
   Else
49
      Query_String = _
5590 dpurdie 50
      "   SELECT * FROM licences WHERE UPPER(name) = UPPER('"& Request("LICENCE_NAME") &"')"
5357 dpurdie 51
 
52
      Set rsQry = OraDatabase.DbCreateDynaset( Query_String, cint(0))
53
 
54
      If rsQry.RecordCount = 0 Then
55
 
56
         Query_Stringx = _
5590 dpurdie 57
            "SELECT seq_gbe_id.NEXTVAL FROM DUAL"
5357 dpurdie 58
 
59
         Set dual = OraDatabase.DbCreateDynaset(Query_Stringx,cint(0))
60
         LICENCE_ID = dual("NEXTVAL")
61
         dual.Close()
62
         Set dual = Nothing
63
 
64
         OraDatabase.Parameters.Add "LICENCE", LICENCE_ID, ORAPARM_INPUT, ORATYPE_NUMBER
65
         OraDatabase.Parameters.Add "NAME",    Request("LICENCE_NAME"),   ORAPARM_INPUT, ORATYPE_VARCHAR2
66
 
5590 dpurdie 67
         objEH.ErrorRedirect = FALSE
5357 dpurdie 68
         objEH.TryORA ( OraSession )
69
         On Error Resume Next
70
         OraDatabase.ExecuteSQL ("begin INSERT INTO licences (licence, name) VALUES (:LICENCE, :NAME); end;")
71
         objEH.CatchORA ( OraSession )
72
 
73
         OraDatabase.Parameters.Remove "LICENCE"
74
         OraDatabase.Parameters.Remove "NAME"
75
 
76
         If objEH.Finally Then
77
            Call OpenInParentWindow ("admin_licences.asp")
78
            Call CloseWindow()
79
         End If
80
 
81
      Else
5590 dpurdie 82
         sMessage = "Licence already exists"
5357 dpurdie 83
      End If
84
 
85
      rsQry.Close
86
      Set rsQry = nothing
87
   End If
88
 
89
End If
90
'----------------------------------------------
91
%>
92
<html>
93
<head>
94
<title>Release Manager</title>
95
<link rel="shortcut icon" href="<%=FavIcon%>"/>
96
<meta HTTP-EQUIV="Pragma" CONTENT="no-cache">
97
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
6579 dpurdie 98
<link href="images/release_manager_style.css?ver=<%=VixVerNum%>" rel="stylesheet" type="text/css">
6676 dpurdie 99
<script language="JavaScript" src="scripts/common.js?ver=<%=VixVerNum%>"></script>
5357 dpurdie 100
</head>
5590 dpurdie 101
<body leftmargin="0" topmargin="0" onLoad="self.focus();FormName.LICENCE_NAME.focus();">
7288 dpurdie 102
<div id='divProgressBar' class='vixSpinner' style='visibility:hidden;'></div>
5357 dpurdie 103
<table width="100%"  border="0" cellspacing="0" cellpadding="10">
104
   <tr>
5590 dpurdie 105
      <td class="body_txt">
5357 dpurdie 106
         Add a new licence.
107
      </td>
108
   </tr>
109
   <%
110
   '-- FROM START --------------------------------------------------------------------------------------------------------------
111
   objFormComponent.FormName = "FormName"
5590 dpurdie 112
   objFormComponent.FormClass = "form_tight"
5357 dpurdie 113
   objFormComponent.Action = ScriptName
114
   objFormComponent.OnSubmit = "ShowProgress();"
115
   Call objFormComponent.FormStart()
116
   %>
117
   <tr>
5590 dpurdie 118
      <td class="form_field_bg" >
5357 dpurdie 119
         <!-- NEW PRODUCT ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
120
         <%Call Messenger ( sMessage , 3, "100%" )%>
121
         <!-- MESSAGE +++++++++++++++++++++++++++++++++++++++++++++++++++ -->
122
         <!--#include file="messages/_msg_inline.asp"-->
123
         <table width="70%" border="0">
124
            <tr>
5590 dpurdie 125
               <td><span class="body_txt nowrap">Licence Name</span></td>
5357 dpurdie 126
               <td><input name="LICENCE_NAME" type="text" class="body_txt" value="<%=LICENCE_NAME%>" size=70 maxlength=50></td>
127
            </tr>
5590 dpurdie 128
         </table>
129
      </td>
130
   </tr>
131
   <tr>
7288 dpurdie 132
   <td align="right">
133
		<input name="btn" type="submit" class="form_btn" value="Add">
134
		<input name="btn" type="reset" class="form_btn" value="Cancel" onclick="parent.closeIFrame();">
135
   </td>
5357 dpurdie 136
   </tr>
137
   <%=objPMod.ComposeHiddenTags()%>
138
   <input type="hidden" name="action" value="true">
139
   <%
140
   Call objFormComponent.FormEnd()
141
   '-- FROM END ----------------------------------------------------------------------------------------------------------------
142
   %>
143
</table>
144
</body>
145
</html>
146
<%
147
'------------ RUN AFTER PAGE RENDER -----------
148
Set objFormCollector = Nothing
149
'----------------------------------------------
150
Call Destroy_All_Objects
151
%>
152
 
153