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