<%@ CodePage="1252" LCID="1046" %> <% Response.Buffer = EW_RESPONSE_BUFFER %> <% Session.Timeout = 20 %> <% Call ew_Header(False, EW_CHARSET) %> <% ' Define page object Dim mapa_transfusional_list Set mapa_transfusional_list = New cmapa_transfusional_list Set Page = mapa_transfusional_list ' Page init processing Call mapa_transfusional_list.Page_Init() ' Page main processing Call mapa_transfusional_list.Page_Main() %> <% If mapa_transfusional.Export = "" Then %> <% End If %> <% If (mapa_transfusional.Export = "") Or (EW_EXPORT_MASTER_RECORD And mapa_transfusional.Export = "print") Then %> <% gsMasterReturnUrl = "receptorlist.asp" If mapa_transfusional_list.DbMasterFilter <> "" And mapa_transfusional.CurrentMasterTable = "receptor" Then If mapa_transfusional_list.MasterRecordExists Then If mapa_transfusional.CurrentMasterTable = mapa_transfusional.TableVar Then gsMasterReturnUrl = gsMasterReturnUrl & "?" & EW_TABLE_SHOW_MASTER & "=" %>

<%= Language.Phrase("MasterRecord") %><%= receptor.TableCaption %>   <% mapa_transfusional_list.ExportOptions.Render "body", "" %>

<% If mapa_transfusional.Export = "" Then %>

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

<% End If %> <% End If End If %> <% End If %> <% mapa_transfusional_list.ShowPageHeader() %> <% ' Load recordset Set mapa_transfusional_list.Recordset = mapa_transfusional_list.LoadRecordset() mapa_transfusional_list.TotalRecs = mapa_transfusional_list.Recordset.RecordCount mapa_transfusional_list.StartRec = 1 If mapa_transfusional_list.DisplayRecs <= 0 Then ' Display all records mapa_transfusional_list.DisplayRecs = mapa_transfusional_list.TotalRecs End If If Not (mapa_transfusional.ExportAll And mapa_transfusional.Export <> "") Then mapa_transfusional_list.SetUpStartRec() ' Set up start record position End If %>

<%= Language.Phrase("TblTypeTABLE") %><%= mapa_transfusional.TableCaption %> <% If mapa_transfusional.CurrentMasterTable = "" Then %>   <% mapa_transfusional_list.ExportOptions.Render "body", "" %> <% End If %>

<% If mapa_transfusional.Export = "" And mapa_transfusional.CurrentAction = "" Then %>  <%= Language.Phrase("Search") %>
    
<% End If %> <% mapa_transfusional_list.ShowMessage %>
<% If mapa_transfusional.Export = "" Then %>
<% If mapa_transfusional.CurrentAction <> "gridadd" And mapa_transfusional.CurrentAction <> "gridedit" Then %>
<% If Not IsObject(mapa_transfusional_list.Pager) Then Set mapa_transfusional_list.Pager = ew_NewPrevNextPager(mapa_transfusional_list.StartRec, mapa_transfusional_list.DisplayRecs, mapa_transfusional_list.TotalRecs) %> <% If mapa_transfusional_list.Pager.RecordCount > 0 Then %> <% If mapa_transfusional_list.Pager.FirstButton.Enabled Then %> <% Else %> <% End If %> <% If mapa_transfusional_list.Pager.PrevButton.Enabled Then %> <% Else %> <% End If %> <% If mapa_transfusional_list.Pager.NextButton.Enabled Then %> <% Else %> <% End If %> <% If mapa_transfusional_list.Pager.LastButton.Enabled Then %> <% Else %> <% End If %>
<%= Language.Phrase("Page") %>  <%= Language.Phrase(" width="16" height="16" border="0"><%= Language.Phrase(" width="16" height="16" border="0"><%= Language.Phrase(" width="16" height="16" border="0"><%= Language.Phrase(" width="16" height="16" border="0"> <%= Language.Phrase(" width="16" height="16" border="0"><%= Language.Phrase(" width="16" height="16" border="0"><%= Language.Phrase(" width="16" height="16" border="0"><%= Language.Phrase(" width="16" height="16" border="0"> <%= Language.Phrase("Of") %> <%= mapa_transfusional_list.Pager.PageCount %>
     <%= Language.Phrase("Record") %> <%= mapa_transfusional_list.Pager.FromIndex %> <%= Language.Phrase("To") %> <%= mapa_transfusional_list.Pager.ToIndex %> <%= Language.Phrase("Of") %> <%= mapa_transfusional_list.Pager.RecordCount %> <% Else %> <% If mapa_transfusional_list.SearchWhere = "0=101" Then %> <%= Language.Phrase("EnterSearchCriteria") %> <% Else %> <%= Language.Phrase("NoRecord") %> <% End If %> <% End If %>
<% End If %> <%= Language.Phrase("AddLink") %>   <% If mapa_transfusional_list.TotalRecs > 0 Then %> <%= Language.Phrase("DeleteSelectedLink") %>   <% End If %>
<% End If %>
<% If mapa_transfusional_list.TotalRecs > 0 Then %> <%= mapa_transfusional.TableCustomInnerHTML %> <% Call mapa_transfusional_list.RenderListOptions() ' Render list options (header, left) mapa_transfusional_list.ListOptions.Render "header", "left" %> <% If mapa_transfusional.ID.Visible Then ' ID %> <% If mapa_transfusional.SortUrl(mapa_transfusional.ID) = "" Then %> <% Else %> <% End If %> <% End If %> <% If mapa_transfusional.DATA.Visible Then ' DATA %> <% If mapa_transfusional.SortUrl(mapa_transfusional.DATA) = "" Then %> <% Else %> <% End If %> <% End If %> <% If mapa_transfusional.REGISTRO_GERAL.Visible Then ' REGISTRO_GERAL %> <% If mapa_transfusional.SortUrl(mapa_transfusional.REGISTRO_GERAL) = "" Then %> <% Else %> <% End If %> <% End If %> <% If mapa_transfusional.ESPECIE.Visible Then ' ESPECIE %> <% If mapa_transfusional.SortUrl(mapa_transfusional.ESPECIE) = "" Then %> <% Else %> <% End If %> <% End If %> <% If mapa_transfusional.NUMERO_BOLSA.Visible Then ' NUMERO_BOLSA %> <% If mapa_transfusional.SortUrl(mapa_transfusional.NUMERO_BOLSA) = "" Then %> <% Else %> <% End If %> <% End If %> <% If mapa_transfusional.HORA_INICIAL.Visible Then ' HORA_INICIAL %> <% If mapa_transfusional.SortUrl(mapa_transfusional.HORA_INICIAL) = "" Then %> <% Else %> <% End If %> <% End If %> <% If mapa_transfusional.RESPONSAVEL1.Visible Then ' RESPONSAVEL1 %> <% If mapa_transfusional.SortUrl(mapa_transfusional.RESPONSAVEL1) = "" Then %> <% Else %> <% End If %> <% End If %> <% If mapa_transfusional.REVISAO_130.Visible Then ' REVISAO_130 %> <% If mapa_transfusional.SortUrl(mapa_transfusional.REVISAO_130) = "" Then %> <% Else %> <% End If %> <% End If %> <% If mapa_transfusional.RESPONSAVEL2.Visible Then ' RESPONSAVEL2 %> <% If mapa_transfusional.SortUrl(mapa_transfusional.RESPONSAVEL2) = "" Then %> <% Else %> <% End If %> <% End If %> <% If mapa_transfusional.HORA_FINAL.Visible Then ' HORA_FINAL %> <% If mapa_transfusional.SortUrl(mapa_transfusional.HORA_FINAL) = "" Then %> <% Else %> <% End If %> <% End If %> <% If mapa_transfusional.RESPONSAVEL3.Visible Then ' RESPONSAVEL3 %> <% If mapa_transfusional.SortUrl(mapa_transfusional.RESPONSAVEL3) = "" Then %> <% Else %> <% End If %> <% End If %> <% If mapa_transfusional.PA_INICIAL.Visible Then ' PA_INICIAL %> <% If mapa_transfusional.SortUrl(mapa_transfusional.PA_INICIAL) = "" Then %> <% Else %> <% End If %> <% End If %> <% If mapa_transfusional.PA_FINAL.Visible Then ' PA_FINAL %> <% If mapa_transfusional.SortUrl(mapa_transfusional.PA_FINAL) = "" Then %> <% Else %> <% End If %> <% End If %> <% If mapa_transfusional.TEMP_INICIAL.Visible Then ' TEMP_INICIAL %> <% If mapa_transfusional.SortUrl(mapa_transfusional.TEMP_INICIAL) = "" Then %> <% Else %> <% End If %> <% End If %> <% If mapa_transfusional.TEMP_FINAL.Visible Then ' TEMP_FINAL %> <% If mapa_transfusional.SortUrl(mapa_transfusional.TEMP_FINAL) = "" Then %> <% Else %> <% End If %> <% End If %> <% If mapa_transfusional.PULSO_ART_INICIAL.Visible Then ' PULSO_ART_INICIAL %> <% If mapa_transfusional.SortUrl(mapa_transfusional.PULSO_ART_INICIAL) = "" Then %> <% Else %> <% End If %> <% End If %> <% If mapa_transfusional.PULSO_ART_FINAL.Visible Then ' PULSO_ART_FINAL %> <% If mapa_transfusional.SortUrl(mapa_transfusional.PULSO_ART_FINAL) = "" Then %> <% Else %> <% End If %> <% End If %> <% ' Render list options (header, right) mapa_transfusional_list.ListOptions.Render "header", "right" %> <% If (mapa_transfusional.ExportAll And mapa_transfusional.Export <> "") Then mapa_transfusional_list.StopRec = mapa_transfusional_list.TotalRecs Else ' Set the last record to display If mapa_transfusional_list.TotalRecs > mapa_transfusional_list.StartRec + mapa_transfusional_list.DisplayRecs - 1 Then mapa_transfusional_list.StopRec = mapa_transfusional_list.StartRec + mapa_transfusional_list.DisplayRecs - 1 Else mapa_transfusional_list.StopRec = mapa_transfusional_list.TotalRecs End If End If ' Move to first record mapa_transfusional_list.RecCnt = mapa_transfusional_list.StartRec - 1 If Not mapa_transfusional_list.Recordset.Eof Then mapa_transfusional_list.Recordset.MoveFirst If mapa_transfusional_list.StartRec > 1 Then mapa_transfusional_list.Recordset.Move mapa_transfusional_list.StartRec - 1 ElseIf Not mapa_transfusional.AllowAddDeleteRow And mapa_transfusional_list.StopRec = 0 Then mapa_transfusional_list.StopRec = mapa_transfusional.GridAddRowCount End If ' Initialize Aggregate mapa_transfusional.RowType = EW_ROWTYPE_AGGREGATEINIT Call mapa_transfusional.ResetAttrs() Call mapa_transfusional_list.RenderRow() mapa_transfusional_list.RowCnt = 0 ' Output date rows Do While CLng(mapa_transfusional_list.RecCnt) < CLng(mapa_transfusional_list.StopRec) mapa_transfusional_list.RecCnt = mapa_transfusional_list.RecCnt + 1 If CLng(mapa_transfusional_list.RecCnt) >= CLng(mapa_transfusional_list.StartRec) Then mapa_transfusional_list.RowCnt = mapa_transfusional_list.RowCnt + 1 ' Set up key count mapa_transfusional_list.KeyCount = mapa_transfusional_list.RowIndex Call mapa_transfusional.ResetAttrs() mapa_transfusional.CssClass = "" If mapa_transfusional.CurrentAction = "gridadd" Then Else Call mapa_transfusional_list.LoadRowValues(mapa_transfusional_list.Recordset) ' Load row values End If mapa_transfusional.RowType = EW_ROWTYPE_VIEW ' Render view mapa_transfusional.RowAttrs.AddAttributes Array(Array("onmouseover", "ew_MouseOver(event, this);"), Array("onmouseout", "ew_MouseOut(event, this);"), Array("onclick", "ew_Click(event, this);")) ' Render row Call mapa_transfusional_list.RenderRow() ' Render list options Call mapa_transfusional_list.RenderListOptions() %> > <% ' Render list options (body, left) mapa_transfusional_list.ListOptions.Render "body", "left" %> <% If mapa_transfusional.ID.Visible Then ' ID %> > ><%= mapa_transfusional.ID.ListViewValue %> " id="<%= mapa_transfusional_list.PageObjName & "_row_" & mapa_transfusional_list.RowCnt %>"> <% End If %> <% If mapa_transfusional.DATA.Visible Then ' DATA %> > ><%= mapa_transfusional.DATA.ListViewValue %> <% End If %> <% If mapa_transfusional.REGISTRO_GERAL.Visible Then ' REGISTRO_GERAL %> > ><%= mapa_transfusional.REGISTRO_GERAL.ListViewValue %> <% End If %> <% If mapa_transfusional.ESPECIE.Visible Then ' ESPECIE %> > ><%= mapa_transfusional.ESPECIE.ListViewValue %> <% End If %> <% If mapa_transfusional.NUMERO_BOLSA.Visible Then ' NUMERO_BOLSA %> > ><%= mapa_transfusional.NUMERO_BOLSA.ListViewValue %> <% End If %> <% If mapa_transfusional.HORA_INICIAL.Visible Then ' HORA_INICIAL %> > ><%= mapa_transfusional.HORA_INICIAL.ListViewValue %> <% End If %> <% If mapa_transfusional.RESPONSAVEL1.Visible Then ' RESPONSAVEL1 %> > ><%= mapa_transfusional.RESPONSAVEL1.ListViewValue %> <% End If %> <% If mapa_transfusional.REVISAO_130.Visible Then ' REVISAO_130 %> > ><%= mapa_transfusional.REVISAO_130.ListViewValue %> <% End If %> <% If mapa_transfusional.RESPONSAVEL2.Visible Then ' RESPONSAVEL2 %> > ><%= mapa_transfusional.RESPONSAVEL2.ListViewValue %> <% End If %> <% If mapa_transfusional.HORA_FINAL.Visible Then ' HORA_FINAL %> > ><%= mapa_transfusional.HORA_FINAL.ListViewValue %> <% End If %> <% If mapa_transfusional.RESPONSAVEL3.Visible Then ' RESPONSAVEL3 %> > ><%= mapa_transfusional.RESPONSAVEL3.ListViewValue %> <% End If %> <% If mapa_transfusional.PA_INICIAL.Visible Then ' PA_INICIAL %> > ><%= mapa_transfusional.PA_INICIAL.ListViewValue %> <% End If %> <% If mapa_transfusional.PA_FINAL.Visible Then ' PA_FINAL %> > ><%= mapa_transfusional.PA_FINAL.ListViewValue %> <% End If %> <% If mapa_transfusional.TEMP_INICIAL.Visible Then ' TEMP_INICIAL %> > ><%= mapa_transfusional.TEMP_INICIAL.ListViewValue %> <% End If %> <% If mapa_transfusional.TEMP_FINAL.Visible Then ' TEMP_FINAL %> > ><%= mapa_transfusional.TEMP_FINAL.ListViewValue %> <% End If %> <% If mapa_transfusional.PULSO_ART_INICIAL.Visible Then ' PULSO_ART_INICIAL %> > ><%= mapa_transfusional.PULSO_ART_INICIAL.ListViewValue %> <% End If %> <% If mapa_transfusional.PULSO_ART_FINAL.Visible Then ' PULSO_ART_FINAL %> > ><%= mapa_transfusional.PULSO_ART_FINAL.ListViewValue %> <% End If %> <% ' Render list options (body, right) mapa_transfusional_list.ListOptions.Render "body", "right" %> <% End If If mapa_transfusional.CurrentAction <> "gridadd" Then mapa_transfusional_list.Recordset.MoveNext() End If Loop %>
<%= mapa_transfusional.ID.FldCaption %>
<%= mapa_transfusional.ID.FldCaption %><% If mapa_transfusional.ID.Sort = "ASC" Then %><% ElseIf mapa_transfusional.ID.Sort = "DESC" Then %><% End If %>
<%= mapa_transfusional.DATA.FldCaption %>
<%= mapa_transfusional.DATA.FldCaption %><% If mapa_transfusional.DATA.Sort = "ASC" Then %><% ElseIf mapa_transfusional.DATA.Sort = "DESC" Then %><% End If %>
<%= mapa_transfusional.REGISTRO_GERAL.FldCaption %>
<%= mapa_transfusional.REGISTRO_GERAL.FldCaption %><% If mapa_transfusional.REGISTRO_GERAL.Sort = "ASC" Then %><% ElseIf mapa_transfusional.REGISTRO_GERAL.Sort = "DESC" Then %><% End If %>
<%= mapa_transfusional.ESPECIE.FldCaption %>
<%= mapa_transfusional.ESPECIE.FldCaption %><% If mapa_transfusional.ESPECIE.Sort = "ASC" Then %><% ElseIf mapa_transfusional.ESPECIE.Sort = "DESC" Then %><% End If %>
<%= mapa_transfusional.NUMERO_BOLSA.FldCaption %>
<%= mapa_transfusional.NUMERO_BOLSA.FldCaption %><% If mapa_transfusional.NUMERO_BOLSA.Sort = "ASC" Then %><% ElseIf mapa_transfusional.NUMERO_BOLSA.Sort = "DESC" Then %><% End If %>
<%= mapa_transfusional.HORA_INICIAL.FldCaption %>
<%= mapa_transfusional.HORA_INICIAL.FldCaption %><%= Language.Phrase("SrchLegend") %><% If mapa_transfusional.HORA_INICIAL.Sort = "ASC" Then %><% ElseIf mapa_transfusional.HORA_INICIAL.Sort = "DESC" Then %><% End If %>
<%= mapa_transfusional.RESPONSAVEL1.FldCaption %>
<%= mapa_transfusional.RESPONSAVEL1.FldCaption %><% If mapa_transfusional.RESPONSAVEL1.Sort = "ASC" Then %><% ElseIf mapa_transfusional.RESPONSAVEL1.Sort = "DESC" Then %><% End If %>
<%= mapa_transfusional.REVISAO_130.FldCaption %>
<%= mapa_transfusional.REVISAO_130.FldCaption %><%= Language.Phrase("SrchLegend") %><% If mapa_transfusional.REVISAO_130.Sort = "ASC" Then %><% ElseIf mapa_transfusional.REVISAO_130.Sort = "DESC" Then %><% End If %>
<%= mapa_transfusional.RESPONSAVEL2.FldCaption %>
<%= mapa_transfusional.RESPONSAVEL2.FldCaption %><% If mapa_transfusional.RESPONSAVEL2.Sort = "ASC" Then %><% ElseIf mapa_transfusional.RESPONSAVEL2.Sort = "DESC" Then %><% End If %>
<%= mapa_transfusional.HORA_FINAL.FldCaption %>
<%= mapa_transfusional.HORA_FINAL.FldCaption %><%= Language.Phrase("SrchLegend") %><% If mapa_transfusional.HORA_FINAL.Sort = "ASC" Then %><% ElseIf mapa_transfusional.HORA_FINAL.Sort = "DESC" Then %><% End If %>
<%= mapa_transfusional.RESPONSAVEL3.FldCaption %>
<%= mapa_transfusional.RESPONSAVEL3.FldCaption %><% If mapa_transfusional.RESPONSAVEL3.Sort = "ASC" Then %><% ElseIf mapa_transfusional.RESPONSAVEL3.Sort = "DESC" Then %><% End If %>
<%= mapa_transfusional.PA_INICIAL.FldCaption %>
<%= mapa_transfusional.PA_INICIAL.FldCaption %><%= Language.Phrase("SrchLegend") %><% If mapa_transfusional.PA_INICIAL.Sort = "ASC" Then %><% ElseIf mapa_transfusional.PA_INICIAL.Sort = "DESC" Then %><% End If %>
<%= mapa_transfusional.PA_FINAL.FldCaption %>
<%= mapa_transfusional.PA_FINAL.FldCaption %><%= Language.Phrase("SrchLegend") %><% If mapa_transfusional.PA_FINAL.Sort = "ASC" Then %><% ElseIf mapa_transfusional.PA_FINAL.Sort = "DESC" Then %><% End If %>
<%= mapa_transfusional.TEMP_INICIAL.FldCaption %>
<%= mapa_transfusional.TEMP_INICIAL.FldCaption %><%= Language.Phrase("SrchLegend") %><% If mapa_transfusional.TEMP_INICIAL.Sort = "ASC" Then %><% ElseIf mapa_transfusional.TEMP_INICIAL.Sort = "DESC" Then %><% End If %>
<%= mapa_transfusional.TEMP_FINAL.FldCaption %>
<%= mapa_transfusional.TEMP_FINAL.FldCaption %><%= Language.Phrase("SrchLegend") %><% If mapa_transfusional.TEMP_FINAL.Sort = "ASC" Then %><% ElseIf mapa_transfusional.TEMP_FINAL.Sort = "DESC" Then %><% End If %>
<%= mapa_transfusional.PULSO_ART_INICIAL.FldCaption %>
<%= mapa_transfusional.PULSO_ART_INICIAL.FldCaption %><%= Language.Phrase("SrchLegend") %><% If mapa_transfusional.PULSO_ART_INICIAL.Sort = "ASC" Then %><% ElseIf mapa_transfusional.PULSO_ART_INICIAL.Sort = "DESC" Then %><% End If %>
<%= mapa_transfusional.PULSO_ART_FINAL.FldCaption %>
<%= mapa_transfusional.PULSO_ART_FINAL.FldCaption %><%= Language.Phrase("SrchLegend") %><% If mapa_transfusional.PULSO_ART_FINAL.Sort = "ASC" Then %><% ElseIf mapa_transfusional.PULSO_ART_FINAL.Sort = "DESC" Then %><% End If %>
<% End If %>
<% ' Close recordset and connection mapa_transfusional_list.Recordset.Close Set mapa_transfusional_list.Recordset = Nothing %> <% If mapa_transfusional_list.TotalRecs > 0 Then %> <% If mapa_transfusional.Export = "" Then %>
<% If mapa_transfusional.CurrentAction <> "gridadd" And mapa_transfusional.CurrentAction <> "gridedit" Then %>
<% If Not IsObject(mapa_transfusional_list.Pager) Then Set mapa_transfusional_list.Pager = ew_NewPrevNextPager(mapa_transfusional_list.StartRec, mapa_transfusional_list.DisplayRecs, mapa_transfusional_list.TotalRecs) %> <% If mapa_transfusional_list.Pager.RecordCount > 0 Then %> <% If mapa_transfusional_list.Pager.FirstButton.Enabled Then %> <% Else %> <% End If %> <% If mapa_transfusional_list.Pager.PrevButton.Enabled Then %> <% Else %> <% End If %> <% If mapa_transfusional_list.Pager.NextButton.Enabled Then %> <% Else %> <% End If %> <% If mapa_transfusional_list.Pager.LastButton.Enabled Then %> <% Else %> <% End If %>
<%= Language.Phrase("Page") %>  <%= Language.Phrase(" width="16" height="16" border="0"><%= Language.Phrase(" width="16" height="16" border="0"><%= Language.Phrase(" width="16" height="16" border="0"><%= Language.Phrase(" width="16" height="16" border="0"> <%= Language.Phrase(" width="16" height="16" border="0"><%= Language.Phrase(" width="16" height="16" border="0"><%= Language.Phrase(" width="16" height="16" border="0"><%= Language.Phrase(" width="16" height="16" border="0"> <%= Language.Phrase("Of") %> <%= mapa_transfusional_list.Pager.PageCount %>
     <%= Language.Phrase("Record") %> <%= mapa_transfusional_list.Pager.FromIndex %> <%= Language.Phrase("To") %> <%= mapa_transfusional_list.Pager.ToIndex %> <%= Language.Phrase("Of") %> <%= mapa_transfusional_list.Pager.RecordCount %> <% Else %> <% If mapa_transfusional_list.SearchWhere = "0=101" Then %> <%= Language.Phrase("EnterSearchCriteria") %> <% Else %> <%= Language.Phrase("NoRecord") %> <% End If %> <% End If %>
<% End If %> <%= Language.Phrase("AddLink") %>   <% If mapa_transfusional_list.TotalRecs > 0 Then %> <%= Language.Phrase("DeleteSelectedLink") %>   <% End If %>
<% End If %> <% End If %>
<% If mapa_transfusional.Export = "" And mapa_transfusional.CurrentAction = "" Then %> <% End If %> <% mapa_transfusional_list.ShowPageFooter() If EW_DEBUG_ENABLED Then Response.Write ew_DebugMsg() %> <% If mapa_transfusional.Export = "" Then %> <% End If %> <% ' Drop page object Set mapa_transfusional_list = Nothing %> <% ' ----------------------------------------------------------------- ' Page Class ' Class cmapa_transfusional_list ' Page ID Public Property Get PageID() PageID = "list" End Property ' Table Name Public Property Get TableName() TableName = "mapa_transfusional" End Property ' Page Object Name Public Property Get PageObjName() PageObjName = "mapa_transfusional_list" 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 ' Common urls Dim AddUrl Dim EditUrl Dim CopyUrl Dim DeleteUrl Dim ViewUrl Dim ListUrl ' Export urls Dim ExportPrintUrl Dim ExportHtmlUrl Dim ExportExcelUrl Dim ExportWordUrl Dim ExportXmlUrl Dim ExportCsvUrl ' Inline urls Dim InlineAddUrl Dim InlineCopyUrl Dim InlineEditUrl Dim GridAddUrl Dim GridEditUrl Dim MultiDeleteUrl Dim MultiUpdateUrl ' 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 ExportPrintUrl = PageUrl & "export=print" ExportExcelUrl = PageUrl & "export=excel" ExportWordUrl = PageUrl & "export=word" ExportHtmlUrl = PageUrl & "export=html" ExportXmlUrl = PageUrl & "export=xml" ExportCsvUrl = PageUrl & "export=csv" AddUrl = "mapa_transfusionaladd.asp" InlineAddUrl = PageUrl & "a=add" GridAddUrl = PageUrl & "a=gridadd" GridEditUrl = PageUrl & "a=gridedit" MultiDeleteUrl = "mapa_transfusionaldelete.asp" MultiUpdateUrl = "mapa_transfusionalupdate.asp" ' 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 = "list" ' Initialize table name (for backward compatibility) EW_TABLE_NAME = "mapa_transfusional" ' Open connection to the database If IsEmpty(Conn) Then Call ew_Connect() ' Initialize list options Set ListOptions = New cListOptions ' Export options Set ExportOptions = New cListOptions ExportOptions.Tag = "span" ExportOptions.Separator = "  " End Sub ' ----------------------------------------------------------------- ' Subroutine Page_Init ' - called before page main ' - check Security ' - set up response header ' - call page load events ' Sub Page_Init() ' Get export parameters If Request.QueryString("export").Count > 0 Then mapa_transfusional.Export = Request.QueryString("export") ElseIf Request.ServerVariables("HTTP_CONTENT_TYPE") = "application/x-www-form-urlencoded" Then If Request.Form("exporttype").Count > 0 Then mapa_transfusional.Export = Request.Form("exporttype") End If Else mapa_transfusional.ExportReturnUrl = ew_CurrentUrl() End If gsExport = mapa_transfusional.Export ' Get export parameter, used in header gsExportFile = mapa_transfusional.TableVar ' Get export file, used in header Dim Charset ' Charset used in header If EW_CHARSET <> "" Then Charset = ";charset=" & EW_CHARSET Else Charset = "" End If If mapa_transfusional.Export = "excel" Then Response.ContentType = "application/vnd.ms-excel" & Charset Response.AddHeader "Content-Disposition", "attachment; filename=" & gsExportFile & ".xls" End If If mapa_transfusional.Export = "csv" Then Response.ContentType = "application/csv" & Charset Response.AddHeader "Content-Disposition:", "attachment; filename=" & gsExportFile & ".csv" End If ' Get grid add count Dim gridaddcnt gridaddcnt = Request.QueryString(EW_TABLE_GRID_ADD_ROW_COUNT) If IsNumeric(gridaddcnt) Then If gridaddcnt > 0 Then mapa_transfusional.GridAddRowCount = gridaddcnt End If End If ' Set up list options SetupListOptions() ' Setup export options SetupExportOptions() ' 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 ListOptions = 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 DisplayRecs ' Number of display records Dim StartRec, StopRec, TotalRecs, RecRange Dim SearchWhere Dim RecCnt Dim EditRowCnt Dim RowCnt, RowIndex Dim RecPerRow, ColCnt Dim KeyCount Dim RowAction Dim RowOldKey ' Row old key (for copy) Dim DbMasterFilter, DbDetailFilter Dim MasterRecordExists Dim ListOptions Dim ExportOptions Dim MultiSelectKey Dim RestoreSearch Dim Recordset, OldRecordset ' ----------------------------------------------------------------- ' Page main processing ' Sub Page_Main() DisplayRecs = 20 RecRange = 10 RecCnt = 0 ' Record count KeyCount = 0 ' Key count ' Search filters Dim sSrchAdvanced, sSrchBasic, sFilter sSrchAdvanced = "" ' Advanced search filter sSrchBasic = "" ' Basic search filter SearchWhere = "" ' Search where clause sFilter = "" ' Master/Detail DbMasterFilter = "" ' Master filter DbDetailFilter = "" ' Detail filter If IsPageRequest Then ' Validate request ' Handle reset command ResetCmd() ' Set up master detail parameters SetUpMasterParms() ' Hide all options If mapa_transfusional.Export <> "" Or mapa_transfusional.CurrentAction = "gridadd" Or mapa_transfusional.CurrentAction = "gridedit" Then ListOptions.HideAllOptions() ExportOptions.HideAllOptions() End If ' Get basic search values Call LoadBasicSearchValues() ' Restore search parms from Session Call RestoreSearchParms() ' Call Recordset SearchValidated event Call mapa_transfusional.Recordset_SearchValidated() ' Set Up Sorting Order SetUpSortOrder() ' Get basic search criteria If gsSearchError = "" Then sSrchBasic = BasicSearchWhere() End If End If ' End Validate Request ' Restore display records If mapa_transfusional.RecordsPerPage <> "" Then DisplayRecs = mapa_transfusional.RecordsPerPage ' Restore from Session Else DisplayRecs = 20 ' Load default End If ' Load Sorting Order LoadSortOrder() ' Build search criteria Call ew_AddFilter(SearchWhere, sSrchAdvanced) Call ew_AddFilter(SearchWhere, sSrchBasic) ' Call Recordset Searching event Call mapa_transfusional.Recordset_Searching(SearchWhere) ' Save search criteria If SearchWhere <> "" Then If sSrchBasic = "" Then Call ResetBasicSearchParms() mapa_transfusional.SearchWhere = SearchWhere ' Save to Session If Not RestoreSearch Then StartRec = 1 ' Reset start record counter mapa_transfusional.StartRecordNumber = StartRec End If Else SearchWhere = mapa_transfusional.SearchWhere End If sFilter = "" ' Restore master/detail filter DbMasterFilter = mapa_transfusional.MasterFilter ' Restore master filter DbDetailFilter = mapa_transfusional.DetailFilter ' Restore detail filter Call ew_AddFilter(sFilter, DbDetailFilter) Call ew_AddFilter(sFilter, SearchWhere) Dim RsMaster ' Load master record If mapa_transfusional.MasterFilter <> "" And mapa_transfusional.CurrentMasterTable = "receptor" Then Set RsMaster = receptor.LoadRs(DbMasterFilter) MasterRecordExists = Not (RsMaster Is Nothing) If Not MasterRecordExists Then FailureMessage = Language.Phrase("NoRecord") ' Set no record found Call Page_Terminate(mapa_transfusional.ReturnUrl) ' Return to caller Else Call receptor.LoadListRowValues(RsMaster) receptor.RowType = EW_ROWTYPE_MASTER ' Master row Call receptor.RenderListRow() RsMaster.Close Set RsMaster = Nothing End If End If ' Set up filter in Session mapa_transfusional.SessionWhere = sFilter mapa_transfusional.CurrentFilter = "" ' Export Data only If mapa_transfusional.Export = "html" Or mapa_transfusional.Export = "csv" Or mapa_transfusional.Export = "word" Or mapa_transfusional.Export = "excel" Or mapa_transfusional.Export = "xml" Then Call ExportData() Call Page_Terminate("") ' Clean up Response.End ' Terminate response ElseIf mapa_transfusional.Export = "email" Then Call ExportData() Response.End End If End Sub ' ----------------------------------------------------------------- ' Return Basic Search sql ' Function BasicSearchSQL(Keyword) Dim sWhere sWhere = "" Call BuildBasicSearchSQL(sWhere, mapa_transfusional.ESPECIE, Keyword) Call BuildBasicSearchSQL(sWhere, mapa_transfusional.HORA_INICIAL, Keyword) Call BuildBasicSearchSQL(sWhere, mapa_transfusional.RESPONSAVEL1, Keyword) Call BuildBasicSearchSQL(sWhere, mapa_transfusional.REVISAO_130, Keyword) Call BuildBasicSearchSQL(sWhere, mapa_transfusional.RESPONSAVEL2, Keyword) Call BuildBasicSearchSQL(sWhere, mapa_transfusional.HORA_FINAL, Keyword) Call BuildBasicSearchSQL(sWhere, mapa_transfusional.RESPONSAVEL3, Keyword) Call BuildBasicSearchSQL(sWhere, mapa_transfusional.PA_INICIAL, Keyword) Call BuildBasicSearchSQL(sWhere, mapa_transfusional.PA_FINAL, Keyword) Call BuildBasicSearchSQL(sWhere, mapa_transfusional.TEMP_INICIAL, Keyword) Call BuildBasicSearchSQL(sWhere, mapa_transfusional.TEMP_FINAL, Keyword) Call BuildBasicSearchSQL(sWhere, mapa_transfusional.PULSO_ART_INICIAL, Keyword) Call BuildBasicSearchSQL(sWhere, mapa_transfusional.PULSO_ART_FINAL, Keyword) Call BuildBasicSearchSQL(sWhere, mapa_transfusional.OBS, Keyword) BasicSearchSQL = sWhere End Function ' ----------------------------------------------------------------- ' Build basic search sql ' Sub BuildBasicSearchSql(Where, Fld, Keyword) Dim sFldExpression, lFldDataType Dim sWrk If Fld.FldVirtualExpression <> "" Then sFldExpression = Fld.FldVirtualExpression Else sFldExpression = Fld.FldExpression End If lFldDataType = Fld.FldDataType If Fld.FldIsVirtual Then lFldDataType = EW_DATATYPE_STRING If lFldDataType = EW_DATATYPE_NUMBER Then sWrk = sFldExpression & " = " & ew_QuotedValue(Keyword, lFldDataType) Else sWrk = sFldExpression & ew_Like(ew_QuotedValue("%" & Keyword & "%", lFldDataType)) End If If Where <> "" Then Where = Where & " OR " Where = Where & sWrk End Sub ' ----------------------------------------------------------------- ' Return Basic Search Where based on search keyword and type ' Function BasicSearchWhere() Dim sSearchStr, sSearchKeyword, sSearchType Dim sSearch, arKeyword, sKeyword sSearchStr = "" sSearchKeyword = mapa_transfusional.BasicSearchKeyword sSearchType = mapa_transfusional.BasicSearchType If sSearchKeyword <> "" Then sSearch = Trim(sSearchKeyword) If sSearchType <> "" Then While InStr(sSearch, " ") > 0 sSearch = Replace(sSearch, " ", " ") Wend arKeyword = Split(Trim(sSearch), " ") For Each sKeyword In arKeyword If sSearchStr <> "" Then sSearchStr = sSearchStr & " " & sSearchType & " " sSearchStr = sSearchStr & "(" & BasicSearchSQL(sKeyword) & ")" Next Else sSearchStr = BasicSearchSQL(sSearch) End If End If If sSearchKeyword <> "" then mapa_transfusional.SessionBasicSearchKeyword = sSearchKeyword mapa_transfusional.SessionBasicSearchType = sSearchType End If BasicSearchWhere = sSearchStr End Function ' ----------------------------------------------------------------- ' Clear all search parameters ' Sub ResetSearchParms() ' Clear search where SearchWhere = "" mapa_transfusional.SearchWhere = SearchWhere ' Clear basic search parameters Call ResetBasicSearchParms() End Sub ' ----------------------------------------------------------------- ' Clear all basic search parameters ' Sub ResetBasicSearchParms() ' Clear basic search parameters mapa_transfusional.SessionBasicSearchKeyword = "" mapa_transfusional.SessionBasicSearchType = "" End Sub ' ----------------------------------------------------------------- ' Restore all search parameters ' Sub RestoreSearchParms() Dim bRestore bRestore = True If mapa_transfusional.BasicSearchKeyword & "" <> "" Then bRestore = False RestoreSearch = bRestore If bRestore Then ' Restore basic search values mapa_transfusional.BasicSearchKeyword = mapa_transfusional.SessionBasicSearchKeyword mapa_transfusional.BasicSearchType = mapa_transfusional.SessionBasicSearchType End If End Sub ' ----------------------------------------------------------------- ' Set up Sort parameters based on Sort Links clicked ' Sub SetUpSortOrder() Dim sOrderBy Dim sSortField, sLastSort, sThisSort Dim bCtrl ' Check for an Order parameter If Request.QueryString("order").Count > 0 Then mapa_transfusional.CurrentOrder = Request.QueryString("order") mapa_transfusional.CurrentOrderType = Request.QueryString("ordertype") ' Field ID Call mapa_transfusional.UpdateSort(mapa_transfusional.ID) ' Field DATA Call mapa_transfusional.UpdateSort(mapa_transfusional.DATA) ' Field REGISTRO_GERAL Call mapa_transfusional.UpdateSort(mapa_transfusional.REGISTRO_GERAL) ' Field ESPECIE Call mapa_transfusional.UpdateSort(mapa_transfusional.ESPECIE) ' Field NUMERO_BOLSA Call mapa_transfusional.UpdateSort(mapa_transfusional.NUMERO_BOLSA) ' Field HORA_INICIAL Call mapa_transfusional.UpdateSort(mapa_transfusional.HORA_INICIAL) ' Field RESPONSAVEL1 Call mapa_transfusional.UpdateSort(mapa_transfusional.RESPONSAVEL1) ' Field REVISAO_130 Call mapa_transfusional.UpdateSort(mapa_transfusional.REVISAO_130) ' Field RESPONSAVEL2 Call mapa_transfusional.UpdateSort(mapa_transfusional.RESPONSAVEL2) ' Field HORA_FINAL Call mapa_transfusional.UpdateSort(mapa_transfusional.HORA_FINAL) ' Field RESPONSAVEL3 Call mapa_transfusional.UpdateSort(mapa_transfusional.RESPONSAVEL3) ' Field PA_INICIAL Call mapa_transfusional.UpdateSort(mapa_transfusional.PA_INICIAL) ' Field PA_FINAL Call mapa_transfusional.UpdateSort(mapa_transfusional.PA_FINAL) ' Field TEMP_INICIAL Call mapa_transfusional.UpdateSort(mapa_transfusional.TEMP_INICIAL) ' Field TEMP_FINAL Call mapa_transfusional.UpdateSort(mapa_transfusional.TEMP_FINAL) ' Field PULSO_ART_INICIAL Call mapa_transfusional.UpdateSort(mapa_transfusional.PULSO_ART_INICIAL) ' Field PULSO_ART_FINAL Call mapa_transfusional.UpdateSort(mapa_transfusional.PULSO_ART_FINAL) mapa_transfusional.StartRecordNumber = 1 ' Reset start position End If End Sub ' ----------------------------------------------------------------- ' Load Sort Order parameters ' Sub LoadSortOrder() Dim sOrderBy sOrderBy = mapa_transfusional.SessionOrderBy ' Get order by from Session If sOrderBy = "" Then If mapa_transfusional.SqlOrderBy <> "" Then sOrderBy = mapa_transfusional.SqlOrderBy mapa_transfusional.SessionOrderBy = sOrderBy mapa_transfusional.DATA.Sort = "DESC" End If End If End Sub ' ----------------------------------------------------------------- ' Reset command based on querystring parameter cmd= ' - RESET: reset search parameters ' - RESETALL: reset search & master/detail parameters ' - RESETSORT: reset sort parameters ' Sub ResetCmd() Dim sCmd ' Get reset cmd If Request.QueryString("cmd").Count > 0 Then sCmd = Request.QueryString("cmd") ' Reset search criteria If LCase(sCmd) = "reset" Or LCase(sCmd) = "resetall" Then Call ResetSearchParms() End If ' Reset master/detail keys If LCase(sCmd) = "resetall" Then mapa_transfusional.CurrentMasterTable = "" ' Clear master table DbMasterFilter = "" DbDetailFilter = "" mapa_transfusional.REGISTRO_GERAL.SessionValue = "" End If ' Reset Sort Criteria If LCase(sCmd) = "resetsort" Then Dim sOrderBy sOrderBy = "" mapa_transfusional.SessionOrderBy = sOrderBy mapa_transfusional.SessionOrderByList = sOrderBy mapa_transfusional.ID.Sort = "" mapa_transfusional.DATA.Sort = "" mapa_transfusional.REGISTRO_GERAL.Sort = "" mapa_transfusional.ESPECIE.Sort = "" mapa_transfusional.NUMERO_BOLSA.Sort = "" mapa_transfusional.HORA_INICIAL.Sort = "" mapa_transfusional.RESPONSAVEL1.Sort = "" mapa_transfusional.REVISAO_130.Sort = "" mapa_transfusional.RESPONSAVEL2.Sort = "" mapa_transfusional.HORA_FINAL.Sort = "" mapa_transfusional.RESPONSAVEL3.Sort = "" mapa_transfusional.PA_INICIAL.Sort = "" mapa_transfusional.PA_FINAL.Sort = "" mapa_transfusional.TEMP_INICIAL.Sort = "" mapa_transfusional.TEMP_FINAL.Sort = "" mapa_transfusional.PULSO_ART_INICIAL.Sort = "" mapa_transfusional.PULSO_ART_FINAL.Sort = "" End If ' Reset start position StartRec = 1 mapa_transfusional.StartRecordNumber = StartRec End If End Sub ' Set up list options Sub SetupListOptions() Dim item ListOptions.Add("edit") ListOptions.GetItem("edit").CssStyle = "white-space: nowrap;" ListOptions.GetItem("edit").Visible = True ListOptions.GetItem("edit").OnLeft = True ListOptions.Add("checkbox") ListOptions.GetItem("checkbox").CssStyle = "white-space: nowrap;" ListOptions.GetItem("checkbox").Visible = True ListOptions.GetItem("checkbox").OnLeft = True ListOptions.MoveItem "checkbox", 0 ' Move to first column ListOptions.GetItem("checkbox").Header = "" Call ListOptions_Load() End Sub ' Render list options Sub RenderListOptions() Dim item, links ListOptions.LoadDefault() If ListOptions.GetItem("edit").Visible Then Set item = ListOptions.GetItem("edit") item.Body = "" & Language.Phrase("EditLink") & "" End If If ListOptions.GetItem("checkbox").Visible Then ListOptions.GetItem("checkbox").Body = "" End If Call RenderListOptionsExt() Call ListOptions_Rendered() End Sub Function RenderListOptionsExt() End Function Dim Pager ' ----------------------------------------------------------------- ' Set up Starting Record parameters based on Pager Navigation ' Sub SetUpStartRec() Dim PageNo ' Exit if DisplayRecs = 0 If DisplayRecs = 0 Then Exit Sub If IsPageRequest Then ' Validate request ' Check for a START parameter If Request.QueryString(EW_TABLE_START_REC).Count > 0 Then StartRec = Request.QueryString(EW_TABLE_START_REC) mapa_transfusional.StartRecordNumber = StartRec ElseIf Request.QueryString(EW_TABLE_PAGE_NO).Count > 0 Then PageNo = Request.QueryString(EW_TABLE_PAGE_NO) If IsNumeric(PageNo) Then StartRec = (PageNo-1)*DisplayRecs+1 If StartRec <= 0 Then StartRec = 1 ElseIf StartRec >= ((TotalRecs-1)\DisplayRecs)*DisplayRecs+1 Then StartRec = ((TotalRecs-1)\DisplayRecs)*DisplayRecs+1 End If mapa_transfusional.StartRecordNumber = StartRec End If End If End If StartRec = mapa_transfusional.StartRecordNumber ' Check if correct start record counter If Not IsNumeric(StartRec) Or StartRec = "" Then ' Avoid invalid start record counter StartRec = 1 ' Reset start record counter mapa_transfusional.StartRecordNumber = StartRec ElseIf CLng(StartRec) > CLng(TotalRecs) Then ' Avoid starting record > total records StartRec = ((TotalRecs-1)\DisplayRecs)*DisplayRecs+1 ' Point to last page first record mapa_transfusional.StartRecordNumber = StartRec ElseIf (StartRec-1) Mod DisplayRecs <> 0 Then StartRec = ((StartRec-1)\DisplayRecs)*DisplayRecs+1 ' Point to page boundary mapa_transfusional.StartRecordNumber = StartRec End If End Sub ' ----------------------------------------------------------------- ' Load basic search values ' Function LoadBasicSearchValues() mapa_transfusional.BasicSearchKeyword = Request.QueryString(EW_TABLE_BASIC_SEARCH) mapa_transfusional.BasicSearchType = Request.QueryString(EW_TABLE_BASIC_SEARCH_TYPE) End Function ' ----------------------------------------------------------------- ' 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 ' 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 ViewUrl = mapa_transfusional.ViewUrl EditUrl = mapa_transfusional.EditUrl("") InlineEditUrl = mapa_transfusional.InlineEditUrl CopyUrl = mapa_transfusional.CopyUrl("") InlineCopyUrl = mapa_transfusional.InlineCopyUrl DeleteUrl = mapa_transfusional.DeleteUrl ' 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 ' Set up export options Sub SetupExportOptions() Dim item ' Printer friendly ExportOptions.Add("print") Set item = ExportOptions.GetItem("print") item.Body = "" & Language.Phrase("PrinterFriendly") & "" item.Visible = True ' Export to Excel ExportOptions.Add("excel") Set item = ExportOptions.GetItem("excel") item.Body = "" & Language.Phrase("ExportToExcel") & "" item.Visible = True ' Export to Word ExportOptions.Add("word") Set item = ExportOptions.GetItem("word") item.Body = "" & Language.Phrase("ExportToWord") & "" item.Visible = False ' Export to Html ExportOptions.Add("html") Set item = ExportOptions.GetItem("html") item.Body = "" & Language.Phrase("ExportToHtml") & "" item.Visible = False ' Export to Xml ExportOptions.Add("xml") Set item = ExportOptions.GetItem("xml") item.Body = "" & Language.Phrase("ExportToXml") & "" item.Visible = False ' Export to Csv ExportOptions.Add("csv") Set item = ExportOptions.GetItem("csv") item.Body = "" & Language.Phrase("ExportToCsv") & "" item.Visible = True ' Export to Email ExportOptions.Add("email") Set item = ExportOptions.GetItem("email") item.Body = "" & Language.Phrase("ExportToEmail") & "" item.Visible = False ' Hide options for export/action If mapa_transfusional.Export <> "" Or mapa_transfusional.CurrentAction <> "" Then ExportOptions.HideAllOptions() End If End Sub ' ----------------------------------------------------------------- ' Export data in HTML/CSV/Word/Excel/XML/Email format ' Sub ExportData() Dim XmlDoc Dim ExportDoc Dim ExportStyle ' Default export style ExportStyle = "h" ' Load recordset Set Rs = LoadRecordset() TotalRecs = Rs.RecordCount StartRec = 1 ' Export all If mapa_transfusional.ExportAll Then StopRec = TotalRecs ' Export 1 page only Else SetUpStartRec() ' Set Up Start Record Position ' Set the last record to display If DisplayRecs < 0 Then StopRec = TotalRecs Else StopRec = StartRec + DisplayRecs - 1 End If End If If mapa_transfusional.Export = "xml" Then Set XmlDoc = New cXMLDocument Else Set ExportDoc = New cExportDocument Set ExportDoc.Table = mapa_transfusional Call ExportDoc.ChangeStyle("h") End If Dim ParentTable ParentTable = "" Dim rsmaster ' Export master record If EW_EXPORT_MASTER_RECORD And mapa_transfusional.MasterFilter <> "" And mapa_transfusional.CurrentMasterTable = "receptor" Then Set rsmaster = receptor.LoadRs(DbMasterFilter) ' Load master record If Not rsmaster.Eof Then If mapa_transfusional.Export = "xml" Then ParentTable = "receptor" Call receptor.ExportXmlDocument(XmlDoc, False, rsmaster, 1, 1, "") Else If mapa_transfusional.Export <> "csv" Or EW_EXPORT_MASTER_RECORD_FOR_CSV Then Call receptor.ExportDocument(ExportDoc, rsmaster, 1, 1, "") Call ExportDoc.ExportEmptyLine() End If End If rsmaster.Close() End If Set rsmaster = Nothing End If If mapa_transfusional.Export = "xml" Then Call mapa_transfusional.ExportXmlDocument(XmlDoc, (ParentTable <> ""), rs, StartRec, StopRec, "") Else Dim sHeader sHeader = PageHeader Call Page_DataRendering(sHeader) ExportDoc.Text = ExportDoc.Text & sHeader Call mapa_transfusional.ExportDocument(ExportDoc, rs, StartRec, StopRec, "") Dim sFooter sFooter = PageFooter Call Page_DataRendered(sFooter) ExportDoc.Text = ExportDoc.Text & sFooter End If ' Close recordset and connection Rs.Close Set Rs = Nothing ' Export header and footer If mapa_transfusional.Export <> "xml" Then Call ExportDoc.ExportHeaderAndFooter() End If If mapa_transfusional.Export = "xml" Then XmlDoc.Output Set XmlDoc = Nothing Else If mapa_transfusional.Export = "email" Then Call ExportEmail(ExportDoc.Text) Call Page_Terminate(mapa_transfusional.ExportReturnUrl) Else Response.Write ExportDoc.Text End If Set ExportDoc = Nothing End If End Sub ' ----------------------------------------------------------------- ' 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 ' ListOptions Load event Sub ListOptions_Load() 'Example: ' Dim opt ' Set opt = ListOptions.Add("new") ' opt.OnLeft = True ' Link on left ' opt.MoveTo 0 ' Move to first column End Sub ' ListOptions Rendered event Sub ListOptions_Rendered() 'Example: 'ListOptions.GetItem("new").Body = "xxx" End Sub End Class %>