Subversion Repositories DevTools

Rev

Go to most recent revision | Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
5156 dpurdie 1
<%@LANGUAGE="VBSCRIPT"%>
2
<%
3
'=====================================================
4
'|                                                   |
5
'|                   wAddBuildStandard               |
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_BS
29
Dim GBE_BSA_NAME
30
Dim Query_String
31
'------------ CONSTANTS DECLARATION -----------
32
'------------ VARIABLE INIT -------------------
33
Set objFormCollector = CreateObject("Scripting.Dictionary")
34
'------------ CONDITIONS ----------------------
35
'----------------------------------------------
36
%>
37
<%
38
' Populate a form selection with Build Standards
39
'   sbm_id - Select this bm_id
40
sub getBuildStandardOptions( sbs_id )
41
    Dim rsQry
42
    Dim bs_id, bs_name, selected
43
 
44
    Response.write("<option value="""">- Select One -</option>")
45
    Set rsQry = OraDatabase.DbCreateDynaset( "SELECT * FROM BUILD_STANDARDS ORDER BY BS_NAME", ORADYN_DEFAULT )
46
    While (NOT rsQry.BOF) AND (NOT rsQry.EOF)
47
        bs_id = rsQry("BS_ID")
48
        bs_name = rsQry("BS_NAME")
49
        If bs_id = sbs_id Then
50
            selected = " selected"
51
        Else
52
            selected = ""
53
        End If
54
        %>
55
          <option value="<%=bs_id%>"<%=selected%>><%=bs_name%></option>
56
        <%
57
        rsQry.MoveNext()
58
    Wend
59
    rsQry.Close()
60
end sub
61
%>
62
<%
63
'------------ RUN BEFORE PAGE RENDER ----------
64
 
65
 
66
If CBool(Request("action")) Then
67
 
68
   ' Update an existing entry
69
   If Request("bsa_id") <> "" Then
70
 
71
      Query_String = _
72
      "   SELECT * FROM BUILD_STANDARDS_ADDENDUM WHERE BSA_ID <> " & Request("bsa_id") & " AND UPPER(BSA_NAME) = UPPER('"& Request("GBE_BSA_NAME") &"')"
73
 
74
      Set rsQry = OraDatabase.DbCreateDynaset( Query_String, cint(0))
75
 
76
      If rsQry.RecordCount = 0 Then
77
 
78
         OraDatabase.Parameters.Add "BSA_ID",       Request("bsa_id"),       ORAPARM_INPUT, ORATYPE_NUMBER
79
         OraDatabase.Parameters.Add "BSA_NAME",     Request("GBE_BSA_NAME"), ORAPARM_INPUT, ORATYPE_VARCHAR2
80
         OraDatabase.Parameters.Add "BS_ID",        Request("GBE_BS"),       ORAPARM_INPUT, ORATYPE_NUMBER
81
 
82
         objEH.TryORA ( OraSession )
83
         On Error Resume Next
84
 
85
         OraDatabase.ExecuteSQL _
86
         "BEGIN  UPDATE BUILD_STANDARDS_ADDENDUM SET BSA_NAME = :BSA_NAME, BS_ID = :BS_ID WHERE BSA_ID = :BSA_ID;  END;"
87
 
88
         objEH.CatchORA ( OraSession )
89
 
90
         OraDatabase.Parameters.Remove "BS_ID"
91
         OraDatabase.Parameters.Remove "BSA_NAME"
92
         OraDatabase.Parameters.Remove "BSA_ID"
93
 
94
         If objEH.Finally Then
95
            Call OpenInParentWindow ("admin_gbe_buildstandard.asp")
96
            Call CloseWindow()
97
         End If
98
 
99
      Else
100
         sMessage = "A Build Standard Addendum of that name already exists"
101
      End If
102
 
103
      rsQry.Close
104
      Set rsQry = nothing
105
 
106
   Else
107
 
108
      ' Create a new entry
109
      '
110
      Query_String = _
111
      "   SELECT * FROM BUILD_STANDARDS_ADDENDUM WHERE UPPER(BSA_NAME) = UPPER('"& Request("GBE_BSA_NAME") &"')"
112
 
113
      Set rsQry = OraDatabase.DbCreateDynaset( Query_String, cint(0))
114
 
115
      If rsQry.RecordCount = 0 Then
116
 
117
         OraDatabase.Parameters.Add "BSA_NAME",     Request("GBE_BSA_NAME"), ORAPARM_INPUT, ORATYPE_VARCHAR2
118
         OraDatabase.Parameters.Add "BS_ID",        Request("GBE_BS"),       ORAPARM_INPUT, ORATYPE_NUMBER
119
 
120
         objEH.TryORA ( OraSession )
121
         On Error Resume Next
122
 
123
         OraDatabase.ExecuteSQL _
124
         "BEGIN  INSERT INTO BUILD_STANDARDS_ADDENDUM (BSA_NAME, BS_ID) VALUES( :BSA_NAME, :BS_ID);  END;"
125
 
126
         objEH.CatchORA ( OraSession )
127
 
128
         OraDatabase.Parameters.Remove "BSA_NAME"
129
         OraDatabase.Parameters.Remove "BSA_ID"
130
 
131
         If objEH.Finally Then
132
            Call OpenInParentWindow ("admin_gbe_buildstandard.asp")
133
            Call CloseWindow()
134
         End If
135
 
136
      Else
137
         sMessage = "A Build Standard Addendum of that name already exists"
138
      End If
139
 
140
      rsQry.Close
141
      Set rsQry = nothing
142
 
143
   End If
144
 
145
End If
146
 
147
 
148
'----------------------------------------------
149
%>
150
<html>
151
<head>
152
<title>Release Manager</title>
153
<meta HTTP-EQUIV="Pragma" CONTENT="no-cache">
154
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
155
<link href="images/release_manager_style.css" rel="stylesheet" type="text/css">
156
<script language="JavaScript" src="images/common.js"></script>
157
</head>
158
 
159
<body background="images/bg_bage_0.gif" leftmargin="0" topmargin="0" onLoad="self.focus();FormName.GBE_BSA_NAME.focus();">
160
<table width="100%"  border="0" cellspacing="0" cellpadding="10">
161
   <tr>
162
      <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 Build Standard</span> <br>
163
         Add a new Build Standard or edit an existing Build Standard.
164
      </td>
165
   </tr>
166
 
167
 
168
   <%
169
   '-- FROM START --------------------------------------------------------------------------------------------------------------
170
   objFormComponent.FormName = "FormName"
171
   objFormComponent.Action = ScriptName
172
   objFormComponent.OnSubmit = "MM_validateForm(""GBE_BSA_NAME"",""Build Standard Addendum"",""RLength4:"",""GBE_BS"",""Build Standard"",""R"");return document.MM_returnValue"
173
   Call objFormComponent.FormStart()
174
 
175
   %>
176
   <tr>
177
      <td background="images/bg_login.gif">
178
         <table width="50%"  border="0" cellspacing="0" cellpadding="0">
179
            <tr>
180
               <td><%=ProgressBar()%></td>
181
               <td align="right"><input name="btn" type="submit" class="form_btn" value="Add/Update">
182
                  <input name="btn" type="reset" class="form_btn" value="Cancel" onClick="self.close();">
183
               </td>
184
            </tr>
185
         </table>
186
      </td>
187
   </tr>
188
   <tr>
189
      <td>
190
         <!-- NEW PRODUCT +++++++++++++++++++++++++++++++++++++++++++++++ -->
191
         <%Call Messenger ( sMessage , 1, "100%" )%>
192
         <!-- MESSAGE +++++++++++++++++++++++++++++++++++++++++++++++++++ -->
193
         <!--#include file="messages/_msg_inline.asp"-->
194
 
195
         <table width="50%" border="0">
196
            <%
197
            GBE_BS = Request("GBE_BS")
198
            GBE_BSA_NAME = Request("GBE_BSA_NAME")
199
 
200
            If Request("bsa_id") <> "" Then
201
               %>
202
               <input type="hidden" name="bsa_id" value="<%=Request("bsa_id")%>">
203
               <%
204
 
205
               Dim rsTemp
206
 
207
               Query_String = "SELECT * FROM BUILD_STANDARDS BS, BUILD_STANDARDS_ADDENDUM BSA WHERE BSA.BS_ID=BS.BS_ID(+) AND BSA_ID = " & Request("bsa_id")
208
 
209
               Set rsTemp = OraDatabase.DbCreateDynaset( Query_String, cint(0))
210
 
211
               GBE_BS = rsTemp("BS_ID")
212
               GBE_BSA_NAME = rsTemp("BSA_NAME")
213
 
214
               rsTemp.Close()
215
               Set rsTemp = Nothing
216
            End   If
217
            %>
218
            <tr>
219
               <td><span class="body_txt">Build Standard</span></td>
220
               <td>
221
                    <select id="FRbs"  name="GBE_BS" class="form_item">
222
                    <%getBuildStandardOptions(GBE_BS)%>
223
                    </select>
224
               </td>
225
            </tr>
226
 
227
            <tr>
228
               <td><span class="body_txt">Addendum</span></td>
229
               <td><input name="GBE_BSA_NAME" type="text" class="body_txt" value="<%=GBE_BSA_NAME%>"></td>
230
            </tr>
231
            </tr>
232
         </table>
233
      </td>
234
   </tr>
235
   <%=objPMod.ComposeHiddenTags()%>
236
   <input type="hidden" name="action" value="true">
237
 
238
   <%
239
   Call objFormComponent.FormEnd()
240
   '-- FROM END ----------------------------------------------------------------------------------------------------------------
241
   %>
242
</table>
243
</body>
244
</html>
245
<%
246
'------------ RUN AFTER PAGE RENDER -----------
247
Set objFormCollector = Nothing
248
'----------------------------------------------
249
Call Destroy_All_Objects
250
%>
251
 
252