Subversion Repositories DevTools

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
13 rsolanki 1
<%@LANGUAGE="VBSCRIPT"%>
2
<%
3
'=====================================================
4
'|                                                   |
5
'|			          AddBlankBom				 	 |
6
'|                                                   |
7
'=====================================================
8
%>
9
<%
10
Option explicit
11
Response.Expires = 0
12
%>
13
<!--#include file="common/globals.asp"-->
14
<!--#include file="common/config.asp"-->
15
<!--#include file="common/common_subs.asp"-->
16
<!--#include file="common/_form_window_common.asp"-->
17
<%
18
'------------ ACCESS CONTROL ------------------
19
%>
20
<!--#include file="_access_control_general.asp"-->
21
<%
22
'------------ VARIABLE DEFINITION -------------
23
Dim rsQry
24
'------------ CONSTANTS DECLARATION -----------
25
'------------ VARIABLE INIT -------------------
26
parProj_id = Request("proj_id")
27
parBranch_id = Request("branch_id")
28
'------------ CONDITIONS ----------------------
29
'----------------------------------------------
30
%>
31
<%
32
'--------------------------------------------------------------------------------------------------------------------------
33
Sub GetFormDetails ( nBom_id, ByRef outobjDetails )
34
	Dim rsQry, query
35
	OraDatabase.Parameters.Add "BOM_ID", 		nBom_id,		ORAPARM_INPUT, ORATYPE_NUMBER 
36
	OraDatabase.Parameters.Add "BASE_ENV_ID", 	NULL,			ORAPARM_INPUT, ORATYPE_NUMBER 
37
 
38
	'Set rsQry = OraDatabase.DbCreateDynaset( GetQuery ("BomBaseEnvList.sql"), ORADYN_DEFAULT )
39
 
40
	If rsQry.RecordCount > 0 Then
41
		outobjDetails.Item ("bom_base_env")  = TRUE
42
 
43
	Else
44
		outobjDetails.Item ("bom_base_env")  = FALSE
45
 
46
	End If
47
 
48
	OraDatabase.Parameters.Remove "BOM_ID"
49
	OraDatabase.Parameters.Remove "BASE_ENV_ID"
50
 
51
	rsQry.Close
52
	Set rsQry = Nothing
53
End Sub
54
'--------------------------------------------------------------------------------------------------------------------------
55
Function GetBomNames ( nProj_id )
56
	Dim rsQry
57
 
58
	OraDatabase.Parameters.Add "PROJ_ID", nProj_id,	ORAPARM_INPUT, ORATYPE_NUMBER
59
 
60
	Set rsQry = OraDatabase.DbCreateDynaset( GetQuery("BomNamesList.sql"), ORADYN_DEFAULT )
61
 
62
	If rsQry.RecordCount > 0 Then
63
		GetBomNames = rsQry.GetRows()
64
	Else
65
		GetBomNames = NULL
66
	End If
67
 
68
	OraDatabase.Parameters.Remove "PROJ_ID"
69
 
70
End Function
71
'--------------------------------------------------------------------------------------------------------------------------
72
Sub AddBom ()
73
	On Error Resume Next
74
 
75
	OraDatabase.Parameters.Add "BOM_NAME", 		Request("bom_name"), 		ORAPARM_INPUT, ORATYPE_VARCHAR2
76
	OraDatabase.Parameters.Add "BRANCH_ID", 	Request("branch_id"), 		ORAPARM_INPUT, ORATYPE_NUMBER 
77
	OraDatabase.Parameters.Add "BOM_COMMENTS", 	Request("bom_comments"), 	ORAPARM_INPUT, ORATYPE_VARCHAR2
78
	OraDatabase.Parameters.Add "USER_ID", 		objAccessControl.UserId, 	ORAPARM_INPUT, ORATYPE_NUMBER 
79
 
80
	objEH.TryORA ( OraSession )
81
 
82
	OraDatabase.ExecuteSQL _
83
	"BEGIN   pk_Bom.Add_Bom ( :BOM_NAME, :BOM_COMMENTS, :BRANCH_ID, NULL, :USER_ID );   END;"
84
 
85
	objEH.CatchORA ( OraSession )
86
 
87
 
88
	OraDatabase.Parameters.Remove "BOM_NAME"
89
	OraDatabase.Parameters.Remove "BRANCH_ID"
90
	OraDatabase.Parameters.Remove "BOM_COMMENTS"
91
	OraDatabase.Parameters.Remove "USER_ID"
92
End Sub
93
'--------------------------------------------------------------------------------------------------------------------------
94
%>
95
<%
96
'------------ RUN BEFORE PAGE RENDER ----------
97
objPMod.PersistInQryString ( Array("bom_id_list", "state_id") )
98
 
99
' --- Get Form details from DB ---
100
 
101
' --- Load Validation Rules ---
102
Call objForm.LoadValidationRules ( Array("bom_name","bom_comments"), OraDatabase )		' Load Validation Rules
103
 
104
' --- Enter Form Validation Rule Changes here... ----
105
'----------------------------------------------------
106
 
107
' --- RUN onPostBack ---
108
If Request("action") <> "" Then
109
	If objForm.IsValidOnPostBack Then
110
		' --- Form is Valid ---
111
		Call AddBom()
112
 
113
		If objEH.Finally Then
114
			Call OpenInWindow ( Request("rfile") &"?DONE=OK"& objPMod.ComposeURLWithout("rfile") )
115
		End If
116
 
117
	End If
118
End If
119
 
120
'----------------------------------------------
121
%>
122
<html>
123
<head>
124
<title>Deployment Manager</title>
125
<meta HTTP-EQUIV="Pragma" CONTENT="no-cache">
126
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
127
<link href="scripts/deployment_manager.css" rel="stylesheet" type="text/css">
128
<script language="JavaScript" src="scripts/common.js"></script>
129
 
130
</head>
131
<body background="images/bg_lite_blue.gif" leftmargin="0" topmargin="0" onLoad="FormName.bom_name.focus();">
132
<!-- HEADER ++++++++++++++++ -->
133
<!--#include file="_header.asp"-->
134
<!-- +++++++++++++++++++++++ -->
135
<table width="100%"  border="0" cellspacing="0" cellpadding="0">
136
<%
137
'-- FROM START ---------------------------------------------------------------------------------------------------------
138
objFormComponent.FormName = "FormName"
139
objFormComponent.Action = SCRIPT_NAME
140
objFormComponent.OnSubmit = "ShowProgress();"
141
Call objFormComponent.FormStart()
142
%>
143
  <tr>
144
    <td bgcolor="#FFFFFF"><img src="images/spacer.gif" width="1" height="42"></td>
145
  </tr>
146
  <tr>
147
    <td align="center" valign="middle" bgcolor="#FFFFFF">
148
	<!-- FROM ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
149
    <table width="600" border="0" cellspacing="0" cellpadding="1">
150
        <tr>
151
          <td background="images/bg_bage_2.gif"><table width="100%"  border="0" cellspacing="0" cellpadding="0">
152
            <tr>
153
              <td bgcolor="#FFFFFF"><table width="100%"  border="0" cellspacing="0" cellpadding="10">
154
				<tr>
155
				  <td bgcolor="#FFFFFF" class="body_txt"><span class="body_h1"><img src='icons/bi_new.gif' width='20' height='16' border='0' align='absmiddle'>&nbsp;New BOM </span> <br>
156
				  Enter BOM Name or select from available BOM names.
157
				    </td>
158
				</tr>
159
                <tr>
160
				    <td background="images/bg_bage_0.gif">
161
					<!-- MESSAGE +++++++++++++++++++++++++++++++++++++++++++++++++++ -->	
162
					<!--#include file="messages/_msg_inline.asp"-->
163
					<!-- +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
164
					<table width="100%"  border="0" cellspacing="2" cellpadding="0">
165
					  <tr>
166
				        <td nowrap class="form_iname" valign="top">BOM Name </td>
167
				        <td valign="top" nowrap><%=objFormComponent.ComboWithText ( "bom_name", NULL, GetBomNames( parProj_id ), "class='form_ivalue' size='60'" )%></td>
168
				        <td valign="top"> <%=objForm.Validate ("bom_name")%> </td>
169
				      </tr>
170
				      <tr>
171
				        <td valign="top" nowrap class="form_iname">Comments</td>
172
				        <td valign="top"><%=objFormComponent.TextArea ( "bom_comments", Request("bom_comments"), 10, 60, "class='form_ivalue'" )%></td>
173
						<td valign="top"><%=objForm.Validate ("bom_comments")%></td>
174
				      </tr>
175
				      <tr>
176
				        <td width="10%" class="form_iname">&nbsp;</td>
177
				        <td width="1%">&nbsp;</td>
178
						<td width="90%" class="val_err"></td>
179
				      </tr>
180
				    </table></td>
181
				</tr>
182
				<tr>
183
                  <td background="images/bg_login.gif"><table width="100%"  border="0" cellspacing="0" cellpadding="0">
184
                      <tr>
185
                        <td></td>
186
                        <td align="right">
187
						<%=objFormComponent.SubmitButton ( "Submit", "class='form_btn'" )%>&nbsp;
188
						<%=objFormComponent.CancelButton ( "Cancel", "class='form_btn'", Request("rfile") &"?CANCEL=OK"& objPMod.ComposeURLWithout("rfile") )%></td>
189
                      </tr>
190
                  </table></td>
191
                </tr>
192
                <%=objPMod.ComposeHiddenTagsWithout("branch_id")%>
193
				<input type="hidden" name="branch_id" value="<%=parBranch_id%>">
194
				<input type="hidden" name="action" value="true">
195
              </table>
196
			 </td>
197
            </tr>
198
          </table></td>
199
        </tr>
200
      </table>
201
	  <!-- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->	  </td>
202
  </tr>
203
  <tr>
204
    <td bgcolor="#FFFFFF"><img src="images/spacer.gif" width="1" height="42"></td>
205
  </tr>
206
<%
207
Call objFormComponent.FormEnd()
208
'-- FROM END ----------------------------------------------------------------------------------------------------------------
209
%> 
210
</table>
211
<!-- FOOTER ++++++++++++++++++++++ -->
212
<!--#include file="_footer.asp"-->
213
<!-- +++++++++++++++++++++++++++++ -->
214
</body>
215
</html>
216
<%
217
'------------ RUN AFTER PAGE RENDER -----------
218
Set objPMod = Nothing
219
'----------------------------------------------
220
%>
221
<!--#include file="common/globals_destructor.asp"-->