<%@ CodePage="1252" LCID="1046" %> <% Response.Buffer = EW_RESPONSE_BUFFER %> <% Session.Timeout = 20 %> <% Call ew_Header(False, EW_CHARSET) %> <% ' Define page object Dim mapa_transfusional_add Set mapa_transfusional_add = New cmapa_transfusional_add Set Page = mapa_transfusional_add ' Page init processing Call mapa_transfusional_add.Page_Init() ' Page main processing Call mapa_transfusional_add.Page_Main() %> <% mapa_transfusional_add.ShowPageHeader() %>

<%= Language.Phrase("Add") %> <%= Language.Phrase("TblTypeTABLE") %><%= mapa_transfusional.TableCaption %>

<%= Language.Phrase("GoBack") %>

<% mapa_transfusional_add.ShowMessage %>

<% If mapa_transfusional.DATA.Visible Then ' DATA %> > > >  <%= Language.Phrase(" title="<%= Language.Phrase("PickDate") %>" style="cursor:pointer;cursor:hand;"> <%= mapa_transfusional.DATA.CustomMsg %> <% End If %> <% If mapa_transfusional.REGISTRO_GERAL.Visible Then ' REGISTRO_GERAL %> > > <% If mapa_transfusional.REGISTRO_GERAL.SessionValue <> "" Then %> ><%= mapa_transfusional.REGISTRO_GERAL.ViewValue %> <% Else %> <% End If %> <%= mapa_transfusional.REGISTRO_GERAL.CustomMsg %> <% End If %> <% If mapa_transfusional.ESPECIE.Visible Then ' ESPECIE %> > > <%= mapa_transfusional.ESPECIE.CustomMsg %> <% End If %> <% If mapa_transfusional.NUMERO_BOLSA.Visible Then ' NUMERO_BOLSA %> > > <%= mapa_transfusional.NUMERO_BOLSA.CustomMsg %> <% End If %> <% If mapa_transfusional.HORA_INICIAL.Visible Then ' HORA_INICIAL %> > > > <%= mapa_transfusional.HORA_INICIAL.CustomMsg %> <% End If %> <% If mapa_transfusional.RESPONSAVEL1.Visible Then ' RESPONSAVEL1 %> > > <%= mapa_transfusional.RESPONSAVEL1.CustomMsg %> <% End If %> <% If mapa_transfusional.REVISAO_130.Visible Then ' REVISAO_130 %> > > > <%= mapa_transfusional.REVISAO_130.CustomMsg %> <% End If %> <% If mapa_transfusional.RESPONSAVEL2.Visible Then ' RESPONSAVEL2 %> > > <%= mapa_transfusional.RESPONSAVEL2.CustomMsg %> <% End If %> <% If mapa_transfusional.HORA_FINAL.Visible Then ' HORA_FINAL %> > > > <%= mapa_transfusional.HORA_FINAL.CustomMsg %> <% End If %> <% If mapa_transfusional.RESPONSAVEL3.Visible Then ' RESPONSAVEL3 %> > > <%= mapa_transfusional.RESPONSAVEL3.CustomMsg %> <% End If %> <% If mapa_transfusional.PA_INICIAL.Visible Then ' PA_INICIAL %> > > > <%= mapa_transfusional.PA_INICIAL.CustomMsg %> <% End If %> <% If mapa_transfusional.PA_FINAL.Visible Then ' PA_FINAL %> > > > <%= mapa_transfusional.PA_FINAL.CustomMsg %> <% End If %> <% If mapa_transfusional.TEMP_INICIAL.Visible Then ' TEMP_INICIAL %> > > > <%= mapa_transfusional.TEMP_INICIAL.CustomMsg %> <% End If %> <% If mapa_transfusional.TEMP_FINAL.Visible Then ' TEMP_FINAL %> > > > <%= mapa_transfusional.TEMP_FINAL.CustomMsg %> <% End If %> <% If mapa_transfusional.PULSO_ART_INICIAL.Visible Then ' PULSO_ART_INICIAL %> > > > <%= mapa_transfusional.PULSO_ART_INICIAL.CustomMsg %> <% End If %> <% If mapa_transfusional.PULSO_ART_FINAL.Visible Then ' PULSO_ART_FINAL %> > > > <%= mapa_transfusional.PULSO_ART_FINAL.CustomMsg %> <% End If %> <% If mapa_transfusional.OBS.Visible Then ' OBS %> > > <%= mapa_transfusional.OBS.CustomMsg %> <% End If %>
<%= mapa_transfusional.DATA.FldCaption %><%= Language.Phrase("FieldRequiredIndicator") %>
<%= mapa_transfusional.REGISTRO_GERAL.FldCaption %><%= Language.Phrase("FieldRequiredIndicator") %>
<%= mapa_transfusional.ESPECIE.FldCaption %><%= Language.Phrase("FieldRequiredIndicator") %>
<%= mapa_transfusional.NUMERO_BOLSA.FldCaption %><%= Language.Phrase("FieldRequiredIndicator") %>
<%= mapa_transfusional.HORA_INICIAL.FldCaption %><%= Language.Phrase("FieldRequiredIndicator") %>
<%= mapa_transfusional.RESPONSAVEL1.FldCaption %><%= Language.Phrase("FieldRequiredIndicator") %>
<%= mapa_transfusional.REVISAO_130.FldCaption %><%= Language.Phrase("FieldRequiredIndicator") %>
<%= mapa_transfusional.RESPONSAVEL2.FldCaption %><%= Language.Phrase("FieldRequiredIndicator") %>
<%= mapa_transfusional.HORA_FINAL.FldCaption %><%= Language.Phrase("FieldRequiredIndicator") %>
<%= mapa_transfusional.RESPONSAVEL3.FldCaption %><%= Language.Phrase("FieldRequiredIndicator") %>
<%= mapa_transfusional.PA_INICIAL.FldCaption %><%= Language.Phrase("FieldRequiredIndicator") %>
<%= mapa_transfusional.PA_FINAL.FldCaption %><%= Language.Phrase("FieldRequiredIndicator") %>
<%= mapa_transfusional.TEMP_INICIAL.FldCaption %><%= Language.Phrase("FieldRequiredIndicator") %>
<%= mapa_transfusional.TEMP_FINAL.FldCaption %><%= Language.Phrase("FieldRequiredIndicator") %>
<%= mapa_transfusional.PULSO_ART_INICIAL.FldCaption %><%= Language.Phrase("FieldRequiredIndicator") %>
<%= mapa_transfusional.PULSO_ART_FINAL.FldCaption %><%= Language.Phrase("FieldRequiredIndicator") %>
<%= mapa_transfusional.OBS.FldCaption %>

">

<% mapa_transfusional_add.ShowPageFooter() If EW_DEBUG_ENABLED Then Response.Write ew_DebugMsg() %> <% ' Drop page object Set mapa_transfusional_add = Nothing %> <% ' ----------------------------------------------------------------- ' Page Class ' Class cmapa_transfusional_add ' Page ID Public Property Get PageID() PageID = "add" End Property ' Table Name Public Property Get TableName() TableName = "mapa_transfusional" End Property ' Page Object Name Public Property Get PageObjName() PageObjName = "mapa_transfusional_add" End Property ' Page Name Public Property Get PageName() PageName = ew_CurrentPage() End Property ' Page Url Public Property Get PageUrl() PageUrl = ew_CurrentPage() & "?" If mapa_transfusional.UseTokenInUrl Then PageUrl = PageUrl & "t=" & mapa_transfusional.TableVar & "&" ' add page token End Property ' Message Public Property Get Message() Message = Session(EW_SESSION_MESSAGE) End Property Public Property Let Message(v) Dim msg msg = Session(EW_SESSION_MESSAGE) Call ew_AddMessage(msg, v) Session(EW_SESSION_MESSAGE) = msg End Property Public Property Get FailureMessage() FailureMessage = Session(EW_SESSION_FAILURE_MESSAGE) End Property Public Property Let FailureMessage(v) Dim msg msg = Session(EW_SESSION_FAILURE_MESSAGE) Call ew_AddMessage(msg, v) Session(EW_SESSION_FAILURE_MESSAGE) = msg End Property Public Property Get SuccessMessage() SuccessMessage = Session(EW_SESSION_SUCCESS_MESSAGE) End Property Public Property Let SuccessMessage(v) Dim msg msg = Session(EW_SESSION_SUCCESS_MESSAGE) Call ew_AddMessage(msg, v) Session(EW_SESSION_SUCCESS_MESSAGE) = msg End Property ' Show Message Public Sub ShowMessage() Dim sMessage sMessage = Message Call Message_Showing(sMessage, "") If sMessage <> "" Then Response.Write "

" & sMessage & "

" Session(EW_SESSION_MESSAGE) = "" ' Clear message in Session ' Success message Dim sSuccessMessage sSuccessMessage = SuccessMessage Call Message_Showing(sSuccessMessage, "success") If sSuccessMessage <> "" Then Response.Write "

" & sSuccessMessage & "

" Session(EW_SESSION_SUCCESS_MESSAGE) = "" ' Clear message in Session ' Failure message Dim sErrorMessage sErrorMessage = FailureMessage Call Message_Showing(sErrorMessage, "failure") If sErrorMessage <> "" Then Response.Write "

" & sErrorMessage & "

" Session(EW_SESSION_FAILURE_MESSAGE) = "" ' Clear message in Session End Sub Dim PageHeader Dim PageFooter ' Show Page Header Public Sub ShowPageHeader() Dim sHeader sHeader = PageHeader Call Page_DataRendering(sHeader) If sHeader <> "" Then ' Header exists, display Response.Write "

" & sHeader & "

" End If End Sub ' Show Page Footer Public Sub ShowPageFooter() Dim sFooter sFooter = PageFooter Call Page_DataRendered(sFooter) If sFooter <> "" Then ' Footer exists, display Response.Write "

" & sFooter & "

" End If End Sub ' ----------------------- ' Validate Page request ' Public Function IsPageRequest() If mapa_transfusional.UseTokenInUrl Then IsPageRequest = False If Not (ObjForm Is Nothing) Then IsPageRequest = (mapa_transfusional.TableVar = ObjForm.GetValue("t")) End If If Request.QueryString("t").Count > 0 Then IsPageRequest = (mapa_transfusional.TableVar = Request.QueryString("t")) End If Else IsPageRequest = True End If End Function ' ----------------------------------------------------------------- ' Class initialize ' - init objects ' - open ADO connection ' Private Sub Class_Initialize() If IsEmpty(StartTimer) Then StartTimer = Timer ' Init start time ' Initialize language object If IsEmpty(Language) Then Set Language = New cLanguage Call Language.LoadPhrases() End If ' Initialize table object If IsEmpty(mapa_transfusional) Then Set mapa_transfusional = New cmapa_transfusional Set Table = mapa_transfusional ' Initialize urls ' Initialize other table object If IsEmpty(receptor) Then Set receptor = New creceptor ' Initialize form object Set ObjForm = Nothing ' Intialize page id (for backward compatibility) EW_PAGE_ID = "add" ' Initialize table name (for backward compatibility) EW_TABLE_NAME = "mapa_transfusional" ' Open connection to the database If IsEmpty(Conn) Then Call ew_Connect() End Sub ' ----------------------------------------------------------------- ' Subroutine Page_Init ' - called before page main ' - check Security ' - set up response header ' - call page load events ' Sub Page_Init() ' Create form object Set ObjForm = New cFormObj ' Global page loading event (in userfn7.asp) Call Page_Loading() ' Page load event, used in current page Call Page_Load() End Sub ' ----------------------------------------------------------------- ' Class terminate ' - clean up page object ' Private Sub Class_Terminate() Call Page_Terminate("") End Sub ' ----------------------------------------------------------------- ' Subroutine Page_Terminate ' - called when exit page ' - clean up ADO connection and objects ' - if url specified, redirect to url ' Sub Page_Terminate(url) ' Page unload event, used in current page Call Page_Unload() ' Global page unloaded event (in userfn60.asp) Call Page_Unloaded() Dim sRedirectUrl sReDirectUrl = url Call Page_Redirecting(sReDirectUrl) If Not (Conn Is Nothing) Then Conn.Close ' Close Connection Set Conn = Nothing Set mapa_transfusional = Nothing Set ObjForm = Nothing ' Go to url if specified If sReDirectUrl <> "" Then If Response.Buffer Then Response.Clear Response.Redirect sReDirectUrl End If End Sub ' ' Subroutine Page_Terminate (End) ' ---------------------------------------- Dim DbMasterFilter, DbDetailFilter Dim Priv Dim OldRecordset Dim CopyRecord ' ----------------------------------------------------------------- ' Page main processing ' Sub Page_Main() ' Set up master detail parameters SetUpMasterParms() ' Process form if post back If ObjForm.GetValue("a_add")&"" <> "" Then mapa_transfusional.CurrentAction = ObjForm.GetValue("a_add") ' Get form action CopyRecord = LoadOldRecord() ' Load old recordset Call LoadFormValues() ' Load form values ' Validate Form If Not ValidateForm() Then mapa_transfusional.CurrentAction = "I" ' Form error, reset action mapa_transfusional.EventCancelled = True ' Event cancelled Call RestoreFormValues() ' Restore form values FailureMessage = gsFormError End If ' Not post back Else ' Load key values from QueryString CopyRecord = True If Request.QueryString("ID").Count > 0 Then mapa_transfusional.ID.QueryStringValue = Request.QueryString("ID") Call mapa_transfusional.SetKey("ID", mapa_transfusional.ID.CurrentValue) ' Set up key Else Call mapa_transfusional.SetKey("ID", "") ' Clear key CopyRecord = False End If If CopyRecord Then mapa_transfusional.CurrentAction = "C" ' Copy Record Else mapa_transfusional.CurrentAction = "I" ' Display Blank Record Call LoadDefaultValues() ' Load default values End If End If ' Perform action based on action code Select Case mapa_transfusional.CurrentAction Case "I" ' Blank record, no action required Case "C" ' Copy an existing record If Not LoadRow() Then ' Load record based on key FailureMessage = Language.Phrase("NoRecord") ' No record found Call Page_Terminate("mapa_transfusionallist.asp") ' No matching record, return to list End If Case "A" ' Add new record mapa_transfusional.SendEmail = True ' Send email on add success If AddRow(OldRecordset) Then ' Add successful SuccessMessage = Language.Phrase("AddSuccess") ' Set up success message Dim sReturnUrl sReturnUrl = mapa_transfusional.ReturnUrl If ew_GetPageName(sReturnUrl) = "mapa_transfusionalview.asp" Then sReturnUrl = mapa_transfusional.ViewUrl ' View paging, return to view page with keyurl directly Call Page_Terminate(sReturnUrl) ' Clean up and return Else mapa_transfusional.EventCancelled = True ' Event cancelled Call RestoreFormValues() ' Add failed, restore form values End If End Select ' Render row based on row type mapa_transfusional.RowType = EW_ROWTYPE_ADD ' Render add type ' Render row Call mapa_transfusional.ResetAttrs() Call RenderRow() End Sub ' ----------------------------------------------------------------- ' Function Get upload files ' Function GetUploadFiles() ' Get upload data Dim index, confirmPage index = ObjForm.Index ' Save form index ObjForm.Index = 0 confirmPage = (ObjForm.GetValue("a_confirm") & "" <> "") ObjForm.Index = index ' Restore form index End Function ' ----------------------------------------------------------------- ' Load default values ' Function LoadDefaultValues() mapa_transfusional.DATA.CurrentValue = Null mapa_transfusional.DATA.OldValue = mapa_transfusional.DATA.CurrentValue mapa_transfusional.REGISTRO_GERAL.CurrentValue = Null mapa_transfusional.REGISTRO_GERAL.OldValue = mapa_transfusional.REGISTRO_GERAL.CurrentValue mapa_transfusional.ESPECIE.CurrentValue = Null mapa_transfusional.ESPECIE.OldValue = mapa_transfusional.ESPECIE.CurrentValue mapa_transfusional.NUMERO_BOLSA.CurrentValue = Null mapa_transfusional.NUMERO_BOLSA.OldValue = mapa_transfusional.NUMERO_BOLSA.CurrentValue mapa_transfusional.HORA_INICIAL.CurrentValue = Null mapa_transfusional.HORA_INICIAL.OldValue = mapa_transfusional.HORA_INICIAL.CurrentValue mapa_transfusional.RESPONSAVEL1.CurrentValue = Null mapa_transfusional.RESPONSAVEL1.OldValue = mapa_transfusional.RESPONSAVEL1.CurrentValue mapa_transfusional.REVISAO_130.CurrentValue = Null mapa_transfusional.REVISAO_130.OldValue = mapa_transfusional.REVISAO_130.CurrentValue mapa_transfusional.RESPONSAVEL2.CurrentValue = Null mapa_transfusional.RESPONSAVEL2.OldValue = mapa_transfusional.RESPONSAVEL2.CurrentValue mapa_transfusional.HORA_FINAL.CurrentValue = Null mapa_transfusional.HORA_FINAL.OldValue = mapa_transfusional.HORA_FINAL.CurrentValue mapa_transfusional.RESPONSAVEL3.CurrentValue = Null mapa_transfusional.RESPONSAVEL3.OldValue = mapa_transfusional.RESPONSAVEL3.CurrentValue mapa_transfusional.PA_INICIAL.CurrentValue = Null mapa_transfusional.PA_INICIAL.OldValue = mapa_transfusional.PA_INICIAL.CurrentValue mapa_transfusional.PA_FINAL.CurrentValue = Null mapa_transfusional.PA_FINAL.OldValue = mapa_transfusional.PA_FINAL.CurrentValue mapa_transfusional.TEMP_INICIAL.CurrentValue = Null mapa_transfusional.TEMP_INICIAL.OldValue = mapa_transfusional.TEMP_INICIAL.CurrentValue mapa_transfusional.TEMP_FINAL.CurrentValue = Null mapa_transfusional.TEMP_FINAL.OldValue = mapa_transfusional.TEMP_FINAL.CurrentValue mapa_transfusional.PULSO_ART_INICIAL.CurrentValue = Null mapa_transfusional.PULSO_ART_INICIAL.OldValue = mapa_transfusional.PULSO_ART_INICIAL.CurrentValue mapa_transfusional.PULSO_ART_FINAL.CurrentValue = Null mapa_transfusional.PULSO_ART_FINAL.OldValue = mapa_transfusional.PULSO_ART_FINAL.CurrentValue mapa_transfusional.OBS.CurrentValue = Null mapa_transfusional.OBS.OldValue = mapa_transfusional.OBS.CurrentValue End Function ' ----------------------------------------------------------------- ' Load form values ' Function LoadFormValues() ' Load values from form If Not mapa_transfusional.DATA.FldIsDetailKey Then mapa_transfusional.DATA.FormValue = ObjForm.GetValue("x_DATA") If Not mapa_transfusional.DATA.FldIsDetailKey Then mapa_transfusional.DATA.CurrentValue = ew_UnFormatDateTime(mapa_transfusional.DATA.CurrentValue, 7) If Not mapa_transfusional.REGISTRO_GERAL.FldIsDetailKey Then mapa_transfusional.REGISTRO_GERAL.FormValue = ObjForm.GetValue("x_REGISTRO_GERAL") If Not mapa_transfusional.ESPECIE.FldIsDetailKey Then mapa_transfusional.ESPECIE.FormValue = ObjForm.GetValue("x_ESPECIE") If Not mapa_transfusional.NUMERO_BOLSA.FldIsDetailKey Then mapa_transfusional.NUMERO_BOLSA.FormValue = ObjForm.GetValue("x_NUMERO_BOLSA") If Not mapa_transfusional.HORA_INICIAL.FldIsDetailKey Then mapa_transfusional.HORA_INICIAL.FormValue = ObjForm.GetValue("x_HORA_INICIAL") If Not mapa_transfusional.RESPONSAVEL1.FldIsDetailKey Then mapa_transfusional.RESPONSAVEL1.FormValue = ObjForm.GetValue("x_RESPONSAVEL1") If Not mapa_transfusional.REVISAO_130.FldIsDetailKey Then mapa_transfusional.REVISAO_130.FormValue = ObjForm.GetValue("x_REVISAO_130") If Not mapa_transfusional.RESPONSAVEL2.FldIsDetailKey Then mapa_transfusional.RESPONSAVEL2.FormValue = ObjForm.GetValue("x_RESPONSAVEL2") If Not mapa_transfusional.HORA_FINAL.FldIsDetailKey Then mapa_transfusional.HORA_FINAL.FormValue = ObjForm.GetValue("x_HORA_FINAL") If Not mapa_transfusional.RESPONSAVEL3.FldIsDetailKey Then mapa_transfusional.RESPONSAVEL3.FormValue = ObjForm.GetValue("x_RESPONSAVEL3") If Not mapa_transfusional.PA_INICIAL.FldIsDetailKey Then mapa_transfusional.PA_INICIAL.FormValue = ObjForm.GetValue("x_PA_INICIAL") If Not mapa_transfusional.PA_FINAL.FldIsDetailKey Then mapa_transfusional.PA_FINAL.FormValue = ObjForm.GetValue("x_PA_FINAL") If Not mapa_transfusional.TEMP_INICIAL.FldIsDetailKey Then mapa_transfusional.TEMP_INICIAL.FormValue = ObjForm.GetValue("x_TEMP_INICIAL") If Not mapa_transfusional.TEMP_FINAL.FldIsDetailKey Then mapa_transfusional.TEMP_FINAL.FormValue = ObjForm.GetValue("x_TEMP_FINAL") If Not mapa_transfusional.PULSO_ART_INICIAL.FldIsDetailKey Then mapa_transfusional.PULSO_ART_INICIAL.FormValue = ObjForm.GetValue("x_PULSO_ART_INICIAL") If Not mapa_transfusional.PULSO_ART_FINAL.FldIsDetailKey Then mapa_transfusional.PULSO_ART_FINAL.FormValue = ObjForm.GetValue("x_PULSO_ART_FINAL") If Not mapa_transfusional.OBS.FldIsDetailKey Then mapa_transfusional.OBS.FormValue = ObjForm.GetValue("x_OBS") End Function ' ----------------------------------------------------------------- ' Restore form values ' Function RestoreFormValues() Call LoadOldRecord() mapa_transfusional.DATA.CurrentValue = mapa_transfusional.DATA.FormValue mapa_transfusional.DATA.CurrentValue = ew_UnFormatDateTime(mapa_transfusional.DATA.CurrentValue, 7) mapa_transfusional.REGISTRO_GERAL.CurrentValue = mapa_transfusional.REGISTRO_GERAL.FormValue mapa_transfusional.ESPECIE.CurrentValue = mapa_transfusional.ESPECIE.FormValue mapa_transfusional.NUMERO_BOLSA.CurrentValue = mapa_transfusional.NUMERO_BOLSA.FormValue mapa_transfusional.HORA_INICIAL.CurrentValue = mapa_transfusional.HORA_INICIAL.FormValue mapa_transfusional.RESPONSAVEL1.CurrentValue = mapa_transfusional.RESPONSAVEL1.FormValue mapa_transfusional.REVISAO_130.CurrentValue = mapa_transfusional.REVISAO_130.FormValue mapa_transfusional.RESPONSAVEL2.CurrentValue = mapa_transfusional.RESPONSAVEL2.FormValue mapa_transfusional.HORA_FINAL.CurrentValue = mapa_transfusional.HORA_FINAL.FormValue mapa_transfusional.RESPONSAVEL3.CurrentValue = mapa_transfusional.RESPONSAVEL3.FormValue mapa_transfusional.PA_INICIAL.CurrentValue = mapa_transfusional.PA_INICIAL.FormValue mapa_transfusional.PA_FINAL.CurrentValue = mapa_transfusional.PA_FINAL.FormValue mapa_transfusional.TEMP_INICIAL.CurrentValue = mapa_transfusional.TEMP_INICIAL.FormValue mapa_transfusional.TEMP_FINAL.CurrentValue = mapa_transfusional.TEMP_FINAL.FormValue mapa_transfusional.PULSO_ART_INICIAL.CurrentValue = mapa_transfusional.PULSO_ART_INICIAL.FormValue mapa_transfusional.PULSO_ART_FINAL.CurrentValue = mapa_transfusional.PULSO_ART_FINAL.FormValue mapa_transfusional.OBS.CurrentValue = mapa_transfusional.OBS.FormValue End Function ' ----------------------------------------------------------------- ' Load row based on key values ' Function LoadRow() Dim RsRow, sSql, sFilter sFilter = mapa_transfusional.KeyFilter ' Call Row Selecting event Call mapa_transfusional.Row_Selecting(sFilter) ' Load sql based on filter mapa_transfusional.CurrentFilter = sFilter sSql = mapa_transfusional.SQL Call ew_SetDebugMsg("LoadRow: " & sSql) ' Show SQL for debugging Set RsRow = ew_LoadRow(sSql) If RsRow.Eof Then LoadRow = False Else LoadRow = True RsRow.MoveFirst Call LoadRowValues(RsRow) ' Load row values End If RsRow.Close Set RsRow = Nothing End Function ' ----------------------------------------------------------------- ' Load row values from recordset ' Sub LoadRowValues(RsRow) Dim sDetailFilter If RsRow.Eof Then Exit Sub ' Call Row Selected event Call mapa_transfusional.Row_Selected(RsRow) mapa_transfusional.ID.DbValue = RsRow("ID") mapa_transfusional.DATA.DbValue = RsRow("DATA") mapa_transfusional.REGISTRO_GERAL.DbValue = RsRow("REGISTRO_GERAL") If ew_FieldExistInRs(RsRow, "EV__REGISTRO_GERAL") Then mapa_transfusional.REGISTRO_GERAL.VirtualValue = RsRow("EV__REGISTRO_GERAL") ' Set up virtual field value Else mapa_transfusional.REGISTRO_GERAL.VirtualValue = "" ' Clear value End If mapa_transfusional.ESPECIE.DbValue = RsRow("ESPECIE") mapa_transfusional.NUMERO_BOLSA.DbValue = RsRow("NUMERO_BOLSA") If ew_FieldExistInRs(RsRow, "EV__NUMERO_BOLSA") Then mapa_transfusional.NUMERO_BOLSA.VirtualValue = RsRow("EV__NUMERO_BOLSA") ' Set up virtual field value Else mapa_transfusional.NUMERO_BOLSA.VirtualValue = "" ' Clear value End If mapa_transfusional.HORA_INICIAL.DbValue = RsRow("HORA_INICIAL") mapa_transfusional.RESPONSAVEL1.DbValue = RsRow("RESPONSAVEL1") If ew_FieldExistInRs(RsRow, "EV__RESPONSAVEL1") Then mapa_transfusional.RESPONSAVEL1.VirtualValue = RsRow("EV__RESPONSAVEL1") ' Set up virtual field value Else mapa_transfusional.RESPONSAVEL1.VirtualValue = "" ' Clear value End If mapa_transfusional.REVISAO_130.DbValue = RsRow("REVISAO_130") mapa_transfusional.RESPONSAVEL2.DbValue = RsRow("RESPONSAVEL2") If ew_FieldExistInRs(RsRow, "EV__RESPONSAVEL2") Then mapa_transfusional.RESPONSAVEL2.VirtualValue = RsRow("EV__RESPONSAVEL2") ' Set up virtual field value Else mapa_transfusional.RESPONSAVEL2.VirtualValue = "" ' Clear value End If mapa_transfusional.HORA_FINAL.DbValue = RsRow("HORA_FINAL") mapa_transfusional.RESPONSAVEL3.DbValue = RsRow("RESPONSAVEL3") If ew_FieldExistInRs(RsRow, "EV__RESPONSAVEL3") Then mapa_transfusional.RESPONSAVEL3.VirtualValue = RsRow("EV__RESPONSAVEL3") ' Set up virtual field value Else mapa_transfusional.RESPONSAVEL3.VirtualValue = "" ' Clear value End If mapa_transfusional.PA_INICIAL.DbValue = RsRow("PA_INICIAL") mapa_transfusional.PA_FINAL.DbValue = RsRow("PA_FINAL") mapa_transfusional.TEMP_INICIAL.DbValue = RsRow("TEMP_INICIAL") mapa_transfusional.TEMP_FINAL.DbValue = RsRow("TEMP_FINAL") mapa_transfusional.PULSO_ART_INICIAL.DbValue = RsRow("PULSO_ART_INICIAL") mapa_transfusional.PULSO_ART_FINAL.DbValue = RsRow("PULSO_ART_FINAL") mapa_transfusional.OBS.DbValue = RsRow("OBS") End Sub ' Load old record Function LoadOldRecord() ' Load key values from Session Dim bValidKey bValidKey = True If mapa_transfusional.GetKey("ID")&"" <> "" Then mapa_transfusional.ID.CurrentValue = mapa_transfusional.GetKey("ID") ' ID Else bValidKey = False End If ' Load old recordset If bValidKey Then mapa_transfusional.CurrentFilter = mapa_transfusional.KeyFilter Dim sSql sSql = mapa_transfusional.SQL Set OldRecordset = ew_LoadRecordset(sSql) Call LoadRowValues(OldRecordset) ' Load row values Else OldRecordset = Null End If LoadOldRecord = bValidKey End Function ' ----------------------------------------------------------------- ' Render row values based on field settings ' Sub RenderRow() ' Initialize urls ' Call Row Rendering event Call mapa_transfusional.Row_Rendering() ' --------------------------------------- ' Common render codes for all row types ' --------------------------------------- ' ID ' DATA ' REGISTRO_GERAL ' ESPECIE ' NUMERO_BOLSA ' HORA_INICIAL ' RESPONSAVEL1 ' REVISAO_130 ' RESPONSAVEL2 ' HORA_FINAL ' RESPONSAVEL3 ' PA_INICIAL ' PA_FINAL ' TEMP_INICIAL ' TEMP_FINAL ' PULSO_ART_INICIAL ' PULSO_ART_FINAL ' OBS ' ----------- ' View Row ' ----------- If mapa_transfusional.RowType = EW_ROWTYPE_VIEW Then ' View row ' ID mapa_transfusional.ID.ViewValue = mapa_transfusional.ID.CurrentValue mapa_transfusional.ID.CssStyle = "text-align:center;" mapa_transfusional.ID.ViewCustomAttributes = "" ' DATA mapa_transfusional.DATA.ViewValue = mapa_transfusional.DATA.CurrentValue mapa_transfusional.DATA.ViewValue = ew_FormatDateTime(mapa_transfusional.DATA.ViewValue, 7) mapa_transfusional.DATA.CssStyle = "text-align:center;" mapa_transfusional.DATA.ViewCustomAttributes = "" ' REGISTRO_GERAL If mapa_transfusional.REGISTRO_GERAL.VirtualValue <> "" Then mapa_transfusional.REGISTRO_GERAL.ViewValue = mapa_transfusional.REGISTRO_GERAL.VirtualValue Else If mapa_transfusional.REGISTRO_GERAL.CurrentValue & "" <> "" Then sFilterWrk = "`REGISTRO_GERAL` = " & ew_AdjustSql(mapa_transfusional.REGISTRO_GERAL.CurrentValue) & "" sSqlWrk = "SELECT `REGISTRO_GERAL` FROM `receptor`" sWhereWrk = "" Call ew_AddFilter(sWhereWrk, sFilterWrk) If sWhereWrk <> "" Then sSqlWrk = sSqlWrk & " WHERE " & sWhereWrk sSqlWrk = sSqlWrk & " ORDER BY `REGISTRO_GERAL` Desc" Set RsWrk = Conn.Execute(sSqlWrk) If Not RsWrk.Eof Then mapa_transfusional.REGISTRO_GERAL.ViewValue = RsWrk("REGISTRO_GERAL") Else mapa_transfusional.REGISTRO_GERAL.ViewValue = mapa_transfusional.REGISTRO_GERAL.CurrentValue End If RsWrk.Close Set RsWrk = Nothing Else mapa_transfusional.REGISTRO_GERAL.ViewValue = Null End If End If mapa_transfusional.REGISTRO_GERAL.CssStyle = "text-align:center;" mapa_transfusional.REGISTRO_GERAL.ViewCustomAttributes = "" ' ESPECIE If Not IsNull(mapa_transfusional.ESPECIE.CurrentValue) Then Select Case mapa_transfusional.ESPECIE.CurrentValue Case "CH" mapa_transfusional.ESPECIE.ViewValue = ew_IIf(mapa_transfusional.ESPECIE.FldTagCaption(1) <> "", mapa_transfusional.ESPECIE.FldTagCaption(1), "CH") Case "CHI" mapa_transfusional.ESPECIE.ViewValue = ew_IIf(mapa_transfusional.ESPECIE.FldTagCaption(2) <> "", mapa_transfusional.ESPECIE.FldTagCaption(2), "CHI") Case "CHFI" mapa_transfusional.ESPECIE.ViewValue = ew_IIf(mapa_transfusional.ESPECIE.FldTagCaption(3) <> "", mapa_transfusional.ESPECIE.FldTagCaption(3), "CHFI") Case "PFC" mapa_transfusional.ESPECIE.ViewValue = ew_IIf(mapa_transfusional.ESPECIE.FldTagCaption(4) <> "", mapa_transfusional.ESPECIE.FldTagCaption(4), "PFC") Case "CRIO" mapa_transfusional.ESPECIE.ViewValue = ew_IIf(mapa_transfusional.ESPECIE.FldTagCaption(5) <> "", mapa_transfusional.ESPECIE.FldTagCaption(5), "CRIO") Case "CP" mapa_transfusional.ESPECIE.ViewValue = ew_IIf(mapa_transfusional.ESPECIE.FldTagCaption(6) <> "", mapa_transfusional.ESPECIE.FldTagCaption(6), "CP") Case "CPI" mapa_transfusional.ESPECIE.ViewValue = ew_IIf(mapa_transfusional.ESPECIE.FldTagCaption(7) <> "", mapa_transfusional.ESPECIE.FldTagCaption(7), "CPI") Case Else mapa_transfusional.ESPECIE.ViewValue = mapa_transfusional.ESPECIE.CurrentValue End Select Else mapa_transfusional.ESPECIE.ViewValue = Null End If mapa_transfusional.ESPECIE.CssStyle = "text-align:center;" mapa_transfusional.ESPECIE.ViewCustomAttributes = "" ' NUMERO_BOLSA If mapa_transfusional.NUMERO_BOLSA.VirtualValue <> "" Then mapa_transfusional.NUMERO_BOLSA.ViewValue = mapa_transfusional.NUMERO_BOLSA.VirtualValue Else If mapa_transfusional.NUMERO_BOLSA.CurrentValue & "" <> "" Then sFilterWrk = "`NUMERO_BOLSA` = " & ew_AdjustSql(mapa_transfusional.NUMERO_BOLSA.CurrentValue) & "" sSqlWrk = "SELECT `NUMERO_BOLSA` FROM `bolsas_recebidas`" sWhereWrk = "" Call ew_AddFilter(sWhereWrk, sFilterWrk) If sWhereWrk <> "" Then sSqlWrk = sSqlWrk & " WHERE " & sWhereWrk sSqlWrk = sSqlWrk & " ORDER BY `NUMERO_BOLSA` Desc" Set RsWrk = Conn.Execute(sSqlWrk) If Not RsWrk.Eof Then mapa_transfusional.NUMERO_BOLSA.ViewValue = RsWrk("NUMERO_BOLSA") Else mapa_transfusional.NUMERO_BOLSA.ViewValue = mapa_transfusional.NUMERO_BOLSA.CurrentValue End If RsWrk.Close Set RsWrk = Nothing Else mapa_transfusional.NUMERO_BOLSA.ViewValue = Null End If End If mapa_transfusional.NUMERO_BOLSA.CssStyle = "text-align:center;" mapa_transfusional.NUMERO_BOLSA.ViewCustomAttributes = "" ' HORA_INICIAL mapa_transfusional.HORA_INICIAL.ViewValue = mapa_transfusional.HORA_INICIAL.CurrentValue mapa_transfusional.HORA_INICIAL.CssStyle = "text-align:center;" mapa_transfusional.HORA_INICIAL.ViewCustomAttributes = "" ' RESPONSAVEL1 If mapa_transfusional.RESPONSAVEL1.VirtualValue <> "" Then mapa_transfusional.RESPONSAVEL1.ViewValue = mapa_transfusional.RESPONSAVEL1.VirtualValue Else If mapa_transfusional.RESPONSAVEL1.CurrentValue & "" <> "" Then sFilterWrk = "`NOME` = '" & ew_AdjustSql(mapa_transfusional.RESPONSAVEL1.CurrentValue) & "'" sSqlWrk = "SELECT `NOME` FROM `funcionarios`" sWhereWrk = "" Call ew_AddFilter(sWhereWrk, sFilterWrk) If sWhereWrk <> "" Then sSqlWrk = sSqlWrk & " WHERE " & sWhereWrk sSqlWrk = sSqlWrk & " ORDER BY `NOME` Asc" Set RsWrk = Conn.Execute(sSqlWrk) If Not RsWrk.Eof Then mapa_transfusional.RESPONSAVEL1.ViewValue = RsWrk("NOME") Else mapa_transfusional.RESPONSAVEL1.ViewValue = mapa_transfusional.RESPONSAVEL1.CurrentValue End If RsWrk.Close Set RsWrk = Nothing Else mapa_transfusional.RESPONSAVEL1.ViewValue = Null End If End If mapa_transfusional.RESPONSAVEL1.CssStyle = "text-align:center;" mapa_transfusional.RESPONSAVEL1.ViewCustomAttributes = "" ' REVISAO_130 mapa_transfusional.REVISAO_130.ViewValue = mapa_transfusional.REVISAO_130.CurrentValue mapa_transfusional.REVISAO_130.CssStyle = "text-align:center;" mapa_transfusional.REVISAO_130.ViewCustomAttributes = "" ' RESPONSAVEL2 If mapa_transfusional.RESPONSAVEL2.VirtualValue <> "" Then mapa_transfusional.RESPONSAVEL2.ViewValue = mapa_transfusional.RESPONSAVEL2.VirtualValue Else If mapa_transfusional.RESPONSAVEL2.CurrentValue & "" <> "" Then sFilterWrk = "`NOME` = '" & ew_AdjustSql(mapa_transfusional.RESPONSAVEL2.CurrentValue) & "'" sSqlWrk = "SELECT `NOME` FROM `funcionarios`" sWhereWrk = "" Call ew_AddFilter(sWhereWrk, sFilterWrk) If sWhereWrk <> "" Then sSqlWrk = sSqlWrk & " WHERE " & sWhereWrk sSqlWrk = sSqlWrk & " ORDER BY `NOME` Asc" Set RsWrk = Conn.Execute(sSqlWrk) If Not RsWrk.Eof Then mapa_transfusional.RESPONSAVEL2.ViewValue = RsWrk("NOME") Else mapa_transfusional.RESPONSAVEL2.ViewValue = mapa_transfusional.RESPONSAVEL2.CurrentValue End If RsWrk.Close Set RsWrk = Nothing Else mapa_transfusional.RESPONSAVEL2.ViewValue = Null End If End If mapa_transfusional.RESPONSAVEL2.CssStyle = "text-align:center;" mapa_transfusional.RESPONSAVEL2.ViewCustomAttributes = "" ' HORA_FINAL mapa_transfusional.HORA_FINAL.ViewValue = mapa_transfusional.HORA_FINAL.CurrentValue mapa_transfusional.HORA_FINAL.CssStyle = "text-align:center;" mapa_transfusional.HORA_FINAL.ViewCustomAttributes = "" ' RESPONSAVEL3 If mapa_transfusional.RESPONSAVEL3.VirtualValue <> "" Then mapa_transfusional.RESPONSAVEL3.ViewValue = mapa_transfusional.RESPONSAVEL3.VirtualValue Else If mapa_transfusional.RESPONSAVEL3.CurrentValue & "" <> "" Then sFilterWrk = "`NOME` = '" & ew_AdjustSql(mapa_transfusional.RESPONSAVEL3.CurrentValue) & "'" sSqlWrk = "SELECT `NOME` FROM `funcionarios`" sWhereWrk = "" Call ew_AddFilter(sWhereWrk, sFilterWrk) If sWhereWrk <> "" Then sSqlWrk = sSqlWrk & " WHERE " & sWhereWrk sSqlWrk = sSqlWrk & " ORDER BY `NOME` Asc" Set RsWrk = Conn.Execute(sSqlWrk) If Not RsWrk.Eof Then mapa_transfusional.RESPONSAVEL3.ViewValue = RsWrk("NOME") Else mapa_transfusional.RESPONSAVEL3.ViewValue = mapa_transfusional.RESPONSAVEL3.CurrentValue End If RsWrk.Close Set RsWrk = Nothing Else mapa_transfusional.RESPONSAVEL3.ViewValue = Null End If End If mapa_transfusional.RESPONSAVEL3.CssStyle = "text-align:center;" mapa_transfusional.RESPONSAVEL3.ViewCustomAttributes = "" ' PA_INICIAL mapa_transfusional.PA_INICIAL.ViewValue = mapa_transfusional.PA_INICIAL.CurrentValue mapa_transfusional.PA_INICIAL.CssStyle = "text-align:center;" mapa_transfusional.PA_INICIAL.ViewCustomAttributes = "" ' PA_FINAL mapa_transfusional.PA_FINAL.ViewValue = mapa_transfusional.PA_FINAL.CurrentValue mapa_transfusional.PA_FINAL.CssStyle = "text-align:center;" mapa_transfusional.PA_FINAL.ViewCustomAttributes = "" ' TEMP_INICIAL mapa_transfusional.TEMP_INICIAL.ViewValue = mapa_transfusional.TEMP_INICIAL.CurrentValue mapa_transfusional.TEMP_INICIAL.CssStyle = "text-align:center;" mapa_transfusional.TEMP_INICIAL.ViewCustomAttributes = "" ' TEMP_FINAL mapa_transfusional.TEMP_FINAL.ViewValue = mapa_transfusional.TEMP_FINAL.CurrentValue mapa_transfusional.TEMP_FINAL.CssStyle = "text-align:center;" mapa_transfusional.TEMP_FINAL.ViewCustomAttributes = "" ' PULSO_ART_INICIAL mapa_transfusional.PULSO_ART_INICIAL.ViewValue = mapa_transfusional.PULSO_ART_INICIAL.CurrentValue mapa_transfusional.PULSO_ART_INICIAL.CssStyle = "text-align:center;" mapa_transfusional.PULSO_ART_INICIAL.ViewCustomAttributes = "" ' PULSO_ART_FINAL mapa_transfusional.PULSO_ART_FINAL.ViewValue = mapa_transfusional.PULSO_ART_FINAL.CurrentValue mapa_transfusional.PULSO_ART_FINAL.CssStyle = "text-align:center;" mapa_transfusional.PULSO_ART_FINAL.ViewCustomAttributes = "" ' OBS mapa_transfusional.OBS.ViewValue = mapa_transfusional.OBS.CurrentValue mapa_transfusional.OBS.ViewCustomAttributes = "" ' View refer script ' DATA mapa_transfusional.DATA.LinkCustomAttributes = "" mapa_transfusional.DATA.HrefValue = "" mapa_transfusional.DATA.TooltipValue = "" ' REGISTRO_GERAL mapa_transfusional.REGISTRO_GERAL.LinkCustomAttributes = "" mapa_transfusional.REGISTRO_GERAL.HrefValue = "" mapa_transfusional.REGISTRO_GERAL.TooltipValue = "" ' ESPECIE mapa_transfusional.ESPECIE.LinkCustomAttributes = "" mapa_transfusional.ESPECIE.HrefValue = "" mapa_transfusional.ESPECIE.TooltipValue = "" ' NUMERO_BOLSA mapa_transfusional.NUMERO_BOLSA.LinkCustomAttributes = "" mapa_transfusional.NUMERO_BOLSA.HrefValue = "" mapa_transfusional.NUMERO_BOLSA.TooltipValue = "" ' HORA_INICIAL mapa_transfusional.HORA_INICIAL.LinkCustomAttributes = "" mapa_transfusional.HORA_INICIAL.HrefValue = "" mapa_transfusional.HORA_INICIAL.TooltipValue = "" ' RESPONSAVEL1 mapa_transfusional.RESPONSAVEL1.LinkCustomAttributes = "" mapa_transfusional.RESPONSAVEL1.HrefValue = "" mapa_transfusional.RESPONSAVEL1.TooltipValue = "" ' REVISAO_130 mapa_transfusional.REVISAO_130.LinkCustomAttributes = "" mapa_transfusional.REVISAO_130.HrefValue = "" mapa_transfusional.REVISAO_130.TooltipValue = "" ' RESPONSAVEL2 mapa_transfusional.RESPONSAVEL2.LinkCustomAttributes = "" mapa_transfusional.RESPONSAVEL2.HrefValue = "" mapa_transfusional.RESPONSAVEL2.TooltipValue = "" ' HORA_FINAL mapa_transfusional.HORA_FINAL.LinkCustomAttributes = "" mapa_transfusional.HORA_FINAL.HrefValue = "" mapa_transfusional.HORA_FINAL.TooltipValue = "" ' RESPONSAVEL3 mapa_transfusional.RESPONSAVEL3.LinkCustomAttributes = "" mapa_transfusional.RESPONSAVEL3.HrefValue = "" mapa_transfusional.RESPONSAVEL3.TooltipValue = "" ' PA_INICIAL mapa_transfusional.PA_INICIAL.LinkCustomAttributes = "" mapa_transfusional.PA_INICIAL.HrefValue = "" mapa_transfusional.PA_INICIAL.TooltipValue = "" ' PA_FINAL mapa_transfusional.PA_FINAL.LinkCustomAttributes = "" mapa_transfusional.PA_FINAL.HrefValue = "" mapa_transfusional.PA_FINAL.TooltipValue = "" ' TEMP_INICIAL mapa_transfusional.TEMP_INICIAL.LinkCustomAttributes = "" mapa_transfusional.TEMP_INICIAL.HrefValue = "" mapa_transfusional.TEMP_INICIAL.TooltipValue = "" ' TEMP_FINAL mapa_transfusional.TEMP_FINAL.LinkCustomAttributes = "" mapa_transfusional.TEMP_FINAL.HrefValue = "" mapa_transfusional.TEMP_FINAL.TooltipValue = "" ' PULSO_ART_INICIAL mapa_transfusional.PULSO_ART_INICIAL.LinkCustomAttributes = "" mapa_transfusional.PULSO_ART_INICIAL.HrefValue = "" mapa_transfusional.PULSO_ART_INICIAL.TooltipValue = "" ' PULSO_ART_FINAL mapa_transfusional.PULSO_ART_FINAL.LinkCustomAttributes = "" mapa_transfusional.PULSO_ART_FINAL.HrefValue = "" mapa_transfusional.PULSO_ART_FINAL.TooltipValue = "" ' OBS mapa_transfusional.OBS.LinkCustomAttributes = "" mapa_transfusional.OBS.HrefValue = "" mapa_transfusional.OBS.TooltipValue = "" ' --------- ' Add Row ' --------- ElseIf mapa_transfusional.RowType = EW_ROWTYPE_ADD Then ' Add row ' DATA mapa_transfusional.DATA.EditCustomAttributes = "" mapa_transfusional.DATA.EditValue = ew_FormatDateTime(mapa_transfusional.DATA.CurrentValue, 7) ' REGISTRO_GERAL mapa_transfusional.REGISTRO_GERAL.EditCustomAttributes = "" If mapa_transfusional.REGISTRO_GERAL.SessionValue <> "" Then mapa_transfusional.REGISTRO_GERAL.CurrentValue = mapa_transfusional.REGISTRO_GERAL.SessionValue If mapa_transfusional.REGISTRO_GERAL.VirtualValue <> "" Then mapa_transfusional.REGISTRO_GERAL.ViewValue = mapa_transfusional.REGISTRO_GERAL.VirtualValue Else If mapa_transfusional.REGISTRO_GERAL.CurrentValue & "" <> "" Then sFilterWrk = "`REGISTRO_GERAL` = " & ew_AdjustSql(mapa_transfusional.REGISTRO_GERAL.CurrentValue) & "" sSqlWrk = "SELECT `REGISTRO_GERAL` FROM `receptor`" sWhereWrk = "" Call ew_AddFilter(sWhereWrk, sFilterWrk) If sWhereWrk <> "" Then sSqlWrk = sSqlWrk & " WHERE " & sWhereWrk sSqlWrk = sSqlWrk & " ORDER BY `REGISTRO_GERAL` Desc" Set RsWrk = Conn.Execute(sSqlWrk) If Not RsWrk.Eof Then mapa_transfusional.REGISTRO_GERAL.ViewValue = RsWrk("REGISTRO_GERAL") Else mapa_transfusional.REGISTRO_GERAL.ViewValue = mapa_transfusional.REGISTRO_GERAL.CurrentValue End If RsWrk.Close Set RsWrk = Nothing Else mapa_transfusional.REGISTRO_GERAL.ViewValue = Null End If End If mapa_transfusional.REGISTRO_GERAL.CssStyle = "text-align:center;" mapa_transfusional.REGISTRO_GERAL.ViewCustomAttributes = "" Else sFilterWrk = "" sSqlWrk = "SELECT `REGISTRO_GERAL`, `REGISTRO_GERAL` AS `DispFld`, '' AS `Disp2Fld`, '' AS `Disp3Fld`, '' AS `Disp4Fld`, '' AS `SelectFilterFld` FROM `receptor`" sWhereWrk = "" Call ew_AddFilter(sWhereWrk, sFilterWrk) If sWhereWrk <> "" Then sSqlWrk = sSqlWrk & " WHERE " & sWhereWrk sSqlWrk = sSqlWrk & " ORDER BY `REGISTRO_GERAL` Desc" Set RsWrk = Server.CreateObject("ADODB.Recordset") RsWrk.Open sSqlWrk, Conn If Not RsWrk.Eof Then arwrk = RsWrk.GetRows Else arwrk = "" End If RsWrk.Close Set RsWrk = Nothing arwrk = ew_AddItemToArray(arwrk, 0, Array("", Language.Phrase("PleaseSelect"))) mapa_transfusional.REGISTRO_GERAL.EditValue = arwrk End If ' ESPECIE mapa_transfusional.ESPECIE.EditCustomAttributes = "" Redim arwrk(1, 6) arwrk(0, 0) = "CH" arwrk(1, 0) = ew_IIf(mapa_transfusional.ESPECIE.FldTagCaption(1) <> "", mapa_transfusional.ESPECIE.FldTagCaption(1), "CH") arwrk(0, 1) = "CHI" arwrk(1, 1) = ew_IIf(mapa_transfusional.ESPECIE.FldTagCaption(2) <> "", mapa_transfusional.ESPECIE.FldTagCaption(2), "CHI") arwrk(0, 2) = "CHFI" arwrk(1, 2) = ew_IIf(mapa_transfusional.ESPECIE.FldTagCaption(3) <> "", mapa_transfusional.ESPECIE.FldTagCaption(3), "CHFI") arwrk(0, 3) = "PFC" arwrk(1, 3) = ew_IIf(mapa_transfusional.ESPECIE.FldTagCaption(4) <> "", mapa_transfusional.ESPECIE.FldTagCaption(4), "PFC") arwrk(0, 4) = "CRIO" arwrk(1, 4) = ew_IIf(mapa_transfusional.ESPECIE.FldTagCaption(5) <> "", mapa_transfusional.ESPECIE.FldTagCaption(5), "CRIO") arwrk(0, 5) = "CP" arwrk(1, 5) = ew_IIf(mapa_transfusional.ESPECIE.FldTagCaption(6) <> "", mapa_transfusional.ESPECIE.FldTagCaption(6), "CP") arwrk(0, 6) = "CPI" arwrk(1, 6) = ew_IIf(mapa_transfusional.ESPECIE.FldTagCaption(7) <> "", mapa_transfusional.ESPECIE.FldTagCaption(7), "CPI") arwrk = ew_AddItemToArray(arwrk, 0, Array("", Language.Phrase("PleaseSelect"))) mapa_transfusional.ESPECIE.EditValue = arwrk ' NUMERO_BOLSA mapa_transfusional.NUMERO_BOLSA.EditCustomAttributes = "" sFilterWrk = "" sSqlWrk = "SELECT `NUMERO_BOLSA`, `NUMERO_BOLSA` AS `DispFld`, '' AS `Disp2Fld`, '' AS `Disp3Fld`, '' AS `Disp4Fld`, '' AS `SelectFilterFld` FROM `bolsas_recebidas`" sWhereWrk = "" Call ew_AddFilter(sWhereWrk, sFilterWrk) If sWhereWrk <> "" Then sSqlWrk = sSqlWrk & " WHERE " & sWhereWrk sSqlWrk = sSqlWrk & " ORDER BY `NUMERO_BOLSA` Desc" Set RsWrk = Server.CreateObject("ADODB.Recordset") RsWrk.Open sSqlWrk, Conn If Not RsWrk.Eof Then arwrk = RsWrk.GetRows Else arwrk = "" End If RsWrk.Close Set RsWrk = Nothing arwrk = ew_AddItemToArray(arwrk, 0, Array("", Language.Phrase("PleaseSelect"))) mapa_transfusional.NUMERO_BOLSA.EditValue = arwrk ' HORA_INICIAL mapa_transfusional.HORA_INICIAL.EditCustomAttributes = "" mapa_transfusional.HORA_INICIAL.EditValue = ew_HtmlEncode(mapa_transfusional.HORA_INICIAL.CurrentValue) ' RESPONSAVEL1 mapa_transfusional.RESPONSAVEL1.EditCustomAttributes = "" sFilterWrk = "" sSqlWrk = "SELECT `NOME`, `NOME` AS `DispFld`, '' AS `Disp2Fld`, '' AS `Disp3Fld`, '' AS `Disp4Fld`, '' AS `SelectFilterFld` FROM `funcionarios`" sWhereWrk = "" Call ew_AddFilter(sWhereWrk, sFilterWrk) If sWhereWrk <> "" Then sSqlWrk = sSqlWrk & " WHERE " & sWhereWrk sSqlWrk = sSqlWrk & " ORDER BY `NOME` Asc" Set RsWrk = Server.CreateObject("ADODB.Recordset") RsWrk.Open sSqlWrk, Conn If Not RsWrk.Eof Then arwrk = RsWrk.GetRows Else arwrk = "" End If RsWrk.Close Set RsWrk = Nothing arwrk = ew_AddItemToArray(arwrk, 0, Array("", Language.Phrase("PleaseSelect"))) mapa_transfusional.RESPONSAVEL1.EditValue = arwrk ' REVISAO_130 mapa_transfusional.REVISAO_130.EditCustomAttributes = "" mapa_transfusional.REVISAO_130.EditValue = ew_HtmlEncode(mapa_transfusional.REVISAO_130.CurrentValue) ' RESPONSAVEL2 mapa_transfusional.RESPONSAVEL2.EditCustomAttributes = "" sFilterWrk = "" sSqlWrk = "SELECT `NOME`, `NOME` AS `DispFld`, '' AS `Disp2Fld`, '' AS `Disp3Fld`, '' AS `Disp4Fld`, '' AS `SelectFilterFld` FROM `funcionarios`" sWhereWrk = "" Call ew_AddFilter(sWhereWrk, sFilterWrk) If sWhereWrk <> "" Then sSqlWrk = sSqlWrk & " WHERE " & sWhereWrk sSqlWrk = sSqlWrk & " ORDER BY `NOME` Asc" Set RsWrk = Server.CreateObject("ADODB.Recordset") RsWrk.Open sSqlWrk, Conn If Not RsWrk.Eof Then arwrk = RsWrk.GetRows Else arwrk = "" End If RsWrk.Close Set RsWrk = Nothing arwrk = ew_AddItemToArray(arwrk, 0, Array("", Language.Phrase("PleaseSelect"))) mapa_transfusional.RESPONSAVEL2.EditValue = arwrk ' HORA_FINAL mapa_transfusional.HORA_FINAL.EditCustomAttributes = "" mapa_transfusional.HORA_FINAL.EditValue = ew_HtmlEncode(mapa_transfusional.HORA_FINAL.CurrentValue) ' RESPONSAVEL3 mapa_transfusional.RESPONSAVEL3.EditCustomAttributes = "" sFilterWrk = "" sSqlWrk = "SELECT `NOME`, `NOME` AS `DispFld`, '' AS `Disp2Fld`, '' AS `Disp3Fld`, '' AS `Disp4Fld`, '' AS `SelectFilterFld` FROM `funcionarios`" sWhereWrk = "" Call ew_AddFilter(sWhereWrk, sFilterWrk) If sWhereWrk <> "" Then sSqlWrk = sSqlWrk & " WHERE " & sWhereWrk sSqlWrk = sSqlWrk & " ORDER BY `NOME` Asc" Set RsWrk = Server.CreateObject("ADODB.Recordset") RsWrk.Open sSqlWrk, Conn If Not RsWrk.Eof Then arwrk = RsWrk.GetRows Else arwrk = "" End If RsWrk.Close Set RsWrk = Nothing arwrk = ew_AddItemToArray(arwrk, 0, Array("", Language.Phrase("PleaseSelect"))) mapa_transfusional.RESPONSAVEL3.EditValue = arwrk ' PA_INICIAL mapa_transfusional.PA_INICIAL.EditCustomAttributes = "" mapa_transfusional.PA_INICIAL.EditValue = ew_HtmlEncode(mapa_transfusional.PA_INICIAL.CurrentValue) ' PA_FINAL mapa_transfusional.PA_FINAL.EditCustomAttributes = "" mapa_transfusional.PA_FINAL.EditValue = ew_HtmlEncode(mapa_transfusional.PA_FINAL.CurrentValue) ' TEMP_INICIAL mapa_transfusional.TEMP_INICIAL.EditCustomAttributes = "" mapa_transfusional.TEMP_INICIAL.EditValue = ew_HtmlEncode(mapa_transfusional.TEMP_INICIAL.CurrentValue) ' TEMP_FINAL mapa_transfusional.TEMP_FINAL.EditCustomAttributes = "" mapa_transfusional.TEMP_FINAL.EditValue = ew_HtmlEncode(mapa_transfusional.TEMP_FINAL.CurrentValue) ' PULSO_ART_INICIAL mapa_transfusional.PULSO_ART_INICIAL.EditCustomAttributes = "" mapa_transfusional.PULSO_ART_INICIAL.EditValue = ew_HtmlEncode(mapa_transfusional.PULSO_ART_INICIAL.CurrentValue) ' PULSO_ART_FINAL mapa_transfusional.PULSO_ART_FINAL.EditCustomAttributes = "" mapa_transfusional.PULSO_ART_FINAL.EditValue = ew_HtmlEncode(mapa_transfusional.PULSO_ART_FINAL.CurrentValue) ' OBS mapa_transfusional.OBS.EditCustomAttributes = "" mapa_transfusional.OBS.EditValue = ew_HtmlEncode(mapa_transfusional.OBS.CurrentValue) ' Edit refer script ' DATA mapa_transfusional.DATA.HrefValue = "" ' REGISTRO_GERAL mapa_transfusional.REGISTRO_GERAL.HrefValue = "" ' ESPECIE mapa_transfusional.ESPECIE.HrefValue = "" ' NUMERO_BOLSA mapa_transfusional.NUMERO_BOLSA.HrefValue = "" ' HORA_INICIAL mapa_transfusional.HORA_INICIAL.HrefValue = "" ' RESPONSAVEL1 mapa_transfusional.RESPONSAVEL1.HrefValue = "" ' REVISAO_130 mapa_transfusional.REVISAO_130.HrefValue = "" ' RESPONSAVEL2 mapa_transfusional.RESPONSAVEL2.HrefValue = "" ' HORA_FINAL mapa_transfusional.HORA_FINAL.HrefValue = "" ' RESPONSAVEL3 mapa_transfusional.RESPONSAVEL3.HrefValue = "" ' PA_INICIAL mapa_transfusional.PA_INICIAL.HrefValue = "" ' PA_FINAL mapa_transfusional.PA_FINAL.HrefValue = "" ' TEMP_INICIAL mapa_transfusional.TEMP_INICIAL.HrefValue = "" ' TEMP_FINAL mapa_transfusional.TEMP_FINAL.HrefValue = "" ' PULSO_ART_INICIAL mapa_transfusional.PULSO_ART_INICIAL.HrefValue = "" ' PULSO_ART_FINAL mapa_transfusional.PULSO_ART_FINAL.HrefValue = "" ' OBS mapa_transfusional.OBS.HrefValue = "" End If If mapa_transfusional.RowType = EW_ROWTYPE_ADD Or mapa_transfusional.RowType = EW_ROWTYPE_EDIT Or mapa_transfusional.RowType = EW_ROWTYPE_SEARCH Then ' Add / Edit / Search row Call mapa_transfusional.SetupFieldTitles() End If ' Call Row Rendered event If mapa_transfusional.RowType <> EW_ROWTYPE_AGGREGATEINIT Then Call mapa_transfusional.Row_Rendered() End If End Sub ' ----------------------------------------------------------------- ' Validate form ' Function ValidateForm() ' Initialize gsFormError = "" ' Check if validation required If Not EW_SERVER_VALIDATE Then ValidateForm = (gsFormError = "") Exit Function End If If Not IsNull(mapa_transfusional.DATA.FormValue) And mapa_transfusional.DATA.FormValue&"" = "" Then Call ew_AddMessage(gsFormError, Language.Phrase("EnterRequiredField") & " - " & mapa_transfusional.DATA.FldCaption) End If If Not ew_CheckEuroDate(mapa_transfusional.DATA.FormValue) Then Call ew_AddMessage(gsFormError, mapa_transfusional.DATA.FldErrMsg) End If If Not IsNull(mapa_transfusional.REGISTRO_GERAL.FormValue) And mapa_transfusional.REGISTRO_GERAL.FormValue&"" = "" Then Call ew_AddMessage(gsFormError, Language.Phrase("EnterRequiredField") & " - " & mapa_transfusional.REGISTRO_GERAL.FldCaption) End If If Not IsNull(mapa_transfusional.ESPECIE.FormValue) And mapa_transfusional.ESPECIE.FormValue&"" = "" Then Call ew_AddMessage(gsFormError, Language.Phrase("EnterRequiredField") & " - " & mapa_transfusional.ESPECIE.FldCaption) End If If Not IsNull(mapa_transfusional.NUMERO_BOLSA.FormValue) And mapa_transfusional.NUMERO_BOLSA.FormValue&"" = "" Then Call ew_AddMessage(gsFormError, Language.Phrase("EnterRequiredField") & " - " & mapa_transfusional.NUMERO_BOLSA.FldCaption) End If If Not IsNull(mapa_transfusional.HORA_INICIAL.FormValue) And mapa_transfusional.HORA_INICIAL.FormValue&"" = "" Then Call ew_AddMessage(gsFormError, Language.Phrase("EnterRequiredField") & " - " & mapa_transfusional.HORA_INICIAL.FldCaption) End If If Not ew_CheckTime(mapa_transfusional.HORA_INICIAL.FormValue) Then Call ew_AddMessage(gsFormError, mapa_transfusional.HORA_INICIAL.FldErrMsg) End If If Not IsNull(mapa_transfusional.RESPONSAVEL1.FormValue) And mapa_transfusional.RESPONSAVEL1.FormValue&"" = "" Then Call ew_AddMessage(gsFormError, Language.Phrase("EnterRequiredField") & " - " & mapa_transfusional.RESPONSAVEL1.FldCaption) End If If Not IsNull(mapa_transfusional.REVISAO_130.FormValue) And mapa_transfusional.REVISAO_130.FormValue&"" = "" Then Call ew_AddMessage(gsFormError, Language.Phrase("EnterRequiredField") & " - " & mapa_transfusional.REVISAO_130.FldCaption) End If If Not IsNull(mapa_transfusional.RESPONSAVEL2.FormValue) And mapa_transfusional.RESPONSAVEL2.FormValue&"" = "" Then Call ew_AddMessage(gsFormError, Language.Phrase("EnterRequiredField") & " - " & mapa_transfusional.RESPONSAVEL2.FldCaption) End If If Not IsNull(mapa_transfusional.HORA_FINAL.FormValue) And mapa_transfusional.HORA_FINAL.FormValue&"" = "" Then Call ew_AddMessage(gsFormError, Language.Phrase("EnterRequiredField") & " - " & mapa_transfusional.HORA_FINAL.FldCaption) End If If Not ew_CheckTime(mapa_transfusional.HORA_FINAL.FormValue) Then Call ew_AddMessage(gsFormError, mapa_transfusional.HORA_FINAL.FldErrMsg) End If If Not IsNull(mapa_transfusional.RESPONSAVEL3.FormValue) And mapa_transfusional.RESPONSAVEL3.FormValue&"" = "" Then Call ew_AddMessage(gsFormError, Language.Phrase("EnterRequiredField") & " - " & mapa_transfusional.RESPONSAVEL3.FldCaption) End If If Not IsNull(mapa_transfusional.PA_INICIAL.FormValue) And mapa_transfusional.PA_INICIAL.FormValue&"" = "" Then Call ew_AddMessage(gsFormError, Language.Phrase("EnterRequiredField") & " - " & mapa_transfusional.PA_INICIAL.FldCaption) End If If Not IsNull(mapa_transfusional.PA_FINAL.FormValue) And mapa_transfusional.PA_FINAL.FormValue&"" = "" Then Call ew_AddMessage(gsFormError, Language.Phrase("EnterRequiredField") & " - " & mapa_transfusional.PA_FINAL.FldCaption) End If If Not IsNull(mapa_transfusional.TEMP_INICIAL.FormValue) And mapa_transfusional.TEMP_INICIAL.FormValue&"" = "" Then Call ew_AddMessage(gsFormError, Language.Phrase("EnterRequiredField") & " - " & mapa_transfusional.TEMP_INICIAL.FldCaption) End If If Not IsNull(mapa_transfusional.TEMP_FINAL.FormValue) And mapa_transfusional.TEMP_FINAL.FormValue&"" = "" Then Call ew_AddMessage(gsFormError, Language.Phrase("EnterRequiredField") & " - " & mapa_transfusional.TEMP_FINAL.FldCaption) End If If Not IsNull(mapa_transfusional.PULSO_ART_INICIAL.FormValue) And mapa_transfusional.PULSO_ART_INICIAL.FormValue&"" = "" Then Call ew_AddMessage(gsFormError, Language.Phrase("EnterRequiredField") & " - " & mapa_transfusional.PULSO_ART_INICIAL.FldCaption) End If If Not IsNull(mapa_transfusional.PULSO_ART_FINAL.FormValue) And mapa_transfusional.PULSO_ART_FINAL.FormValue&"" = "" Then Call ew_AddMessage(gsFormError, Language.Phrase("EnterRequiredField") & " - " & mapa_transfusional.PULSO_ART_FINAL.FldCaption) End If ' Return validate result ValidateForm = (gsFormError = "") ' Call Form Custom Validate event Dim sFormCustomError sFormCustomError = "" ValidateForm = ValidateForm And Form_CustomValidate(sFormCustomError) If sFormCustomError <> "" Then Call ew_AddMessage(gsFormError, sFormCustomError) End If End Function ' ----------------------------------------------------------------- ' Add record ' Function AddRow(RsOld) If Not EW_DEBUG_ENABLED Then On Error Resume Next Dim Rs, sSql, sFilter Dim RsNew Dim bInsertRow Dim RsChk Dim sIdxErrMsg ' Clear any previous errors Err.Clear ' Add new record sFilter = "(0 = 1)" mapa_transfusional.CurrentFilter = sFilter sSql = mapa_transfusional.SQL Set Rs = Server.CreateObject("ADODB.Recordset") Rs.CursorLocation = EW_CURSORLOCATION Rs.Open sSql, Conn, 1, EW_RECORDSET_LOCKTYPE Rs.AddNew If Err.Number <> 0 Then Message = Err.Description Rs.Close Set Rs = Nothing AddRow = False Exit Function End If ' Field DATA Call mapa_transfusional.DATA.SetDbValue(Rs, ew_UnFormatDateTime(mapa_transfusional.DATA.CurrentValue, 7), Now, False) ' Field REGISTRO_GERAL Call mapa_transfusional.REGISTRO_GERAL.SetDbValue(Rs, mapa_transfusional.REGISTRO_GERAL.CurrentValue, 0, False) ' Field ESPECIE Call mapa_transfusional.ESPECIE.SetDbValue(Rs, mapa_transfusional.ESPECIE.CurrentValue, "", False) ' Field NUMERO_BOLSA Call mapa_transfusional.NUMERO_BOLSA.SetDbValue(Rs, mapa_transfusional.NUMERO_BOLSA.CurrentValue, 0, False) ' Field HORA_INICIAL Call mapa_transfusional.HORA_INICIAL.SetDbValue(Rs, mapa_transfusional.HORA_INICIAL.CurrentValue, "", False) ' Field RESPONSAVEL1 Call mapa_transfusional.RESPONSAVEL1.SetDbValue(Rs, mapa_transfusional.RESPONSAVEL1.CurrentValue, "", False) ' Field REVISAO_130 Call mapa_transfusional.REVISAO_130.SetDbValue(Rs, mapa_transfusional.REVISAO_130.CurrentValue, "", False) ' Field RESPONSAVEL2 Call mapa_transfusional.RESPONSAVEL2.SetDbValue(Rs, mapa_transfusional.RESPONSAVEL2.CurrentValue, "", False) ' Field HORA_FINAL Call mapa_transfusional.HORA_FINAL.SetDbValue(Rs, mapa_transfusional.HORA_FINAL.CurrentValue, "", False) ' Field RESPONSAVEL3 Call mapa_transfusional.RESPONSAVEL3.SetDbValue(Rs, mapa_transfusional.RESPONSAVEL3.CurrentValue, "", False) ' Field PA_INICIAL Call mapa_transfusional.PA_INICIAL.SetDbValue(Rs, mapa_transfusional.PA_INICIAL.CurrentValue, "", False) ' Field PA_FINAL Call mapa_transfusional.PA_FINAL.SetDbValue(Rs, mapa_transfusional.PA_FINAL.CurrentValue, "", False) ' Field TEMP_INICIAL Call mapa_transfusional.TEMP_INICIAL.SetDbValue(Rs, mapa_transfusional.TEMP_INICIAL.CurrentValue, "", False) ' Field TEMP_FINAL Call mapa_transfusional.TEMP_FINAL.SetDbValue(Rs, mapa_transfusional.TEMP_FINAL.CurrentValue, "", False) ' Field PULSO_ART_INICIAL Call mapa_transfusional.PULSO_ART_INICIAL.SetDbValue(Rs, mapa_transfusional.PULSO_ART_INICIAL.CurrentValue, "", False) ' Field PULSO_ART_FINAL Call mapa_transfusional.PULSO_ART_FINAL.SetDbValue(Rs, mapa_transfusional.PULSO_ART_FINAL.CurrentValue, "", False) ' Field OBS Call mapa_transfusional.OBS.SetDbValue(Rs, mapa_transfusional.OBS.CurrentValue, Null, False) ' Check recordset update error If Err.Number <> 0 Then FailureMessage = Err.Description Rs.Close Set Rs = Nothing AddRow = False Exit Function End If ' Call Row Inserting event bInsertRow = mapa_transfusional.Row_Inserting(RsOld, Rs) If bInsertRow Then ' Clone new recordset object Set RsNew = ew_CloneRs(Rs) Rs.Update If Err.Number <> 0 Then FailureMessage = Err.Description AddRow = False Else AddRow = True End If Else Rs.CancelUpdate If mapa_transfusional.CancelMessage <> "" Then FailureMessage = mapa_transfusional.CancelMessage mapa_transfusional.CancelMessage = "" Else FailureMessage = Language.Phrase("InsertCancelled") End If AddRow = False End If Rs.Close Set Rs = Nothing If AddRow Then mapa_transfusional.ID.DbValue = RsNew("ID") End If If AddRow Then ' Call Row Inserted event Call mapa_transfusional.Row_Inserted(RsOld, RsNew) End If If IsObject(RsNew) Then RsNew.Close Set RsNew = Nothing End If End Function ' ----------------------------------------------------------------- ' Set up Master Detail based on querystring parameter ' Sub SetUpMasterParms() Dim bValidMaster, sMasterTblVar bValidMaster = False ' Get the keys for master table If Request.QueryString(EW_TABLE_SHOW_MASTER).Count > 0 Then sMasterTblVar = Request.QueryString(EW_TABLE_SHOW_MASTER) If sMasterTblVar = "" Then bValidMaster = True DbMasterFilter = "" DbDetailFilter = "" End If If sMasterTblVar = "receptor" Then bValidMaster = True If Request.QueryString("REGISTRO_GERAL").Count > 0 Then receptor.REGISTRO_GERAL.QueryStringValue = Request.QueryString("REGISTRO_GERAL") mapa_transfusional.REGISTRO_GERAL.QueryStringValue = receptor.REGISTRO_GERAL.QueryStringValue mapa_transfusional.REGISTRO_GERAL.SessionValue = mapa_transfusional.REGISTRO_GERAL.QueryStringValue If Not IsNumeric(receptor.REGISTRO_GERAL.QueryStringValue) Then bValidMaster = False Else bValidMaster = False End If End If End If If bValidMaster Then ' Save current master table mapa_transfusional.CurrentMasterTable = sMasterTblVar ' Reset start record counter (new master key) StartRec = 1 mapa_transfusional.StartRecordNumber = StartRec ' Clear previous master session values If sMasterTblVar <> "receptor" Then If mapa_transfusional.REGISTRO_GERAL.QueryStringValue = "" Then mapa_transfusional.REGISTRO_GERAL.SessionValue = "" End If End If DbMasterFilter = mapa_transfusional.MasterFilter ' Get master filter DbDetailFilter = mapa_transfusional.DetailFilter ' Get detail filter End Sub ' Page Load event Sub Page_Load() 'Response.Write "Page Load" End Sub ' Page Unload event Sub Page_Unload() 'Response.Write "Page Unload" End Sub ' Page Redirecting event Sub Page_Redirecting(url) 'url = newurl End Sub ' Message Showing event ' typ = ""|"success"|"failure" Sub Message_Showing(msg, typ) ' Example: 'If typ = "success" Then msg = "your success message" End Sub ' Page Data Rendering event Sub Page_DataRendering(header) ' Example: 'header = "your header" End Sub ' Page Data Rendered event Sub Page_DataRendered(footer) ' Example: 'footer = "your footer" End Sub ' Form Custom Validate event Function Form_CustomValidate(CustomError) 'Return error message in CustomError Form_CustomValidate = True End Function End Class %>