Subversion Repositories DevTools

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
4040 dpurdie 1
<%@LANGUAGE="VBSCRIPT"%>
2
<%
3
'=====================================================
4
'|                                                   |
5
'|                   wAddMachClass                   |
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 GBE_MACHCLASS
29
Dim Query_String
30
'------------ CONSTANTS DECLARATION -----------
31
'------------ VARIABLE INIT -------------------
32
sMessage = NULL
33
Set objFormCollector = CreateObject("Scripting.Dictionary")
34
'------------ CONDITIONS ----------------------
35
'----------------------------------------------
36
%>
37
<%
38
 
39
%>
40
<%
41
'------------ RUN BEFORE PAGE RENDER ----------
42
 
43
If Request("type") = "delete" Then
44
	On Error Resume Next
45
	OraDatabase.Parameters.Add "BM_ID",	Request("BM_ID"),	ORAPARM_INPUT, ORATYPE_NUMBER
46
	objEH.TryORA ( OraSession )
47
	OraDatabase.ExecuteSQL _
48
	"BEGIN   PK_BUILDAPI.REMOVE_BUILDMACHINE ( :BM_ID );   END;"
49
	objEH.CatchORA ( OraSession )	
50
	OraDatabase.Parameters.Remove "BM_ID"
51
 
52
    Call OpenInWindow ("admin_gbe_machclass.asp")
53
 
54
ElseIf CBool(Request("action")) Then
55
 
56
   ' Update an existing entry
57
   If Request("bm_id") <> "" Then
58
      Query_String = _
59
      "   SELECT * FROM BUILD_MACHINES WHERE BM_ID <> " & Request("bm_id") & " AND BM_NAME = '"& Request("BM_NAME") &"'"
60
 
61
      Set rsQry = OraDatabase.DbCreateDynaset( Query_String, cint(0))
62
 
63
      If rsQry.RecordCount = 0 Then
64
 
65
         OraDatabase.Parameters.Add "BM_ID",   Request("BM_ID"),   ORAPARM_INPUT, ORATYPE_NUMBER
66
         OraDatabase.Parameters.Add "BM_NAME", Request("BM_NAME"), ORAPARM_INPUT, ORATYPE_VARCHAR2
67
 
68
         objEH.TryORA ( OraSession )
69
         On Error Resume Next
70
 
71
         OraDatabase.ExecuteSQL _
72
         "BEGIN  PK_BUILDAPI.UPDATE_BUILDMACHINE(:BM_ID, :BM_NAME);  END;"
73
 
74
         objEH.CatchORA ( OraSession )
75
 
76
         OraDatabase.Parameters.Remove "BM_NAME"
77
         OraDatabase.Parameters.Remove "BM_ID"
78
 
79
         If objEH.Finally Then
80
            Call OpenInParentWindow ("admin_gbe_machclass.asp")
81
            Call CloseWindow()
82
         End If
83
 
84
      Else
85
         sMessage = "A Machine Type of that name already exists"
86
      End If
87
 
88
      rsQry.Close
89
      Set rsQry = nothing
90
   Else
91
 
92
      ' Create a new entry
93
      '
94
      Query_String = _
95
      "   SELECT * FROM BUILD_MACHINES WHERE BM_NAME = '"& Request("BM_NAME") &"'"
96
 
97
      Set rsQry = OraDatabase.DbCreateDynaset( Query_String, cint(0))
98
 
99
      If rsQry.RecordCount = 0 Then
100
 
101
         OraDatabase.Parameters.Add "BM_NAME",   Request("BM_NAME"),    ORAPARM_INPUT, ORATYPE_VARCHAR2
102
 
103
         objEH.TryORA ( OraSession )
104
         On Error Resume Next
105
 
106
         OraDatabase.ExecuteSQL _
107
         "BEGIN  PK_BUILDAPI.ADD_BUILDMACHINE(:BM_NAME);  END;"
108
 
109
         objEH.CatchORA ( OraSession )
110
 
111
         OraDatabase.Parameters.Remove "BM_NAME"
112
 
113
         If objEH.Finally Then
114
            Call OpenInParentWindow ("admin_gbe_machclass.asp")
115
            Call CloseWindow()
116
         End If
117
 
118
      Else
119
         sMessage = "A Machine Type of that name already exists"
120
      End If
121
 
122
      rsQry.Close
123
      Set rsQry = nothing
124
 
125
   End If
126
 
127
End If
128
 
129
 
130
'----------------------------------------------
131
%>
132
<html>
133
<head>
134
<title>Release Manager</title>
135
<meta HTTP-EQUIV="Pragma" CONTENT="no-cache">
136
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
137
<link href="images/release_manager_style.css" rel="stylesheet" type="text/css">
138
<script language="JavaScript" src="images/common.js"></script>
139
</head>
140
 
141
<body background="images/bg_bage_0.gif" leftmargin="0" topmargin="0" onLoad="self.focus();FormName.GBE_MACHTYPE.focus();">
142
<table width="100%"  border="0" cellspacing="0" cellpadding="10">
143
   <tr>
144
      <td bgcolor="#FFFFFF" class="body_txt"><span class="body_h1"><img src="icons/i_linkarrow_black.gif" width="11" height="11" align="absmiddle">&nbsp;Add/Update GBE_MACHTYPE</span> <br>
145
         Add a new Machine Type or edit an existing Machine Type.
146
      </td>
147
   </tr>
148
 
149
 
150
   <%
151
   '-- FROM START --------------------------------------------------------------------------------------------------------------
152
   objFormComponent.FormName = "FormName"
153
   objFormComponent.Action = ScriptName
154
   objFormComponent.OnSubmit = "MM_validateForm(""BM_NAME"",""Machine Type"",""RisCleanStrinLength4:"");return document.MM_returnValue"
155
   Call objFormComponent.FormStart()
156
 
157
   %>
158
   <tr>
159
      <td background="images/bg_login.gif">
160
         <table width="50%"  border="0" cellspacing="0" cellpadding="0">
161
            <tr>
162
               <td><%=ProgressBar()%></td>
163
               <td align="right"><input name="btn" type="submit" class="form_btn" value="Add/Update">
164
                  <input name="btn" type="reset" class="form_btn" value="Cancel" onClick="self.close();">
165
               </td>
166
            </tr>
167
         </table>
168
      </td>
169
   </tr>
170
   <tr>
171
      <td>
172
         <!-- NEW PRODUCT +++++++++++++++++++++++++++++++++++++++++++++++ -->
173
         <%Call Messenger ( sMessage , 1, "100%" )%>
174
         <!-- MESSAGE +++++++++++++++++++++++++++++++++++++++++++++++++++ -->
175
         <!--#include file="messages/_msg_inline.asp"-->
176
 
177
         <table width="50%" border="0">
178
            <%
179
            GBE_MACHCLASS = Request("BM_NAME")
180
 
181
            If Request("bm_id") <> "" AND GBE_MACHCLASS = "" Then
182
               %>
183
               <input type="hidden" name="bm_id" value="<%=Request("bm_id")%>">
184
               <%
185
 
186
               Dim rsTemp
187
 
188
               Query_String = "SELECT * FROM BUILD_MACHINES BM WHERE BM_ID = "& Request("bm_id")
189
 
190
               Set rsTemp = OraDatabase.DbCreateDynaset( Query_String, cint(0))
191
 
192
               GBE_MACHCLASS = rsTemp("BM_NAME")
193
 
194
               rsTemp.Close()
195
               Set rsTemp = Nothing
196
            End   If
197
            %>
198
            <tr>
199
               <td><span class="body_txt">Machine Type</span></td>
200
               <td><input name="BM_NAME" type="text" class="body_txt" value="<%=GBE_MACHCLASS%>"></td>
201
            </tr>
202
            <tr>
203
               <td>&nbsp;</td>
204
               <td>&nbsp;</td>
205
            </tr>
206
         </table>
207
      </td>
208
   </tr>
209
   <%=objPMod.ComposeHiddenTags()%>
210
   <input type="hidden" name="action" value="true">
211
 
212
   <%
213
   Call objFormComponent.FormEnd()
214
   '-- FROM END ----------------------------------------------------------------------------------------------------------------
215
   %>
216
</table>
217
</body>
218
</html>
219
<%
220
'------------ RUN AFTER PAGE RENDER -----------
221
Set objFormCollector = Nothing
222
'----------------------------------------------
223
Call Destroy_All_Objects
224
%>
225
 
226