<%@ CodePage=1252 %> <% 'Include Common Files @1-1295BA10 %> <% 'End Include Common Files 'Initialize Page @1-A8BA5C81 ' Variables Dim PathToRoot, ScriptPath, TemplateFilePath Dim FileName Dim Redirect Dim IsService Dim Tpl, HTMLTemplate Dim TemplateFileName Dim ComponentName Dim PathToCurrentPage Dim Attributes ' Events Dim CCSEvents Dim CCSEventResult ' Connections Dim DBConnection1 ' Page controls Dim anm Dim ChildControls Response.ContentType = CCSContentType IsService = False Redirect = "" TemplateFileName = "anm_maint.html" Set CCSEvents = CreateObject("Scripting.Dictionary") PathToCurrentPage = "./" FileName = "anm_maint.asp" PathToRoot = "./" ScriptPath = Left(Request.ServerVariables("PATH_TRANSLATED"), Len(Request.ServerVariables("PATH_TRANSLATED")) - Len(FileName)) TemplateFilePath = ScriptPath 'End Initialize Page 'Initialize Objects @1-475BEFEA CCSEventResult = CCRaiseEvent(CCSEvents, "BeforeInitialize", Nothing) Set DBConnection1 = New clsDBConnection1 DBConnection1.Open Set Attributes = New clsAttributes Attributes("pathToRoot") = PathToRoot ' Controls Set anm = new clsRecordanm anm.Initialize DBConnection1 CCSEventResult = CCRaiseEvent(CCSEvents, "AfterInitialize", Nothing) 'End Initialize Objects 'Execute Components @1-AADF2273 anm.Operation 'End Execute Components 'Go to destination page @1-6D35F4FD If NOT ( Redirect = "" ) Then UnloadPage Response.Redirect Redirect End If 'End Go to destination page 'Initialize HTML Template @1-2E9DB4BC CCSEventResult = CCRaiseEvent(CCSEvents, "OnInitializeView", Nothing) Set HTMLTemplate = new clsTemplate Set HTMLTemplate.Cache = TemplatesRepository HTMLTemplate.LoadTemplate TemplateFilePath & TemplateFileName HTMLTemplate.SetVar "@CCS_PathToRoot", PathToRoot Set Tpl = HTMLTemplate.Block("main") CCSEventResult = CCRaiseEvent(CCSEvents, "BeforeShow", Nothing) 'End Initialize HTML Template 'Show Page @1-27F01CE0 Attributes.Show HTMLTemplate, "page:" Set ChildControls = CCCreateCollection(Tpl, Null, ccsParseOverwrite, _ Array(anm)) ChildControls.Show Dim MainHTML HTMLTemplate.Parse "main", False MainHTML = HTMLTemplate.GetHTML("main") CCSEventResult = CCRaiseEvent(CCSEvents, "BeforeOutput", Nothing) If CCSEventResult Then Response.Write MainHTML 'End Show Page 'Unload Page @1-CB210C62 UnloadPage Set Tpl = Nothing Set HTMLTemplate = Nothing 'End Unload Page 'UnloadPage Sub @1-34F37721 Sub UnloadPage() CCSEventResult = CCRaiseEvent(CCSEvents, "BeforeUnload", Nothing) If DBConnection1.State = adStateOpen Then _ DBConnection1.Close Set DBConnection1 = Nothing Set CCSEvents = Nothing Set Attributes = Nothing Set anm = Nothing End Sub 'End UnloadPage Sub Class clsRecordanm 'anm Class @2-1AB40839 'anm Variables @2-1ED064DE ' Public variables Public ComponentName Public HTMLFormAction Public PressedButton Public Errors Public FormSubmitted Public EditMode Public Visible Public Recordset Public TemplateBlock Public Attributes Public CCSEvents Private CCSEventResult Public InsertAllowed Public UpdateAllowed Public DeleteAllowed Public ReadAllowed Public DataSource Public Command Public ValidatingControls Public Controls ' Class variables Dim den_com Dim dci Dim forma_farm Dim conc Dim cod_atc Dim act_ter Dim prescript Dim ambalaj Dim volum_amb Dim valab_amb Dim cim Dim firm_tar_p Dim firm_tar_d Dim nr_dt_amb Dim link_rcp Dim link_pro Dim link_amb 'End anm Variables 'anm Class_Initialize Event @2-FCC50337 Private Sub Class_Initialize() Visible = True Set Errors = New clsErrors Set CCSEvents = CreateObject("Scripting.Dictionary") Set Attributes = New clsAttributes Set DataSource = New clsanmDataSource Set Command = New clsCommand InsertAllowed = False UpdateAllowed = False DeleteAllowed = False ReadAllowed = True Dim Method Dim OperationMode OperationMode = Split(CCGetFromGet("ccsForm", Empty), ":") If UBound(OperationMode) > -1 Then FormSubmitted = (OperationMode(0) = "anm") End If If UBound(OperationMode) > 0 Then EditMode = (OperationMode(1) = "Edit") End If ComponentName = "anm" Method = IIf(FormSubmitted, ccsPost, ccsGet) Set den_com = CCCreateControl(ccsLabel, "den_com", Empty, ccsText, Empty, CCGetRequestParam("den_com", Method)) Set dci = CCCreateControl(ccsLabel, "dci", Empty, ccsText, Empty, CCGetRequestParam("dci", Method)) Set forma_farm = CCCreateControl(ccsLabel, "forma_farm", Empty, ccsText, Empty, CCGetRequestParam("forma_farm", Method)) Set conc = CCCreateControl(ccsLabel, "conc", Empty, ccsText, Empty, CCGetRequestParam("conc", Method)) Set cod_atc = CCCreateControl(ccsLabel, "cod_atc", Empty, ccsText, Empty, CCGetRequestParam("cod_atc", Method)) Set act_ter = CCCreateControl(ccsLabel, "act_ter", Empty, ccsText, Empty, CCGetRequestParam("act_ter", Method)) Set prescript = CCCreateControl(ccsLabel, "prescript", Empty, ccsText, Empty, CCGetRequestParam("prescript", Method)) Set ambalaj = CCCreateControl(ccsLabel, "ambalaj", Empty, ccsText, Empty, CCGetRequestParam("ambalaj", Method)) Set volum_amb = CCCreateControl(ccsLabel, "volum_amb", Empty, ccsText, Empty, CCGetRequestParam("volum_amb", Method)) Set valab_amb = CCCreateControl(ccsLabel, "valab_amb", Empty, ccsText, Empty, CCGetRequestParam("valab_amb", Method)) Set cim = CCCreateControl(ccsLabel, "cim", Empty, ccsText, Empty, CCGetRequestParam("cim", Method)) Set firm_tar_p = CCCreateControl(ccsLabel, "firm_tar_p", Empty, ccsText, Empty, CCGetRequestParam("firm_tar_p", Method)) Set firm_tar_d = CCCreateControl(ccsLabel, "firm_tar_d", Empty, ccsText, Empty, CCGetRequestParam("firm_tar_d", Method)) Set nr_dt_amb = CCCreateControl(ccsLabel, "nr_dt_amb", Empty, ccsText, Empty, CCGetRequestParam("nr_dt_amb", Method)) Set link_rcp = CCCreateControl(ccsLink, "link_rcp", "Link Rcp", ccsText, Empty, CCGetRequestParam("link_rcp", Method)) Set link_pro = CCCreateControl(ccsLink, "link_pro", "Link Pro", ccsText, Empty, CCGetRequestParam("link_pro", Method)) Set link_amb = CCCreateControl(ccsLink, "link_amb", "Link Amb", ccsText, Empty, CCGetRequestParam("link_amb", Method)) Set ValidatingControls = new clsControls End Sub 'End anm Class_Initialize Event 'anm Initialize Method @2-F12247EA Sub Initialize(objConnection) If NOT Visible Then Exit Sub Set DataSource.Connection = objConnection With DataSource .Parameters("urlID") = CCGetRequestParam("ID", ccsGET) End With End Sub 'End anm Initialize Method 'anm Class_Terminate Event @2-0C5D276C Private Sub Class_Terminate() Set Errors = Nothing Set Attributes = Nothing End Sub 'End anm Class_Terminate Event 'anm Validate Method @2-B9D513CF Function Validate() Dim Validation ValidatingControls.Validate CCSEventResult = CCRaiseEvent(CCSEvents, "OnValidate", Me) Validate = ValidatingControls.isValid() And (Errors.Count = 0) End Function 'End anm Validate Method 'anm Operation Method @2-541C35C6 Sub Operation() If NOT ( Visible AND FormSubmitted ) Then Exit Sub Redirect = "anm_list.asp?" & CCGetQueryString("QueryString", Array("ccsForm")) End Sub 'End anm Operation Method 'anm Show Method @2-E1C8D7D6 Sub Show(Tpl) If NOT Visible Then Exit Sub CCSEventResult = CCRaiseEvent(CCSEvents, "BeforeSelect", Me) Set Recordset = DataSource.Open(Command) EditMode = Recordset.EditMode(ReadAllowed) HTMLFormAction = FileName & "?" & CCAddParam(Request.ServerVariables("QUERY_STRING"), "ccsForm", "anm" & IIf(EditMode, ":Edit", "")) Set TemplateBlock = Tpl.Block("Record " & ComponentName) If TemplateBlock is Nothing Then Exit Sub TemplateBlock.Variable("HTMLFormName") = ComponentName TemplateBlock.Variable("HTMLFormEnctype") ="application/x-www-form-urlencoded" If DataSource.Errors.Count > 0 Then Errors.AddErrors(DataSource.Errors) DataSource.Errors.Clear With TemplateBlock.Block("Error") .Variable("Error") = Errors.ToString .Parse False End With End If Set Controls = CCCreateCollection(TemplateBlock, Null, ccsParseOverwrite, _ Array(den_com, dci, forma_farm, conc, cod_atc, act_ter, prescript, _ ambalaj, volum_amb, valab_amb, cim, firm_tar_p, firm_tar_d, nr_dt_amb, link_rcp, link_pro, link_amb)) If EditMode AND ReadAllowed Then If Errors.Count = 0 Then If Recordset.Errors.Count > 0 Then With TemplateBlock.Block("Error") .Variable("Error") = Recordset.Errors.ToString .Parse False End With ElseIf Recordset.CanPopulate() Then If Not FormSubmitted Then End If Else EditMode = False End If End If If EditMode Then den_com.Value = Recordset.Fields("den_com") dci.Value = Recordset.Fields("dci") forma_farm.Value = Recordset.Fields("forma_farm") conc.Value = Recordset.Fields("conc") cod_atc.Value = Recordset.Fields("cod_atc") act_ter.Value = Recordset.Fields("act_ter") prescript.Value = Recordset.Fields("prescript") ambalaj.Value = Recordset.Fields("ambalaj") volum_amb.Value = Recordset.Fields("volum_amb") valab_amb.Value = Recordset.Fields("valab_amb") cim.Value = Recordset.Fields("cim") firm_tar_p.Value = Recordset.Fields("firm_tar_p") firm_tar_d.Value = Recordset.Fields("firm_tar_d") nr_dt_amb.Value = Recordset.Fields("nr_dt_amb") link_rcp.Value = Recordset.Fields("link_rcp") link_pro.Value = Recordset.Fields("link_pro") link_amb.Value = Recordset.Fields("link_amb") End If End If link_rcp.Parameters = CCGetQueryString("QueryString", Array("ccsForm")) If EditMode Then link_rcp.Page = Recordset.Fields("link_rcp") Else link_rcp.Parameters = "" link_pro.Parameters = CCGetQueryString("QueryString", Array("ccsForm")) If EditMode Then link_pro.Page = Recordset.Fields("link_pro") Else link_pro.Parameters = "" link_amb.Parameters = CCGetQueryString("QueryString", Array("ccsForm")) If EditMode Then link_amb.Page = Recordset.Fields("link_amb") Else link_amb.Parameters = "" If Not FormSubmitted Then End If If FormSubmitted Then Errors.AddErrors DataSource.Errors With TemplateBlock.Block("Error") .Variable("Error") = Errors.ToString() .Parse False End With End If TemplateBlock.Variable("Action") = IIF(CCSUseAmps, Replace(HTMLFormAction, "&", CCSAmps), HTMLFormAction) CCSEventResult = CCRaiseEvent(CCSEvents, "BeforeShow", Me) If Visible Then Attributes.Show TemplateBlock, "anm" & ":" Controls.Show End If End Sub 'End anm Show Method End Class 'End anm Class @2-A61BA892 Class clsanmDataSource 'anmDataSource Class @2-A21B1428 'DataSource Variables @2-1BBA4B65 Public Errors, Connection, Parameters, CCSEvents Public Recordset Public SQL, CountSQL, Order, Where, Orders, StaticOrder Public PageSize Public PageCount Public AbsolutePage Public Fields Dim WhereParameters Public AllParamsSet Public CmdExecution Public InsertOmitIfEmpty Public UpdateOmitIfEmpty Private CurrentOperation Private CCSEventResult ' Datasource fields Public den_com Public dci Public forma_farm Public conc Public cod_atc Public act_ter Public prescript Public ambalaj Public volum_amb Public valab_amb Public cim Public firm_tar_p Public firm_tar_d Public nr_dt_amb Public link_rcp Public link_pro Public link_amb 'End DataSource Variables 'DataSource Class_Initialize Event @2-18A09D75 Private Sub Class_Initialize() Set CCSEvents = CreateObject("Scripting.Dictionary") Set Fields = New clsFields Set Recordset = New clsDataSource Set Recordset.DataSource = Me Set Errors = New clsErrors Set Connection = Nothing AllParamsSet = True Set den_com = CCCreateField("den_com", "den_com", ccsText, Empty, Recordset) Set dci = CCCreateField("dci", "dci", ccsText, Empty, Recordset) Set forma_farm = CCCreateField("forma_farm", "forma_farm", ccsText, Empty, Recordset) Set conc = CCCreateField("conc", "conc", ccsText, Empty, Recordset) Set cod_atc = CCCreateField("cod_atc", "cod_atc", ccsText, Empty, Recordset) Set act_ter = CCCreateField("act_ter", "act_ter", ccsText, Empty, Recordset) Set prescript = CCCreateField("prescript", "prescript", ccsText, Empty, Recordset) Set ambalaj = CCCreateField("ambalaj", "ambalaj", ccsText, Empty, Recordset) Set volum_amb = CCCreateField("volum_amb", "volum_amb", ccsText, Empty, Recordset) Set valab_amb = CCCreateField("valab_amb", "valab_amb", ccsText, Empty, Recordset) Set cim = CCCreateField("cim", "cim", ccsText, Empty, Recordset) Set firm_tar_p = CCCreateField("firm_tar_p", "firm_tar_p", ccsText, Empty, Recordset) Set firm_tar_d = CCCreateField("firm_tar_d", "firm_tar_d", ccsText, Empty, Recordset) Set nr_dt_amb = CCCreateField("nr_dt_amb", "nr_dt_amb", ccsText, Empty, Recordset) Set link_rcp = CCCreateField("link_rcp", "link_rcp", ccsText, Empty, Recordset) Set link_pro = CCCreateField("link_pro", "link_pro", ccsText, Empty, Recordset) Set link_amb = CCCreateField("link_amb", "link_amb", ccsText, Empty, Recordset) Fields.AddFields Array(den_com, dci, forma_farm, conc, cod_atc, act_ter, prescript, _ ambalaj, volum_amb, valab_amb, cim, firm_tar_p, firm_tar_d, nr_dt_amb, link_rcp, link_pro, link_amb) Set Parameters = Server.CreateObject("Scripting.Dictionary") Set WhereParameters = Nothing SQL = "SELECT * " & vbLf & _ "FROM anm {SQL_Where} {SQL_OrderBy}" Where = "" Order = "" StaticOrder = "" End Sub 'End DataSource Class_Initialize Event 'BuildTableWhere Method @2-65DC853B Public Sub BuildTableWhere() Dim WhereParams If Not WhereParameters Is Nothing Then _ Exit Sub Set WhereParameters = new clsSQLParameters With WhereParameters Set .Connection = Connection Set .ParameterSources = Parameters Set .DataSource = Me .AddParameter 1, "urlID", ccsInteger, Empty, Empty, Empty, False AllParamsSet = .AllParamsSet .Criterion(1) = .Operation(opEqual, False, "ID", .getParamByID(1)) .AssembledWhere = .Criterion(1) WhereParams = .AssembledWhere If Len(Where) > 0 Then If Len(WhereParams) > 0 Then _ Where = Where & " AND " & WhereParams Else If Len(WhereParams) > 0 Then _ Where = WhereParams End If End With End Sub 'End BuildTableWhere Method 'Open Method @2-48A2DA7D Function Open(Cmd) Errors.Clear If Connection Is Nothing Then Set Open = New clsEmptyDataSource Exit Function End If Set Cmd.Connection = Connection Cmd.CommandOperation = cmdOpen Cmd.PageSize = PageSize Cmd.ActivePage = AbsolutePage Cmd.CommandType = dsTable CCSEventResult = CCRaiseEvent(CCSEvents, "BeforeBuildSelect", Me) Cmd.SQL = SQL BuildTableWhere Cmd.Where = Where Cmd.OrderBy = Order If(Len(StaticOrder)>0) Then If Len(Order)>0 Then Cmd.OrderBy = ", "+Cmd.OrderBy Cmd.OrderBy = StaticOrder + Cmd.OrderBy End If Cmd.Options("TOP") = True If Not AllParamsSet Then Set Open = New clsEmptyDataSource Exit Function End If CCSEventResult = CCRaiseEvent(CCSEvents, "BeforeExecuteSelect", Me) If Errors.Count = 0 And CCSEventResult Then _ Set Recordset = Cmd.Exec(Errors) CCSEventResult = CCRaiseEvent(CCSEvents, "AfterExecuteSelect", Me) Set Recordset.FieldsCollection = Fields Set Open = Recordset End Function 'End Open Method 'DataSource Class_Terminate Event @2-41B4B08D Private Sub Class_Terminate() If Recordset.State = adStateOpen Then _ Recordset.Close Set Recordset = Nothing Set Parameters = Nothing Set Errors = Nothing End Sub 'End DataSource Class_Terminate Event End Class 'End anmDataSource Class @2-A61BA892 %>