%@LANGUAGE="VBSCRIPT"%>
<%
'=====================================================
'| |
'| wAddLicence |
'| |
'=====================================================
%>
<%
Option explicit
Response.Expires = 0
%>
<%
'------------ ACCESS CONTROL ------------------
%>
<%
'------------ VARIABLE DEFINITION -------------
Dim rsQry
Dim sMessage
Dim LICENCE_NAME
Dim Query_String
Dim dual
Dim LICENCE_ID
Dim Query_Stringx
'------------ CONSTANTS DECLARATION -----------
Const LIMG_PRODUCT = " "
Const LIMG_PRODUCT_UNPACKAGED = " "
Const LIMG_PRODUCT_PATCH = " "
'------------ VARIABLE INIT -------------------
sMessage = NULL
Set objFormCollector = CreateObject("Scripting.Dictionary")
'------------ CONDITIONS ----------------------
'----------------------------------------------
%>
<%
%>
<%
'------------ RUN BEFORE PAGE RENDER ----------
If CBool(Request("action")) Then
If Request("LICENCE_NAME") = "" Then
Call RaiseMsg ( enum_MSG_ERROR, "Cannot add an empty string as a licence name" )
Else
Query_String = _
" SELECT * FROM licences WHERE name = '"& Request("LICENCE_NAME") &"'"
Set rsQry = OraDatabase.DbCreateDynaset( Query_String, cint(0))
If rsQry.RecordCount = 0 Then
Query_Stringx = _
" SELECT seq_gbe_id.NEXTVAL FROM DUAL"
Set dual = OraDatabase.DbCreateDynaset(Query_Stringx,cint(0))
LICENCE_ID = dual("NEXTVAL")
dual.Close()
Set dual = Nothing
OraDatabase.Parameters.Add "LICENCE", LICENCE_ID, ORAPARM_INPUT, ORATYPE_NUMBER
OraDatabase.Parameters.Add "NAME", Request("LICENCE_NAME"), ORAPARM_INPUT, ORATYPE_VARCHAR2
objEH.TryORA ( OraSession )
On Error Resume Next
OraDatabase.ExecuteSQL ("begin INSERT INTO licences (licence, name) VALUES (:LICENCE, :NAME); end;")
objEH.CatchORA ( OraSession )
OraDatabase.Parameters.Remove "LICENCE"
OraDatabase.Parameters.Remove "NAME"
If objEH.Finally Then
Call OpenInParentWindow ("admin_licences.asp")
Call CloseWindow()
End If
Else
Call RaiseMsg ( enum_MSG_LICENCE_EXISTS, Request("LICENCE_ID") )
End If
rsQry.Close
Set rsQry = nothing
End If
End If
'----------------------------------------------
%>
Release Manager
Add Licence
Add a new licence.
<%
'-- FROM START --------------------------------------------------------------------------------------------------------------
objFormComponent.FormName = "FormName"
objFormComponent.Action = ScriptName
objFormComponent.OnSubmit = "ShowProgress();"
Call objFormComponent.FormStart()
%>
<%Call Messenger ( sMessage , 3, "100%" )%>
<%=objPMod.ComposeHiddenTags()%>
<%
Call objFormComponent.FormEnd()
'-- FROM END ----------------------------------------------------------------------------------------------------------------
%>
<%
'------------ RUN AFTER PAGE RENDER -----------
Set objFormCollector = Nothing
'----------------------------------------------
Call Destroy_All_Objects
%>