<%@ CodePage="1252" LCID="1046" %> <% Response.Buffer = EW_RESPONSE_BUFFER %> <% Session.Timeout = 20 %> <% Call ew_Header(False, EW_CHARSET) %> <% ' Define page object Dim mapa_transfusional_delete Set mapa_transfusional_delete = New cmapa_transfusional_delete Set Page = mapa_transfusional_delete ' Page init processing Call mapa_transfusional_delete.Page_Init() ' Page main processing Call mapa_transfusional_delete.Page_Main() %> <% mapa_transfusional_delete.ShowPageHeader() %> <% ' Load records for display Set mapa_transfusional_delete.Recordset = mapa_transfusional_delete.LoadRecordset() mapa_transfusional_delete.TotalRecs = mapa_transfusional_delete.Recordset.RecordCount ' Get record count If mapa_transfusional_delete.TotalRecs <= 0 Then ' No record found, exit mapa_transfusional_delete.Recordset.Close Set mapa_transfusional_delete.Recordset = Nothing Call mapa_transfusional_delete.Page_Terminate("mapa_transfusionallist.asp") ' Return to list End If %>

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

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

<% mapa_transfusional_delete.ShowMessage %>

<% For i = 0 to UBound(mapa_transfusional_delete.RecKeys) %> <% Next %>
<%= mapa_transfusional.TableCustomInnerHTML %> <% mapa_transfusional_delete.RecCnt = 0 i = 0 Do While (Not mapa_transfusional_delete.Recordset.Eof) mapa_transfusional_delete.RecCnt = mapa_transfusional_delete.RecCnt + 1 ' Set row properties Call mapa_transfusional.ResetAttrs() mapa_transfusional.RowType = EW_ROWTYPE_VIEW ' view ' Get the field contents Call mapa_transfusional_delete.LoadRowValues(mapa_transfusional_delete.Recordset) ' Render row Call mapa_transfusional_delete.RenderRow() %> > > ><%= mapa_transfusional.ID.ListViewValue %> > ><%= mapa_transfusional.DATA.ListViewValue %> > ><%= mapa_transfusional.REGISTRO_GERAL.ListViewValue %> > ><%= mapa_transfusional.ESPECIE.ListViewValue %> > ><%= mapa_transfusional.NUMERO_BOLSA.ListViewValue %> > ><%= mapa_transfusional.HORA_INICIAL.ListViewValue %> > ><%= mapa_transfusional.RESPONSAVEL1.ListViewValue %> > ><%= mapa_transfusional.REVISAO_130.ListViewValue %> > ><%= mapa_transfusional.RESPONSAVEL2.ListViewValue %> > ><%= mapa_transfusional.HORA_FINAL.ListViewValue %> > ><%= mapa_transfusional.RESPONSAVEL3.ListViewValue %> > ><%= mapa_transfusional.PA_INICIAL.ListViewValue %> > ><%= mapa_transfusional.PA_FINAL.ListViewValue %> > ><%= mapa_transfusional.TEMP_INICIAL.ListViewValue %> > ><%= mapa_transfusional.TEMP_FINAL.ListViewValue %> > ><%= mapa_transfusional.PULSO_ART_INICIAL.ListViewValue %> > ><%= mapa_transfusional.PULSO_ART_FINAL.ListViewValue %> <% mapa_transfusional_delete.Recordset.MoveNext Loop mapa_transfusional_delete.Recordset.Close Set mapa_transfusional_delete.Recordset = Nothing %>
<%= mapa_transfusional.ID.FldCaption %> <%= mapa_transfusional.DATA.FldCaption %> <%= mapa_transfusional.REGISTRO_GERAL.FldCaption %> <%= mapa_transfusional.ESPECIE.FldCaption %> <%= mapa_transfusional.NUMERO_BOLSA.FldCaption %> <%= mapa_transfusional.HORA_INICIAL.FldCaption %> <%= mapa_transfusional.RESPONSAVEL1.FldCaption %> <%= mapa_transfusional.REVISAO_130.FldCaption %> <%= mapa_transfusional.RESPONSAVEL2.FldCaption %> <%= mapa_transfusional.HORA_FINAL.FldCaption %> <%= mapa_transfusional.RESPONSAVEL3.FldCaption %> <%= mapa_transfusional.PA_INICIAL.FldCaption %> <%= mapa_transfusional.PA_FINAL.FldCaption %> <%= mapa_transfusional.TEMP_INICIAL.FldCaption %> <%= mapa_transfusional.TEMP_FINAL.FldCaption %> <%= mapa_transfusional.PULSO_ART_INICIAL.FldCaption %> <%= mapa_transfusional.PULSO_ART_FINAL.FldCaption %>

">

<% mapa_transfusional_delete.ShowPageFooter() If EW_DEBUG_ENABLED Then Response.Write ew_DebugMsg() %> <% ' Drop page object Set mapa_transfusional_delete = Nothing %> <% ' ----------------------------------------------------------------- ' Page Class ' Class cmapa_transfusional_delete ' Page ID Public Property Get PageID() PageID = "delete" End Property ' Table Name Public Property Get TableName() TableName = "mapa_transfusional" End Property ' Page Object Name Public Property Get PageObjName() PageObjName = "mapa_transfusional_delete" 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 = "delete" ' 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() ' 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 TotalRecs Dim RecCnt Dim RecKeys Dim Recordset ' Page main processing Sub Page_Main() Dim sFilter ' Load Key Parameters RecKeys = mapa_transfusional.GetRecordKeys() ' Load record keys sFilter = mapa_transfusional.GetKeyFilter() If sFilter = "" Then Call Page_Terminate("mapa_transfusionallist.asp") ' Prevent SQL injection, return to list End If ' Set up filter (Sql Where Clause) and get Return Sql ' Sql constructor in mapa_transfusional class, mapa_transfusionalinfo.asp mapa_transfusional.CurrentFilter = sFilter ' Get action If Request.Form("a_delete").Count > 0 Then mapa_transfusional.CurrentAction = Request.Form("a_delete") Else mapa_transfusional.CurrentAction = "D" ' Delete record directly End If Select Case mapa_transfusional.CurrentAction Case "D" ' Delete mapa_transfusional.SendEmail = True ' Send email on delete success If DeleteRows() Then ' delete rows SuccessMessage = Language.Phrase("DeleteSuccess") ' Set up success message Call Page_Terminate(mapa_transfusional.ReturnUrl) ' Return to caller End If End Select End Sub ' ----------------------------------------------------------------- ' Load recordset ' Function LoadRecordset() ' Call Recordset Selecting event Dim sFilter sFilter = mapa_transfusional.CurrentFilter Call mapa_transfusional.Recordset_Selecting(sFilter) mapa_transfusional.CurrentFilter = sFilter ' Load list page sql Dim sSql sSql = mapa_transfusional.ListSQL Call ew_SetDebugMsg("LoadRecordset: " & sSql) ' Show SQL for debugging ' Load recordset Dim RsRecordset Set RsRecordset = ew_LoadRecordset(sSql) ' Call Recordset Selected event Call mapa_transfusional.Recordset_Selected(RsRecordset) Set LoadRecordset = RsRecordset 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 ' ----------------------------------------------------------------- ' 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 = "" ' View refer script ' ID mapa_transfusional.ID.LinkCustomAttributes = "" mapa_transfusional.ID.HrefValue = "" mapa_transfusional.ID.TooltipValue = "" ' 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 = "" End If ' Call Row Rendered event If mapa_transfusional.RowType <> EW_ROWTYPE_AGGREGATEINIT Then Call mapa_transfusional.Row_Rendered() End If End Sub ' ' Delete records based on current filter ' Function DeleteRows() If Not EW_DEBUG_ENABLED Then On Error Resume Next Dim sKey, sThisKey, sKeyFld, arKeyFlds Dim sSql, RsDelete Dim RsOld DeleteRows = True sSql = mapa_transfusional.SQL Set RsDelete = Server.CreateObject("ADODB.Recordset") RsDelete.CursorLocation = EW_CURSORLOCATION RsDelete.Open sSql, Conn, 1, EW_RECORDSET_LOCKTYPE If Err.Number <> 0 Then FailureMessage = Err.Description RsDelete.Close Set RsDelete = Nothing DeleteRows = False Exit Function ElseIf RsDelete.Eof Then FailureMessage = Language.Phrase("NoRecord") ' No record found RsDelete.Close Set RsDelete = Nothing DeleteRows = False Exit Function End If Conn.BeginTrans ' Clone old recordset object Set RsOld = ew_CloneRs(RsDelete) ' Call row deleting event If DeleteRows Then RsDelete.MoveFirst Do While Not RsDelete.Eof DeleteRows = mapa_transfusional.Row_Deleting(RsDelete) If Not DeleteRows Then Exit Do RsDelete.MoveNext Loop RsDelete.MoveFirst End If If DeleteRows Then sKey = "" RsDelete.MoveFirst Do While Not RsDelete.Eof sThisKey = "" If sThisKey <> "" Then sThisKey = sThisKey & EW_COMPOSITE_KEY_SEPARATOR sThisKey = sThisKey & RsDelete("ID") RsDelete.Delete If Err.Number <> 0 Then FailureMessage = Err.Description ' Set up error message DeleteRows = False Exit Do End If If sKey <> "" Then sKey = sKey & ", " sKey = sKey & sThisKey RsDelete.MoveNext Loop Else ' Set up error message If mapa_transfusional.CancelMessage <> "" Then FailureMessage = mapa_transfusional.CancelMessage mapa_transfusional.CancelMessage = "" Else FailureMessage = Language.Phrase("DeleteCancelled") End If End If If DeleteRows Then Conn.CommitTrans ' Commit the changes If Err.Number <> 0 Then FailureMessage = Err.Description DeleteRows = False ' Delete failed End If Else Conn.RollbackTrans ' Rollback changes End If RsDelete.Close Set RsDelete = Nothing ' Call row deleting event If DeleteRows Then If Not RsOld.Eof Then RsOld.MoveFirst Do While Not RsOld.Eof Call mapa_transfusional.Row_Deleted(RsOld) RsOld.MoveNext Loop End If RsOld.Close Set RsOld = Nothing End Function ' 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 End Class %>