Subversion Repositories DevTools

Rev

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