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
'|                   wAddProc                        |
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
%>
6048 dpurdie 23
<!--#include file="_access_control_login.asp"-->
5357 dpurdie 24
<!--#include file="_access_control_general.asp"-->
25
<%
26
'------------ VARIABLE DEFINITION -------------
5384 dpurdie 27
Dim rsQry
5357 dpurdie 28
Dim sMessage
29
Dim GBE_MACHTYPE
30
Dim GBE_MACHCLASS
31
Dim Query_String
32
'------------ CONSTANTS DECLARATION -----------
33
'------------ VARIABLE INIT -------------------
34
sMessage = NULL
35
Set objFormCollector = CreateObject("Scripting.Dictionary")
36
'------------ CONDITIONS ----------------------
37
'----------------------------------------------
38
%>
39
<%
40
' Populate a form selection with Machine Classes
41
'   sbm_id - Select this bm_id
42
sub getMachineClassOptions( sbm_id )
43
    Dim rsQry
44
    Dim bm_id, bm_name, selected
45
 
46
    Response.write("<option value="""">- Select One -</option>")
47
    Set rsQry = OraDatabase.DbCreateDynaset( "SELECT * FROM BUILD_MACHINES BM ORDER BY BM_NAME", ORADYN_DEFAULT )
48
    While (NOT rsQry.BOF) AND (NOT rsQry.EOF)
49
        bm_id = rsQry("BM_ID")
50
        bm_name = rsQry("BM_NAME")
51
        If bm_id = sbm_id Then
52
            selected = " selected"
53
        Else
54
            selected = ""
55
        End If
56
        %>
57
          <option value="<%=bm_id%>"<%=selected%>><%=bm_name%></option>
58
        <%
59
        rsQry.MoveNext()
60
    Wend
61
    rsQry.Close()
62
end sub
63
%>
64
<%
65
'------------ RUN BEFORE PAGE RENDER ----------
66
 
67
If CBool(Request("action")) Then
68
 
69
   ' Update an existing entry
70
   If Request("gbe_id") <> "" Then
71
 
72
      Query_String = _
5384 dpurdie 73
      "SELECT * FROM GBE_MACHTYPE WHERE GBE_ID <> " & Request("gbe_id") & " AND GBE_VALUE = '"& Request("GBE_MACHTYPE") &"'"
5357 dpurdie 74
 
75
      Set rsQry = OraDatabase.DbCreateDynaset( Query_String, cint(0))
76
 
77
      If rsQry.RecordCount = 0 Then
78
 
79
         OraDatabase.Parameters.Add "GBE_ID",       Request("GBE_ID"),       ORAPARM_INPUT, ORATYPE_NUMBER
80
         OraDatabase.Parameters.Add "GBE_MACHTYPE", Request("GBE_MACHTYPE"), ORAPARM_INPUT, ORATYPE_VARCHAR2
81
         OraDatabase.Parameters.Add "GBE_MACHCLASS", Request("GBE_MACHCLASS"), ORAPARM_INPUT, ORATYPE_VARCHAR2
82
 
83
         objEH.TryORA ( OraSession )
84
         On Error Resume Next
85
 
86
         OraDatabase.ExecuteSQL _
87
         "BEGIN  PK_BUILDAPI.UPDATE_GBE_MACHTYPE(:GBE_ID, :GBE_MACHTYPE, :GBE_MACHCLASS);  END;"
88
 
89
         objEH.CatchORA ( OraSession )
90
 
91
         OraDatabase.Parameters.Remove "GBE_MACHCLASS"
92
         OraDatabase.Parameters.Remove "GBE_MACHTYPE"
93
         OraDatabase.Parameters.Remove "GBE_ID"
94
 
95
         If objEH.Finally Then
96
            Call OpenInParentWindow ("admin_gbe_machtype.asp")
97
            Call CloseWindow()
98
         End If
99
 
100
      Else
101
         sMessage = "A Machine of that name already exists"
102
      End If
103
 
104
      rsQry.Close
105
      Set rsQry = nothing
106
 
107
   Else
108
 
109
      ' Create a new entry
110
      '
111
      Query_String = _
5384 dpurdie 112
      "SELECT * FROM GBE_MACHTYPE WHERE GBE_VALUE = '"& Request("GBE_MACHTYPE") &"'"
5357 dpurdie 113
 
114
      Set rsQry = OraDatabase.DbCreateDynaset( Query_String, cint(0))
115
 
116
      If rsQry.RecordCount = 0 Then
117
 
118
         OraDatabase.Parameters.Add "GBE_VALUE",   Request("GBE_MACHTYPE"),    ORAPARM_INPUT, ORATYPE_VARCHAR2
119
         OraDatabase.Parameters.Add "GBE_CLASS",   Request("GBE_MACHCLASS"),    ORAPARM_INPUT, ORATYPE_VARCHAR2
120
 
121
         objEH.TryORA ( OraSession )
122
         On Error Resume Next
123
 
124
         OraDatabase.ExecuteSQL _
125
         "BEGIN  PK_BUILDAPI.ADD_GBE_MACHTYPE(:GBE_VALUE,:GBE_CLASS);  END;"
126
 
127
         objEH.CatchORA ( OraSession )
128
 
129
         OraDatabase.Parameters.Remove "GBE_VALUE"
130
         OraDatabase.Parameters.Remove "GBE_CLASS"
131
 
132
         If objEH.Finally Then
133
            Call OpenInParentWindow ("admin_gbe_machtype.asp")
134
            Call CloseWindow()
135
         End If
136
 
137
      Else
138
         sMessage = "A Machine of that name already exists"
139
      End If
140
 
141
      rsQry.Close
142
      Set rsQry = nothing
143
 
144
   End If
145
 
146
End If
147
 
148
 
149
'----------------------------------------------
150
%>
151
<html>
152
<head>
153
<title>Release Manager</title>
154
<link rel="shortcut icon" href="<%=FavIcon%>"/>
155
<meta HTTP-EQUIV="Pragma" CONTENT="no-cache">
156
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
6579 dpurdie 157
<link href="images/release_manager_style.css?ver=<%=VixVerNum%>" rel="stylesheet" type="text/css">
158
<script language="JavaScript" src="images/common.js?ver=<%=VixVerNum%>"></script>
5357 dpurdie 159
</head>
160
<body background="images/bg_bage_0.gif" leftmargin="0" topmargin="0" onLoad="self.focus();FormName.GBE_MACHTYPE.focus();">
7288 dpurdie 161
<div id='divProgressBar' class='vixSpinner' style='visibility:hidden;'></div>
5590 dpurdie 162
<table class="full_table" border="0" cellspacing="0" cellpadding="10">
5357 dpurdie 163
   <tr>
5590 dpurdie 164
      <td bgcolor="#FFFFFF" class="body_txt">
165
        Add or Edit a new GBE_MACHTYPE.
5357 dpurdie 166
      </td>
167
   </tr>
168
   <%
169
   '-- FROM START --------------------------------------------------------------------------------------------------------------
170
   objFormComponent.FormName = "FormName"
5590 dpurdie 171
   objFormComponent.FormClass = "form_tight"
5357 dpurdie 172
   objFormComponent.Action = ScriptName
173
   objFormComponent.OnSubmit = "MM_validateForm(""GBE_MACHTYPE"",""Machine Type"",""RisCleanStrinLength4:"",""GBE_MACHCLASS"",""Machine Class"",""R"");return document.MM_returnValue"
174
   Call objFormComponent.FormStart()
175
   %>
176
   <tr>
177
      <td>
178
         <!-- NEW PRODUCT +++++++++++++++++++++++++++++++++++++++++++++++ -->
179
         <%Call Messenger ( sMessage , 1, "100%" )%>
180
         <!-- MESSAGE +++++++++++++++++++++++++++++++++++++++++++++++++++ -->
181
         <!--#include file="messages/_msg_inline.asp"-->
182
 
183
         <table width="50%" border="0">
184
            <%
185
            GBE_MACHTYPE = Request("GBE_MACHTYPE")
186
            GBE_MACHCLASS = Request("GBE_MACHCLASS")
187
 
188
            If Request("gbe_id") <> "" AND GBE_MACHTYPE = "" Then
189
               %>
190
               <input type="hidden" name="gbe_id" value="<%=Request("gbe_id")%>">
191
               <%
192
               Dim rsTemp
193
 
194
               Query_String = "SELECT * FROM GBE_MACHTYPE MT, BUILD_MACHINES BM WHERE MT.BM_ID=BM.BM_ID(+) AND GBE_ID = "& Request("gbe_id")
195
 
196
               Set rsTemp = OraDatabase.DbCreateDynaset( Query_String, cint(0))
197
 
198
               GBE_MACHTYPE = rsTemp("gbe_value")
199
               GBE_MACHCLASS = rsTemp("BM_ID")
200
 
201
               rsTemp.Close()
202
               Set rsTemp = Nothing
203
            End   If
204
            %>
205
            <tr>
5590 dpurdie 206
               <td><span class="body_txt nowrap">Machine Type</span></td>
5357 dpurdie 207
               <td><input name="GBE_MACHTYPE" type="text" class="body_txt" value="<%=GBE_MACHTYPE%>"></td>
208
            </tr>
209
            <tr>
5590 dpurdie 210
               <td><span class="body_txt nowrap">Machine Class</span></td>
5357 dpurdie 211
               <td>
212
                    <select id="FRmachClass"  name="GBE_MACHCLASS" class="form_item">
213
                    <%getMachineClassOptions(GBE_MACHCLASS)%>
214
                    </select>
215
               </td>
216
            </tr>
5590 dpurdie 217
         </table>
218
      </td>
219
   </tr>
220
   <tr>
221
      <td bgcolor="#FFFFFF">
222
         <table class=full_table >
5357 dpurdie 223
            <tr>
5590 dpurdie 224
               <td align="right">
225
                  <input name="btn" type="submit" class="form_btn" value="Add/Update">
226
                  <input name="btn" type="reset" class="form_btn" value="Cancel" onclick="parent.closeIFrame();">
227
               </td>
5357 dpurdie 228
            </tr>
229
         </table>
230
      </td>
231
   </tr>
232
   <%=objPMod.ComposeHiddenTags()%>
233
   <input type="hidden" name="action" value="true">
234
   <%
235
   Call objFormComponent.FormEnd()
236
   '-- FROM END ----------------------------------------------------------------------------------------------------------------
237
   %>
238
</table>
239
</body>
240
</html>
241
<%
242
'------------ RUN AFTER PAGE RENDER -----------
243
Set objFormCollector = Nothing
244
'----------------------------------------------
245
Call Destroy_All_Objects
246
%>
247
 
248