home *** CD-ROM | disk | FTP | other *** search
/ 66.142.0.142 / 66.142.0.142.tar / 66.142.0.142 / App_Code / viewClockInOutinfo.vb < prev    next >
Text File  |  2014-01-07  |  40KB  |  1,226 lines

  1. Imports System.Data
  2. Imports System.Data.Common
  3. Imports System.Data.OleDb
  4.  
  5. '
  6. ' ASP.NET Maker 7 Project Class (Table)
  7. '
  8. Public Partial Class AspNetMaker7_tfpssnet
  9.     Inherits System.Web.UI.Page
  10.  
  11.     Public viewClockInOut As cviewClockInOut
  12.  
  13.     ' Define table class
  14.     Class cviewClockInOut
  15.         Inherits AspNetMakerBase
  16.         Implements IDisposable
  17.  
  18.         ' Used by system generated functions
  19.         Private RsWrk As Object, sSqlWrk As String, sWhereWrk As String
  20.  
  21.         Private arwrk As Object
  22.  
  23.         Private armultiwrk() As String
  24.  
  25.         ' Constructor
  26.         Public Sub New(ByRef APage As AspNetMakerPage)
  27.             m_Page = APage
  28.             m_ParentPage = APage.ParentPage            
  29.         End Sub
  30.  
  31.         ' Define table level constants    
  32.         Public UseTokenInUrl As Boolean = EW_USE_TOKEN_IN_URL
  33.  
  34.         ' Table variable
  35.         Public ReadOnly Property TableVar() As String
  36.             Get
  37.                 Return "viewClockInOut"
  38.             End Get
  39.         End Property
  40.  
  41.         ' Table name
  42.         Public ReadOnly Property TableName() As String
  43.             Get
  44.                 Return "viewClockInOut"
  45.             End Get
  46.         End Property
  47.  
  48.         ' Records per page        
  49.         Public Property RecordsPerPage() As Integer
  50.             Get                
  51.                 Return ew_Session(EW_PROJECT_NAME & "_" & TableVar & "_" & EW_TABLE_REC_PER_PAGE)
  52.             End Get
  53.             Set(ByVal Value As Integer)                
  54.                 ew_Session(EW_PROJECT_NAME & "_" & TableVar & "_" & EW_TABLE_REC_PER_PAGE) = Value
  55.             End Set
  56.         End Property
  57.  
  58.         ' Start record number        
  59.         Public Property StartRecordNumber() As Integer
  60.             Get                
  61.                 Return ew_Session(EW_PROJECT_NAME & "_" & TableVar & "_" & EW_TABLE_START_REC)
  62.             End Get
  63.             Set(ByVal Value As Integer)                
  64.                 ew_Session(EW_PROJECT_NAME & "_" & TableVar & "_" & EW_TABLE_START_REC) = Value
  65.             End Set
  66.         End Property
  67.  
  68.         ' Search Highlight Name
  69.         Public ReadOnly Property HighlightName() As String
  70.             Get
  71.                 Return "viewClockInOut_Highlight"
  72.             End Get
  73.         End Property
  74.  
  75.         ' Advanced search
  76.         Public Function GetAdvancedSearch(ByRef fld As Object) As String            
  77.             Return Convert.ToString(ew_Session(EW_PROJECT_NAME & "_" & TableVar & "_" & EW_TABLE_ADVANCED_SEARCH & "_" & fld))
  78.         End Function
  79.  
  80.         Public Sub SetAdvancedSearch(ByRef fld As Object, v As Object)            
  81.             If ew_Session(EW_PROJECT_NAME & "_" & TableVar & "_" & EW_TABLE_ADVANCED_SEARCH & "_" & fld) <> v Then
  82.                 ew_Session(EW_PROJECT_NAME & "_" & TableVar & "_" & EW_TABLE_ADVANCED_SEARCH & "_" & fld) = v
  83.             End If
  84.         End Sub
  85.  
  86.         ' Basic search keyword        
  87.         Public Property BasicSearchKeyword() As String
  88.             Get                
  89.                 Return ew_Session(EW_PROJECT_NAME & "_" & TableVar & "_" & EW_TABLE_BASIC_SEARCH)
  90.             End Get
  91.             Set(ByVal Value As String)                
  92.                 ew_Session(EW_PROJECT_NAME & "_" & TableVar & "_" & EW_TABLE_BASIC_SEARCH) = Value
  93.             End Set
  94.         End Property
  95.  
  96.         ' Basic Search Type        
  97.         Public Property BasicSearchType() As String
  98.             Get
  99.                 Return ew_Session(EW_PROJECT_NAME & "_" & TableVar & "_" & EW_TABLE_BASIC_SEARCH_TYPE)
  100.             End Get
  101.             Set(ByVal Value As String)
  102.                 ew_Session(EW_PROJECT_NAME & "_" & TableVar & "_" & EW_TABLE_BASIC_SEARCH_TYPE) = Value
  103.             End Set
  104.         End Property
  105.  
  106.         ' Search WHERE clause        
  107.         Public Property SearchWhere() As String
  108.             Get
  109.                 Return ew_Session(EW_PROJECT_NAME & "_" & TableVar & "_" & EW_TABLE_SEARCH_WHERE)
  110.             End Get
  111.             Set(ByVal Value As String)
  112.                 ew_Session(EW_PROJECT_NAME & "_" & TableVar & "_" & EW_TABLE_SEARCH_WHERE) = Value
  113.             End Set
  114.         End Property
  115.  
  116.         ' Multiple column sort
  117.         Public Sub UpdateSort(ofld, ctrl)
  118.             Dim sSortField As String, sLastSort As String, sThisSort As String, sOrderBy As String
  119.             If CurrentOrder = ofld.FldName Then
  120.                 sSortField = ofld.FldExpression
  121.                 sLastSort = ofld.Sort
  122.                 If CurrentOrderType = "ASC" OrElse CurrentOrderType = "DESC" Then
  123.                     sThisSort = CurrentOrderType
  124.                 Else
  125.                     If sLastSort = "ASC" Then sThisSort = "DESC" Else sThisSort = "ASC"
  126.                 End If
  127.                 ofld.Sort = sThisSort
  128.                 If ctrl Then
  129.                     sOrderBy = SessionOrderBy
  130.                     If sOrderBy.Contains(sSortField & " " & sLastSort) Then
  131.                         sOrderBy = sOrderBy.Replace(sSortField & " " & sLastSort, sSortField & " " & sThisSort)
  132.                     Else
  133.                         If sOrderBy <> "" Then sOrderBy = sOrderBy & ", "
  134.                         sOrderBy = sOrderBy & sSortField & " " & sThisSort
  135.                     End If
  136.                     SessionOrderBy = sOrderBy ' Save to Session
  137.                 Else
  138.                     SessionOrderBy = sSortField & " " & sThisSort ' Save to Session
  139.                 End If
  140.             Else
  141.                 If Not ctrl Then ofld.Sort = ""
  142.             End If
  143.         End Sub
  144.  
  145.         ' Session WHERE Clause        
  146.         Public Property SessionWhere() As String
  147.             Get                
  148.                 Return ew_Session(EW_PROJECT_NAME & "_" & TableVar & "_" & EW_TABLE_WHERE)
  149.             End Get
  150.             Set(ByVal Value As String)                
  151.                 ew_Session(EW_PROJECT_NAME & "_" & TableVar & "_" & EW_TABLE_WHERE) = Value
  152.             End Set
  153.         End Property
  154.  
  155.         ' Session ORDER BY        
  156.         Public Property SessionOrderBy() As String
  157.             Get                
  158.                 Return ew_Session(EW_PROJECT_NAME & "_" & TableVar & "_" & EW_TABLE_ORDER_BY)
  159.             End Get
  160.             Set(ByVal Value As String)                
  161.                 ew_Session(EW_PROJECT_NAME & "_" & TableVar & "_" & EW_TABLE_ORDER_BY) = Value
  162.             End Set
  163.         End Property
  164.  
  165.         ' Session key
  166.         Public Function GetKey(ByRef fld As Object) As Object
  167.             Return ew_Session(EW_PROJECT_NAME & "_" & TableVar & "_" & EW_TABLE_KEY & "_" & fld)
  168.         End Function
  169.  
  170.         Public Sub SetKey(ByRef fld As Object, ByRef v As Object)
  171.             ew_Session(EW_PROJECT_NAME & "_" & TableVar & "_" & EW_TABLE_KEY & "_" & fld) = v
  172.         End Sub
  173.  
  174.         ' Table level SQL
  175.         Public ReadOnly Property SqlSelect() As String
  176.             Get ' Select
  177.                 Return "SELECT tblSchedule.schDate, tblSchedule.schDayOfWeek, tblSchedule.schEvtID, tblSchedule.schPartsID, tblSchedule.schCallTime, tblSchedule.schStartTime, tblSchedule.schEndTime, tblSchedule.schOutTime, tblSchedule.schLocID, tblSchedule.schEmpID, tblSchedule.schPosID, tblSchedule.schTypID, tblSchedule.schActualStart, tblSchedule.schActualEnd, tblSchedule.schStatus, tblSchedule.schNotes, tblSchedule.schDateCreated, tblSchedule.schSchID FROM tblSchedule"
  178.             End Get
  179.         End Property
  180.  
  181.         Public ReadOnly Property SqlWhere() As String
  182.             Get ' Where
  183.                 Return ""
  184.             End Get
  185.         End Property
  186.  
  187.         Public ReadOnly Property SqlGroupBy() As String
  188.             Get ' Group By
  189.                 Return ""
  190.             End Get
  191.         End Property
  192.  
  193.         Public ReadOnly Property SqlHaving() As String
  194.             Get ' Having
  195.                 Return ""
  196.             End Get
  197.         End Property
  198.  
  199.         Public ReadOnly Property SqlOrderBy() As String
  200.             Get ' Order By
  201.                 Return ""
  202.             End Get
  203.         End Property
  204.  
  205.         ' SQL variables
  206.         Public CurrentFilter As String ' Current filter
  207.  
  208.         Public CurrentOrder As String ' Current order
  209.  
  210.         Public CurrentOrderType As String ' Current order type
  211.  
  212.         ' Get SQL
  213.         Public Function GetSQL(where As String, orderby As String) As String
  214.             Return ew_BuildSelectSql(SqlSelect, SqlWhere, SqlGroupBy, SqlHaving, SqlOrderBy, where, orderby)
  215.         End Function
  216.  
  217.         ' Table SQL
  218.         Public ReadOnly Property SQL() As String
  219.             Get
  220.                 Dim sFilter As String, sSort As String
  221.                 sFilter = CurrentFilter
  222.  
  223.                 ' Add user ID filter
  224.                 If Security.CurrentUserID <> "" And Not Security.IsAdmin Then ' Non system admin
  225.                     sFilter = AddUserIDFilter(sFilter) ' Add user ID filter
  226.                 End If
  227.                 sSort = SessionOrderBy
  228.                 Return ew_BuildSelectSql(SqlSelect, SqlWhere, SqlGroupBy, SqlHaving, SqlOrderBy, sFilter, sSort)
  229.             End Get
  230.         End Property
  231.  
  232.         ' Return table SQL with list page filter
  233.         Public ReadOnly Property ListSQL() As String
  234.             Get
  235.                 Dim sFilter As String, sSort As String
  236.                 sFilter = SessionWhere
  237.                 If CurrentFilter <> "" Then
  238.                     If sFilter <> "" Then
  239.                         sFilter = "(" & sFilter & ") AND (" & CurrentFilter & ")"
  240.                     Else
  241.                         sFilter = CurrentFilter
  242.                     End If
  243.                 End If
  244.  
  245.                 ' Add user ID filter
  246.                 If Security.CurrentUserID <> "" And Not Security.IsAdmin Then ' Non system admin
  247.                     sFilter = AddUserIDFilter(sFilter) ' Add user ID filter
  248.                 End If
  249.                 sSort = SessionOrderBy
  250.                 Return ew_BuildSelectSql(SqlSelect, SqlWhere, SqlGroupBy, SqlHaving, SqlOrderBy, sFilter, sSort)
  251.             End Get
  252.         End Property
  253.  
  254.         ' Return SQL for record count
  255.         Public ReadOnly Property SelectCountSQL() As String
  256.             Get
  257.                 Dim sFilter As String = SessionWhere
  258.                 If CurrentFilter <> "" Then
  259.                     If sFilter <> "" Then
  260.                         sFilter = "(" & sFilter & ") AND (" & CurrentFilter & ")"
  261.                     Else
  262.                         sFilter = CurrentFilter
  263.                     End If
  264.                 End If
  265.  
  266.                 ' Add user ID filter
  267.                 If Security.CurrentUserID <> "" And Not Security.IsAdmin Then ' Non system admin
  268.                     sFilter = AddUserIDFilter(sFilter) ' Add user ID filter
  269.                 End If
  270.                 Return ew_BuildSelectSql("SELECT COUNT(*) FROM " & SqlSelect.Substring(14), SqlWhere, "", "", "", sFilter, "")
  271.             End Get
  272.         End Property        
  273.  
  274.         ' Insert
  275.         Public Function Insert(ByRef Rs As OrderedDictionary) As Integer
  276.             Dim Sql As String = ""            
  277.             Dim names As String = ""
  278.             Dim values As String = ""            
  279.             Dim value As Object
  280.             Dim fld As cField        
  281.             For Each f As DictionaryEntry In Rs
  282.                 fld = FieldByName(f.Key)
  283.                 If fld IsNot Nothing Then
  284.                     'names = names & fld.FldExpression & ","
  285.                     names = names & f.Key & ","
  286.                     values = values & EW_DB_SQLPARAM_SYMBOL
  287.                     If EW_DB_SQLPARAM_SYMBOL <> "?" Then values = values & fld.FldVar
  288.                     values = values & ","
  289.                 End If
  290.             Next f
  291.             If names.EndsWith(",") Then names = names.Remove(names.Length - 1)
  292.             If values.EndsWith(",") Then values = values.Remove(values.Length - 1)
  293.             If names = "" Then Return -1
  294.             Sql = "INSERT INTO tblSchedule (" & names & ") VALUES (" & values & ")"
  295.             Dim command As OleDbCommand = Conn.GetCommand(Sql)
  296.             For Each f As DictionaryEntry In Rs
  297.                 fld = FieldByName(f.Key)
  298.                 If fld IsNot Nothing Then
  299.                     value = f.Value    
  300.                     command.Parameters.Add(fld.FldVar, fld.FldDbType).Value = value    
  301.                 End If
  302.             Next
  303.             Return command.ExecuteNonQuery()            
  304.         End Function
  305.  
  306.         ' Update
  307.         Public Function Update(ByRef Rs As OrderedDictionary) As Integer
  308.             Dim Sql As String = ""            
  309.             Dim values As String = ""            
  310.             Dim value As Object
  311.             Dim fld As cField
  312.             For Each f As DictionaryEntry In Rs
  313.                 fld = FieldByName(f.Key)
  314.                 If fld IsNot Nothing Then
  315.                     values = values & fld.FldExpression & "=" & EW_DB_SQLPARAM_SYMBOL
  316.                     If EW_DB_SQLPARAM_SYMBOL <> "?" Then values = values & fld.FldVar
  317.                     values = values & ","
  318.                 End If
  319.             Next f
  320.             If values.EndsWith(",") Then values = values.Remove(values.Length - 1)
  321.             If values = "" Then Return -1
  322.             Sql = "UPDATE tblSchedule SET " & values
  323.             If CurrentFilter <> "" Then Sql = Sql & " WHERE " & CurrentFilter
  324.             Dim command As OleDbCommand = Conn.GetCommand(Sql)
  325.             For Each f As DictionaryEntry In Rs
  326.                 fld = FieldByName(f.Key)
  327.                 If fld IsNot Nothing Then
  328.                     value = f.Value    
  329.                     command.Parameters.Add(fld.FldVar, fld.FldDbType).Value = value
  330.                 End If
  331.             Next
  332.             Return command.ExecuteNonQuery()
  333.         End Function
  334.  
  335.         ' Delete
  336.         Public Function Delete(ByRef Rs As OrderedDictionary) As Integer
  337.             Dim Sql As String
  338.             Dim fld As cField            
  339.             Sql = "DELETE FROM tblSchedule WHERE "
  340.             fld = FieldByName("schSchID")
  341.             Sql = Sql & fld.FldExpression & "=" & ew_QuotedValue(Rs("schSchID"), EW_DATATYPE_NUMBER) & " AND "
  342.             If Sql.EndsWith(" AND ") Then Sql = Sql.Remove(Sql.Length - 5)
  343.             If CurrentFilter <> "" Then    Sql = Sql & " AND " & CurrentFilter
  344.             Return Conn.Execute(Sql)
  345.         End Function
  346.  
  347.         ' Key filter for table
  348.         Private ReadOnly Property SqlKeyFilter() As String
  349.             Get
  350.                 Return "tblSchedule.schSchID = @schSchID@"
  351.             End Get
  352.         End Property
  353.  
  354.         ' Return Key filter for table
  355.         Public ReadOnly Property KeyFilter() As String
  356.             Get
  357.                 Dim sKeyFilter As String
  358.                 sKeyFilter = SqlKeyFilter
  359.                 If Not IsNumeric(schSchID.CurrentValue) Then
  360.                     sKeyFilter = "0=1" ' Invalid key
  361.                 End If
  362.                 sKeyFilter = sKeyFilter.Replace("@schSchID@", ew_AdjustSql(schSchID.CurrentValue)) ' Replace key value
  363.                 Return sKeyFilter
  364.             End Get
  365.         End Property
  366.  
  367.         ' Return URL
  368.         Public ReadOnly Property ReturnUrl() As String
  369.             Get ' Get referer URL automatically
  370.                 If HttpContext.Current.Request.ServerVariables("HTTP_REFERER") IsNot Nothing Then
  371.                     If ew_ReferPage() <> ew_CurrentPage() AndAlso ew_ReferPage() <> "login.aspx" Then ' Referer not same page or login page
  372.                         Dim url As String = HttpContext.Current.Request.ServerVariables("HTTP_REFERER")
  373.                         If url.Contains("?a=") Then ' Remove action
  374.                             Dim p1 As Integer = url.LastIndexOf("?a=")                            
  375.                             Dim p2 As Integer = url.IndexOf("&", p1)                            
  376.                             If p2 > -1 Then
  377.                                 url = url.Substring(0, p1 + 1) & url.Substring(p2 + 1)
  378.                             Else
  379.                                 url = url.Substring(0, p1)                                 
  380.                             End If
  381.                         End If
  382.                         ew_Session(EW_PROJECT_NAME & "_" & TableVar & "_" & EW_TABLE_RETURN_URL) = url ' Save to Session
  383.                     End If
  384.                 End If
  385.                 If ew_NotEmpty(ew_Session(EW_PROJECT_NAME & "_" & TableVar & "_" & EW_TABLE_RETURN_URL)) Then
  386.                     Return ew_Session(EW_PROJECT_NAME & "_" & TableVar & "_" & EW_TABLE_RETURN_URL)
  387.                 Else
  388.                     Return "viewClockInOutlist.aspx"
  389.                 End If
  390.             End Get
  391.         End Property
  392.  
  393.         Public Function KeyUrl2(ByVal url As String, ByVal parm1 As String, ByVal parm2 As String) As String
  394.             Dim sUrl As String : sUrl = url & "?"
  395.             If parm1 <> "" Then sUrl = sUrl & parm1 & "&"
  396.             If parm2 <> "" Then sUrl = sUrl & parm2 & "&"
  397.             If Not IsDBNull(schSchID.CurrentValue) Then
  398.                 sUrl = sUrl & "schSchID=" & schSchID.CurrentValue
  399.             Else
  400.                 KeyUrl2 = "javascript:alert('Invalid Record! Key is null');"
  401.                 Exit Function
  402.             End If
  403.             KeyUrl2 = sUrl
  404.         End Function
  405.  
  406.         ' Edit url
  407.         Public Function EditInUrl() As String
  408.             EditInUrl = KeyUrl(ew_CurrentPage(), UrlParm("a=editIn"))
  409.         End Function
  410.  
  411.         Public Function EditOutUrl() As String
  412.             EditOutUrl = KeyUrl(ew_CurrentPage(), UrlParm("a=editOut"))
  413.         End Function
  414.  
  415.         Public Function EditOutUrl2() As String
  416.             EditOutUrl2 = KeyUrl(ew_CurrentPage(), UrlParm("a=editOutU"))
  417.         End Function
  418.  
  419.         ' View URL
  420.         Public Function ViewUrl() As String
  421.             Return KeyUrl("viewClockInOutview.aspx", UrlParm(""))
  422.         End Function
  423.  
  424.         ' Add URL
  425.         Public Function AddUrl() As String
  426.             AddUrl = "viewClockInOutadd.aspx"
  427.             Dim sUrlParm As String
  428.             sUrlParm = UrlParm("")
  429.             If sUrlParm <> "" Then AddUrl = AddUrl & "?" & sUrlParm
  430.         End Function
  431.  
  432.         ' Edit URL
  433.         Public Function EditUrl() As String
  434.             Return KeyUrl("viewClockInOutedit.aspx", UrlParm(""))
  435.         End Function
  436.  
  437.         ' Inline edit URL
  438.         Public Function InlineEditUrl() As String
  439.             Return KeyUrl(ew_CurrentPage(), UrlParm("a=edit"))
  440.         End Function
  441.  
  442.         ' Copy URL
  443.         Public Function CopyUrl() As String
  444.             Return KeyUrl("viewClockInOutadd.aspx", UrlParm(""))
  445.         End Function
  446.  
  447.         ' Inline copy URL
  448.         Public Function InlineCopyUrl() As String
  449.             Return KeyUrl(ew_CurrentPage(), UrlParm("a=copy"))
  450.         End Function
  451.  
  452.         ' Delete URL
  453.         Public Function DeleteUrl() As String
  454.             Return KeyUrl("viewClockInOutdelete.aspx", UrlParm(""))
  455.         End Function
  456.  
  457.         ' Key URL
  458.         Public Function KeyUrl(url As String, parm As String) As String
  459.             Dim sUrl As String
  460.             sUrl = url & "?"
  461.             If parm <> "" Then sUrl = sUrl & parm & "&"
  462.             If Not IsDbNull(schSchID.CurrentValue) Then
  463.                 sUrl = sUrl & "schSchID=" & schSchID.CurrentValue
  464.             Else
  465.                 Return "javascript:alert('Invalid Record! Key is null');"
  466.             End If
  467.             Return sUrl
  468.         End Function
  469.  
  470.         ' URL parm
  471.         Function UrlParm(parm As String) As String
  472.             Dim OutStr As String = ""
  473.             If UseTokenInUrl Then
  474.                 OutStr = "t=viewClockInOut"
  475.             End If
  476.             If parm <> "" Then
  477.                 If OutStr <> "" Then OutStr = OutStr & "&"
  478.                 OutStr = OutStr & parm
  479.             End If
  480.             Return OutStr
  481.         End Function
  482.  
  483.         ' Sort URL
  484.         Public Function SortUrl(ByRef fld As cField) As String
  485.             Dim OutStr As String = ""
  486.             If CurrentAction <> "" OrElse Export <> "" OrElse (fld.FldType = 201 OrElse fld.FldType = 203 OrElse fld.FldType = 205) Then
  487.                 OutStr = ""
  488.             Else
  489.                 OutStr = ew_CurrentPage()
  490.                 Dim sUrlParm As String
  491.                 sUrlParm = UrlParm("order=" & HttpContext.Current.Server.UrlEncode(fld.FldName) & "&ordertype=" & fld.ReverseSort)
  492.                 OutStr = OutStr & "?" & sUrlParm
  493.             End If
  494.             Return OutStr
  495.         End Function        
  496.  
  497.         ' Load rows based on filter
  498.         Public Function LoadRs(sFilter As String) As OleDbDataReader
  499.             Dim RsRows As OleDbDataReader
  500.  
  501.             ' Set up filter (SQL WHERE clause)
  502.             CurrentFilter = sFilter
  503.             Dim sSql As String = SQL()
  504.             Try
  505.                 RsRows = Conn.GetDataReader(sSql)
  506.                 If RsRows.HasRows Then
  507.                     Return RsRows
  508.                 Else
  509.                     RsRows.Close()
  510.                     RsRows.Dispose()
  511.                 End If
  512.             Catch
  513.             End Try
  514.             Return Nothing
  515.         End Function
  516.  
  517.         ' Load row values from recordset
  518.         Public Sub LoadListRowValues(ByRef RsRow As OleDbDataReader)            
  519.             schSchID.DbValue = RsRow("schSchID")
  520.             schDate.DbValue = RsRow("schDate")
  521.             schEvtID.DbValue = RsRow("schEvtID")
  522.             schPartsID.DbValue = RsRow("schPartsID")
  523.             schCallTime.DbValue = RsRow("schCallTime")
  524.             schStartTime.DbValue = RsRow("schStartTime")
  525.             schEndTime.DbValue = RsRow("schEndTime")
  526.             schOutTime.DbValue = RsRow("schOutTime")
  527.             schLocID.DbValue = RsRow("schLocID")
  528.             schEmpID.DbValue = RsRow("schEmpID")
  529.             schPosID.DbValue = RsRow("schPosID")
  530.             schTypID.DbValue = RsRow("schTypID")
  531.             schNotes.DbValue = RsRow("schNotes")
  532.             schActualStart.DbValue = RsRow("schActualStart")
  533.             schActualEnd.DbValue = RsRow("schActualEnd")
  534.             schDateCreated.DbValue = RsRow("schDateCreated")
  535.             schStatus.DbValue = RsRow("schStatus")
  536.             schDayOfWeek.DbValue = RsRow("schDayOfWeek")
  537.         End Sub
  538.  
  539.         ' Render list row values
  540.         Public Sub RenderListRow()
  541.  
  542.             ' Row Rendering event
  543.             Row_Rendering()
  544.  
  545.             ' schDate
  546.             schDate.ViewValue = schDate.CurrentValue
  547.             schDate.ViewValue = ew_FormatDateTime(schDate.ViewValue, 6)
  548.             schDate.CssStyle = ""
  549.             schDate.CssClass = ""
  550.             schDate.ViewCustomAttributes = ""
  551.  
  552.             ' schEvtID
  553.             If ew_NotEmpty(schEvtID.CurrentValue) Then
  554.                 sSqlWrk = "SELECT [evtDescription] FROM [tblEvents] WHERE [evtID] = " & ew_AdjustSql(schEvtID.CurrentValue) & ""
  555.                 sSqlWrk = sSqlWrk & " ORDER BY [evtDescription] "
  556.                 RsWrk = Conn.GetTempDataReader(sSqlWrk)
  557.                 If RsWrk.Read() Then
  558.                     schEvtID.ViewValue = RsWrk("evtDescription")
  559.                 Else
  560.                     schEvtID.ViewValue = schEvtID.CurrentValue
  561.                 End If
  562.                 Conn.CloseTempDataReader()
  563.             Else
  564.                 schEvtID.ViewValue = System.DBNull.Value
  565.             End If
  566.             schEvtID.CssStyle = ""
  567.             schEvtID.CssClass = ""
  568.             schEvtID.ViewCustomAttributes = ""
  569.  
  570.             ' schPartsID
  571.             If ew_NotEmpty(schPartsID.CurrentValue) Then
  572.                 sSqlWrk = "SELECT [prtDescription] FROM [tblParts] WHERE [prtID] = " & ew_AdjustSql(schPartsID.CurrentValue) & ""
  573.                 sSqlWrk = sSqlWrk & " ORDER BY [prtDescription] "
  574.                 RsWrk = Conn.GetTempDataReader(sSqlWrk)
  575.                 If RsWrk.Read() Then
  576.                     schPartsID.ViewValue = RsWrk("prtDescription")
  577.                 Else
  578.                     schPartsID.ViewValue = schPartsID.CurrentValue
  579.                 End If
  580.                 Conn.CloseTempDataReader()
  581.             Else
  582.                 schPartsID.ViewValue = System.DBNull.Value
  583.             End If
  584.             schPartsID.CssStyle = ""
  585.             schPartsID.CssClass = ""
  586.             schPartsID.ViewCustomAttributes = ""
  587.  
  588.             ' schCallTime
  589.             schCallTime.ViewValue = schCallTime.CurrentValue
  590.             schCallTime.ViewValue = ew_FormatDateTime(schCallTime.ViewValue, 14)
  591.             schCallTime.CssStyle = ""
  592.             schCallTime.CssClass = ""
  593.             schCallTime.ViewCustomAttributes = ""
  594.  
  595.             ' schStartTime
  596.             schStartTime.ViewValue = schStartTime.CurrentValue
  597.             schStartTime.ViewValue = ew_FormatDateTime(schStartTime.ViewValue, 14)
  598.             schStartTime.CssStyle = ""
  599.             schStartTime.CssClass = ""
  600.             schStartTime.ViewCustomAttributes = ""
  601.  
  602.             ' schEndTime
  603.             schEndTime.ViewValue = schEndTime.CurrentValue
  604.             schEndTime.ViewValue = ew_FormatDateTime(schEndTime.ViewValue, 14)
  605.             schEndTime.CssStyle = ""
  606.             schEndTime.CssClass = ""
  607.             schEndTime.ViewCustomAttributes = ""
  608.  
  609.             ' schOutTime
  610.             schOutTime.ViewValue = schOutTime.CurrentValue
  611.             schOutTime.ViewValue = ew_FormatDateTime(schOutTime.ViewValue, 14)
  612.             schOutTime.CssStyle = ""
  613.             schOutTime.CssClass = ""
  614.             schOutTime.ViewCustomAttributes = ""
  615.  
  616.             ' schLocID
  617.             If ew_NotEmpty(schLocID.CurrentValue) Then
  618.                 sSqlWrk = "SELECT [locDescription] FROM [tblLocations] WHERE [locID] = " & ew_AdjustSql(schLocID.CurrentValue) & ""
  619.                 sSqlWrk = sSqlWrk & " ORDER BY [locDescription] "
  620.                 RsWrk = Conn.GetTempDataReader(sSqlWrk)
  621.                 If RsWrk.Read() Then
  622.                     schLocID.ViewValue = RsWrk("locDescription")
  623.                 Else
  624.                     schLocID.ViewValue = schLocID.CurrentValue
  625.                 End If
  626.                 Conn.CloseTempDataReader()
  627.             Else
  628.                 schLocID.ViewValue = System.DBNull.Value
  629.             End If
  630.             schLocID.CssStyle = ""
  631.             schLocID.CssClass = ""
  632.             schLocID.ViewCustomAttributes = ""
  633.  
  634.             ' schEmpID
  635.             If ew_NotEmpty(schEmpID.CurrentValue) Then
  636.                 sSqlWrk = "SELECT [empName] FROM [tblEmployees] WHERE [empID] = " & ew_AdjustSql(schEmpID.CurrentValue) & ""
  637.                 sSqlWrk = sSqlWrk & " ORDER BY [empFirstName] "
  638.                 RsWrk = Conn.GetTempDataReader(sSqlWrk)
  639.                 If RsWrk.Read() Then
  640.                     schEmpID.ViewValue = RsWrk("empName")
  641.                 Else
  642.                     schEmpID.ViewValue = schEmpID.CurrentValue
  643.                 End If
  644.                 Conn.CloseTempDataReader()
  645.             Else
  646.                 schEmpID.ViewValue = System.DBNull.Value
  647.             End If
  648.             schEmpID.CssStyle = ""
  649.             schEmpID.CssClass = ""
  650.             schEmpID.ViewCustomAttributes = ""
  651.  
  652.             ' schPosID
  653.             If ew_NotEmpty(schPosID.CurrentValue) Then
  654.                 sSqlWrk = "SELECT [posDescription] FROM [tblPositions] WHERE [posID] = " & ew_AdjustSql(schPosID.CurrentValue) & ""
  655.                 sSqlWrk = sSqlWrk & " ORDER BY [posDescription] "
  656.                 RsWrk = Conn.GetTempDataReader(sSqlWrk)
  657.                 If RsWrk.Read() Then
  658.                     schPosID.ViewValue = RsWrk("posDescription")
  659.                 Else
  660.                     schPosID.ViewValue = schPosID.CurrentValue
  661.                 End If
  662.                 Conn.CloseTempDataReader()
  663.             Else
  664.                 schPosID.ViewValue = System.DBNull.Value
  665.             End If
  666.             schPosID.CssStyle = ""
  667.             schPosID.CssClass = ""
  668.             schPosID.ViewCustomAttributes = ""
  669.  
  670.             ' schTypID
  671.             If ew_NotEmpty(schTypID.CurrentValue) Then
  672.                 sSqlWrk = "SELECT [typDescription] FROM [tblTypes] WHERE [typID] = " & ew_AdjustSql(schTypID.CurrentValue) & ""
  673.                 sSqlWrk = sSqlWrk & " ORDER BY [typDescription] "
  674.                 RsWrk = Conn.GetTempDataReader(sSqlWrk)
  675.                 If RsWrk.Read() Then
  676.                     schTypID.ViewValue = RsWrk("typDescription")
  677.                 Else
  678.                     schTypID.ViewValue = schTypID.CurrentValue
  679.                 End If
  680.                 Conn.CloseTempDataReader()
  681.             Else
  682.                 schTypID.ViewValue = System.DBNull.Value
  683.             End If
  684.             schTypID.CssStyle = ""
  685.             schTypID.CssClass = ""
  686.             schTypID.ViewCustomAttributes = ""
  687.  
  688.             ' schActualStart
  689.             schActualStart.ViewValue = schActualStart.CurrentValue
  690.             schActualStart.ViewValue = ew_FormatDateTime(schActualStart.ViewValue, 14)
  691.             schActualStart.CssStyle = ""
  692.             schActualStart.CssClass = ""
  693.             schActualStart.ViewCustomAttributes = ""
  694.  
  695.             ' schActualEnd
  696.             schActualEnd.ViewValue = schActualEnd.CurrentValue
  697.             schActualEnd.ViewValue = ew_FormatDateTime(schActualEnd.ViewValue, 14)
  698.             schActualEnd.CssStyle = ""
  699.             schActualEnd.CssClass = ""
  700.             schActualEnd.ViewCustomAttributes = ""
  701.  
  702.             ' schDateCreated
  703.             schDateCreated.ViewValue = schDateCreated.CurrentValue
  704.             schDateCreated.ViewValue = ew_FormatDateTime(schDateCreated.ViewValue, 6)
  705.             schDateCreated.CssStyle = ""
  706.             schDateCreated.CssClass = ""
  707.             schDateCreated.ViewCustomAttributes = ""
  708.  
  709.             ' schStatus
  710.             If ew_NotEmpty(schStatus.CurrentValue) Then
  711.                 sSqlWrk = "SELECT [stDescription] FROM [tblScheduleStatus] WHERE [stID] = " & ew_AdjustSql(schStatus.CurrentValue) & ""
  712.                 sSqlWrk = sSqlWrk & " ORDER BY [stDescription] "
  713.                 RsWrk = Conn.GetTempDataReader(sSqlWrk)
  714.                 If RsWrk.Read() Then
  715.                     schStatus.ViewValue = RsWrk("stDescription")
  716.                 Else
  717.                     schStatus.ViewValue = schStatus.CurrentValue
  718.                 End If
  719.                 Conn.CloseTempDataReader()
  720.             Else
  721.                 schStatus.ViewValue = System.DBNull.Value
  722.             End If
  723.             schStatus.CssStyle = ""
  724.             schStatus.CssClass = ""
  725.             schStatus.ViewCustomAttributes = ""
  726.  
  727.             ' schDayOfWeek
  728.             If ew_NotEmpty(schDayOfWeek.CurrentValue) Then
  729.                 Select Case schDayOfWeek.CurrentValue
  730.                     Case "1"
  731.                         schDayOfWeek.ViewValue = "Sun"
  732.                     Case "2"
  733.                         schDayOfWeek.ViewValue = "Mon"
  734.                     Case "3"
  735.                         schDayOfWeek.ViewValue = "Tues"
  736.                     Case "4"
  737.                         schDayOfWeek.ViewValue = "Wed"
  738.                     Case "5"
  739.                         schDayOfWeek.ViewValue = "Thu"
  740.                     Case "6"
  741.                         schDayOfWeek.ViewValue = "Fri"
  742.                     Case "7"
  743.                         schDayOfWeek.ViewValue = "Sat"
  744.                 End Select
  745.             Else
  746.                 schDayOfWeek.ViewValue = System.DBNull.Value
  747.             End If
  748.             schDayOfWeek.CssStyle = ""
  749.             schDayOfWeek.CssClass = ""
  750.             schDayOfWeek.ViewCustomAttributes = ""
  751.  
  752.  
  753.             ' schDate
  754.             schDate.HrefValue = ""
  755.  
  756.             ' schEvtID
  757.             schEvtID.HrefValue = ""
  758.  
  759.             ' schPartsID
  760.             schPartsID.HrefValue = ""
  761.  
  762.             ' schCallTime
  763.             schCallTime.HrefValue = ""
  764.  
  765.             ' schStartTime
  766.             schStartTime.HrefValue = ""
  767.  
  768.             ' schEndTime
  769.             schEndTime.HrefValue = ""
  770.  
  771.             ' schOutTime
  772.             schOutTime.HrefValue = ""
  773.  
  774.             ' schLocID
  775.             schLocID.HrefValue = ""
  776.  
  777.             ' schEmpID
  778.             schEmpID.HrefValue = ""
  779.  
  780.             ' schPosID
  781.             schPosID.HrefValue = ""
  782.  
  783.             ' schTypID
  784.             schTypID.HrefValue = ""
  785.  
  786.             ' schActualStart
  787.             schActualStart.HrefValue = ""
  788.  
  789.             ' schActualEnd
  790.             schActualEnd.HrefValue = ""
  791.  
  792.             ' schDateCreated
  793.             schDateCreated.HrefValue = ""
  794.  
  795.             ' schStatus
  796.             schStatus.HrefValue = ""
  797.  
  798.             ' schDayOfWeek
  799.             schDayOfWeek.HrefValue = ""
  800.  
  801.             ' Row Rendered event
  802.             Row_Rendered()
  803.         End Sub
  804.  
  805.         ' Add user ID filter
  806.         Public Function AddUserIDFilter(sFilter As String) As String
  807.             Dim sFilterWrk As String
  808.             sFilterWrk = Security.UserIDList
  809.             If Not Security.IsAdmin AndAlso sFilterWrk <> "" Then
  810.                 sFilterWrk = "tblSchedule.schEmpID IN (" & sFilterWrk & ")"
  811.                 If sFilter <> "" Then sFilterWrk = "(" & sFilter & ") AND (" & sFilterWrk & ")"
  812.             Else
  813.                 sFilterWrk = sFilter
  814.             End If
  815.             Return sFilterWrk
  816.         End Function        
  817.  
  818.         ' Get user ID subquery
  819.         Public Function GetUserIDSubquery(ByRef fld As Object, ByRef masterfld As Object) As String
  820.             Dim sWrk As String = ""
  821.             Dim sSql As String = "SELECT " & masterfld.FldExpression & " FROM tblSchedule WHERE " & AddUserIDFilter("")            
  822.             If EW_USE_SUBQUERY_FOR_MASTER_USER_ID Then ' Use subquery
  823.                 sWrk = sSql
  824.             Else ' List all values
  825.                 Dim RsUser As OleDbDataReader = Conn.GetTempDataReader(sSql)
  826.                 Try
  827.                     Do While RsUser.Read()
  828.                         If sWrk <> "" Then sWrk = sWrk & ","
  829.                         sWrk = sWrk & ew_QuotedValue(RsUser(0), masterfld.FldDataType)
  830.                     Loop
  831.                 Finally
  832.                     Conn.CloseTempDataReader()
  833.                 End Try
  834.             End If
  835.             If sWrk <> "" Then
  836.                 sWrk = fld.FldExpression & " IN (" & sWrk & ")"
  837.             End If
  838.             Return sWrk
  839.         End Function
  840.  
  841.         Public CurrentAction As String ' Current action
  842.  
  843.         Public EventCancelled As Boolean ' Event cancelled
  844.  
  845.         Public CancelMessage As String ' Cancel message
  846.  
  847.         ' Row Type
  848.         Public RowType As Integer    
  849.  
  850.         Public CssClass As String = "" ' CSS class
  851.  
  852.         Public CssStyle As String = "" ' CSS style
  853.  
  854.         Public RowClientEvents As String = "" ' Row client events
  855.  
  856.         ' Row Attribute
  857.         Public ReadOnly Property RowAttributes() As String
  858.             Get
  859.                 Dim sAtt As String = ""
  860.                 If ew_NotEmpty(CssStyle) Then
  861.                     sAtt = sAtt & " style=""" & CssStyle.Trim() & """"
  862.                 End If
  863.                 If ew_NotEmpty(CssClass) Then
  864.                     sAtt = sAtt & " class=""" & CssClass.Trim() & """"
  865.                 End If
  866.                 If m_Export = "" Then
  867.                     If ew_NotEmpty(RowClientEvents) Then
  868.                         sAtt = sAtt & " " & RowClientEvents.Trim()
  869.                     End If
  870.                 End If
  871.                 Return sAtt
  872.             End Get
  873.         End Property
  874.  
  875.         ' Export
  876.         Private m_Export As String
  877.  
  878.         Public Property Export() As String
  879.             Get
  880.                 Return m_Export
  881.             End Get
  882.             Set(ByVal Value As String)
  883.                 m_Export = Value
  884.             End Set
  885.         End Property
  886.  
  887.         ' Export Original Value
  888.         Public ExportOriginalValue As Boolean = EW_EXPORT_ORIGINAL_VALUE
  889.  
  890.         ' Export All
  891.         Public ExportAll As Boolean = EW_EXPORT_ALL
  892.  
  893.         ' Send Email
  894.         Public SendEmail As Boolean
  895.  
  896.         ' Custom Inner Html
  897.         Public TableCustomInnerHtml As Object
  898.  
  899.         '
  900.         '  Field objects
  901.         '        
  902.         Public Function FieldByName(Name As String) As Object
  903.             If Name = "schSchID" Then Return schSchID
  904.             If Name = "schDate" Then Return schDate
  905.             If Name = "schEvtID" Then Return schEvtID
  906.             If Name = "schPartsID" Then Return schPartsID
  907.             If Name = "schCallTime" Then Return schCallTime
  908.             If Name = "schStartTime" Then Return schStartTime
  909.             If Name = "schEndTime" Then Return schEndTime
  910.             If Name = "schOutTime" Then Return schOutTime
  911.             If Name = "schLocID" Then Return schLocID
  912.             If Name = "schEmpID" Then Return schEmpID
  913.             If Name = "schPosID" Then Return schPosID
  914.             If Name = "schTypID" Then Return schTypID
  915.             If Name = "schNotes" Then Return schNotes
  916.             If Name = "schActualStart" Then Return schActualStart
  917.             If Name = "schActualEnd" Then Return schActualEnd
  918.             If Name = "schDateCreated" Then Return schDateCreated
  919.             If Name = "schStatus" Then Return schStatus
  920.             If Name = "schDayOfWeek" Then Return schDayOfWeek
  921.             Return Nothing
  922.         End Function
  923.  
  924.         ' schSchID
  925.         Private m_schSchID As cField
  926.  
  927.         Public ReadOnly Property schSchID() As cField
  928.             Get
  929.                 If m_schSchID Is Nothing Then m_schSchID = New cField("viewClockInOut", "x_schSchID", "schSchID", "tblSchedule.schSchID", 3, OleDbType.Integer, EW_DATATYPE_NUMBER,  0)
  930.                 Return m_schSchID
  931.             End Get
  932.         End Property
  933.  
  934.         ' schDate
  935.         Private m_schDate As cField
  936.  
  937.         Public ReadOnly Property schDate() As cField
  938.             Get
  939.                 If m_schDate Is Nothing Then m_schDate = New cField("viewClockInOut", "x_schDate", "schDate", "tblSchedule.schDate", 7, OleDbType.Date, EW_DATATYPE_DATE,  6)
  940.                 Return m_schDate
  941.             End Get
  942.         End Property
  943.  
  944.         ' schEvtID
  945.         Private m_schEvtID As cField
  946.  
  947.         Public ReadOnly Property schEvtID() As cField
  948.             Get
  949.                 If m_schEvtID Is Nothing Then m_schEvtID = New cField("viewClockInOut", "x_schEvtID", "schEvtID", "tblSchedule.schEvtID", 3, OleDbType.Integer, EW_DATATYPE_NUMBER,  0)
  950.                 Return m_schEvtID
  951.             End Get
  952.         End Property
  953.  
  954.         ' schPartsID
  955.         Private m_schPartsID As cField
  956.  
  957.         Public ReadOnly Property schPartsID() As cField
  958.             Get
  959.                 If m_schPartsID Is Nothing Then m_schPartsID = New cField("viewClockInOut", "x_schPartsID", "schPartsID", "tblSchedule.schPartsID", 3, OleDbType.Integer, EW_DATATYPE_NUMBER,  0)
  960.                 Return m_schPartsID
  961.             End Get
  962.         End Property
  963.  
  964.         ' schCallTime
  965.         Private m_schCallTime As cField
  966.  
  967.         Public ReadOnly Property schCallTime() As cField
  968.             Get
  969.                 If m_schCallTime Is Nothing Then m_schCallTime = New cField("viewClockInOut", "x_schCallTime", "schCallTime", "tblSchedule.schCallTime", 7, OleDbType.Date, EW_DATATYPE_DATE,  4)
  970.                 Return m_schCallTime
  971.             End Get
  972.         End Property
  973.  
  974.         ' schStartTime
  975.         Private m_schStartTime As cField
  976.  
  977.         Public ReadOnly Property schStartTime() As cField
  978.             Get
  979.                 If m_schStartTime Is Nothing Then m_schStartTime = New cField("viewClockInOut", "x_schStartTime", "schStartTime", "tblSchedule.schStartTime", 7, OleDbType.Date, EW_DATATYPE_DATE,  4)
  980.                 Return m_schStartTime
  981.             End Get
  982.         End Property
  983.  
  984.         ' schEndTime
  985.         Private m_schEndTime As cField
  986.  
  987.         Public ReadOnly Property schEndTime() As cField
  988.             Get
  989.                 If m_schEndTime Is Nothing Then m_schEndTime = New cField("viewClockInOut", "x_schEndTime", "schEndTime", "tblSchedule.schEndTime", 7, OleDbType.Date, EW_DATATYPE_DATE,  4)
  990.                 Return m_schEndTime
  991.             End Get
  992.         End Property
  993.  
  994.         ' schOutTime
  995.         Private m_schOutTime As cField
  996.  
  997.         Public ReadOnly Property schOutTime() As cField
  998.             Get
  999.                 If m_schOutTime Is Nothing Then m_schOutTime = New cField("viewClockInOut", "x_schOutTime", "schOutTime", "tblSchedule.schOutTime", 7, OleDbType.Date, EW_DATATYPE_DATE,  4)
  1000.                 Return m_schOutTime
  1001.             End Get
  1002.         End Property
  1003.  
  1004.         ' schLocID
  1005.         Private m_schLocID As cField
  1006.  
  1007.         Public ReadOnly Property schLocID() As cField
  1008.             Get
  1009.                 If m_schLocID Is Nothing Then m_schLocID = New cField("viewClockInOut", "x_schLocID", "schLocID", "tblSchedule.schLocID", 3, OleDbType.Integer, EW_DATATYPE_NUMBER,  0)
  1010.                 Return m_schLocID
  1011.             End Get
  1012.         End Property
  1013.  
  1014.         ' schEmpID
  1015.         Private m_schEmpID As cField
  1016.  
  1017.         Public ReadOnly Property schEmpID() As cField
  1018.             Get
  1019.                 If m_schEmpID Is Nothing Then m_schEmpID = New cField("viewClockInOut", "x_schEmpID", "schEmpID", "tblSchedule.schEmpID", 3, OleDbType.Integer, EW_DATATYPE_NUMBER,  0)
  1020.                 Return m_schEmpID
  1021.             End Get
  1022.         End Property
  1023.  
  1024.         ' schPosID
  1025.         Private m_schPosID As cField
  1026.  
  1027.         Public ReadOnly Property schPosID() As cField
  1028.             Get
  1029.                 If m_schPosID Is Nothing Then m_schPosID = New cField("viewClockInOut", "x_schPosID", "schPosID", "tblSchedule.schPosID", 3, OleDbType.Integer, EW_DATATYPE_NUMBER,  0)
  1030.                 Return m_schPosID
  1031.             End Get
  1032.         End Property
  1033.  
  1034.         ' schTypID
  1035.         Private m_schTypID As cField
  1036.  
  1037.         Public ReadOnly Property schTypID() As cField
  1038.             Get
  1039.                 If m_schTypID Is Nothing Then m_schTypID = New cField("viewClockInOut", "x_schTypID", "schTypID", "tblSchedule.schTypID", 3, OleDbType.Integer, EW_DATATYPE_NUMBER,  0)
  1040.                 Return m_schTypID
  1041.             End Get
  1042.         End Property
  1043.  
  1044.         ' schNotes
  1045.         Private m_schNotes As cField
  1046.  
  1047.         Public ReadOnly Property schNotes() As cField
  1048.             Get
  1049.                 If m_schNotes Is Nothing Then m_schNotes = New cField("viewClockInOut", "x_schNotes", "schNotes", "tblSchedule.schNotes", 203, OleDbType.LongVarWChar, EW_DATATYPE_MEMO,  0)
  1050.                 Return m_schNotes
  1051.             End Get
  1052.         End Property
  1053.  
  1054.         ' schActualStart
  1055.         Private m_schActualStart As cField
  1056.  
  1057.         Public ReadOnly Property schActualStart() As cField
  1058.             Get
  1059.                 If m_schActualStart Is Nothing Then m_schActualStart = New cField("viewClockInOut", "x_schActualStart", "schActualStart", "tblSchedule.schActualStart", 7, OleDbType.Date, EW_DATATYPE_DATE,  4)
  1060.                 Return m_schActualStart
  1061.             End Get
  1062.         End Property
  1063.  
  1064.         ' schActualEnd
  1065.         Private m_schActualEnd As cField
  1066.  
  1067.         Public ReadOnly Property schActualEnd() As cField
  1068.             Get
  1069.                 If m_schActualEnd Is Nothing Then m_schActualEnd = New cField("viewClockInOut", "x_schActualEnd", "schActualEnd", "tblSchedule.schActualEnd", 7, OleDbType.Date, EW_DATATYPE_DATE,  4)
  1070.                 Return m_schActualEnd
  1071.             End Get
  1072.         End Property
  1073.  
  1074.         ' schDateCreated
  1075.         Private m_schDateCreated As cField
  1076.  
  1077.         Public ReadOnly Property schDateCreated() As cField
  1078.             Get
  1079.                 If m_schDateCreated Is Nothing Then m_schDateCreated = New cField("viewClockInOut", "x_schDateCreated", "schDateCreated", "tblSchedule.schDateCreated", 7, OleDbType.Date, EW_DATATYPE_DATE,  6)
  1080.                 Return m_schDateCreated
  1081.             End Get
  1082.         End Property
  1083.  
  1084.         ' schStatus
  1085.         Private m_schStatus As cField
  1086.  
  1087.         Public ReadOnly Property schStatus() As cField
  1088.             Get
  1089.                 If m_schStatus Is Nothing Then m_schStatus = New cField("viewClockInOut", "x_schStatus", "schStatus", "tblSchedule.schStatus", 3, OleDbType.Integer, EW_DATATYPE_NUMBER,  0)
  1090.                 Return m_schStatus
  1091.             End Get
  1092.         End Property
  1093.  
  1094.         ' schDayOfWeek
  1095.         Private m_schDayOfWeek As cField
  1096.  
  1097.         Public ReadOnly Property schDayOfWeek() As cField
  1098.             Get
  1099.                 If m_schDayOfWeek Is Nothing Then m_schDayOfWeek = New cField("tblSchedule", "x_schDayOfWeek", "schDayOfWeek", "[schDayOfWeek]", 3, OleDbType.Integer, EW_DATATYPE_NUMBER, 0)
  1100.                 Return m_schDayOfWeek
  1101.             End Get
  1102.         End Property
  1103.  
  1104.         ' Table level events
  1105.         ' Recordset Selecting event
  1106.         Public Sub Recordset_Selecting(ByRef filter As String) 
  1107.  
  1108.             ' Enter your code here    
  1109.         End Sub
  1110.  
  1111.         ' Recordset Selected event
  1112.         Public Sub Recordset_Selected(rs As DbDataReader)
  1113.  
  1114.             'HttpContext.Current.Response.Write("Recordset Selected")
  1115.         End Sub
  1116.  
  1117.         ' Recordset Searching event
  1118.         Public Sub Recordset_Searching(ByRef filter As String)
  1119.  
  1120.             ' Enter your code here
  1121.         End Sub
  1122.  
  1123.         ' Row_Selecting event
  1124.         Public Sub Row_Selecting(ByRef filter As String)
  1125.  
  1126.             ' Enter your code here    
  1127.         End Sub
  1128.  
  1129.         ' Row Selected event
  1130.         Public Sub Row_Selected(rs As DbDataReader)
  1131.  
  1132.             'HttpContext.Current.Response.Write("Row Selected")
  1133.         End Sub
  1134.  
  1135.         ' Row Rendering event
  1136.         Public Sub Row_Rendering()
  1137.  
  1138.             ' Enter your code here    
  1139.         End Sub
  1140.  
  1141.         ' Row Rendered event
  1142.         Public Sub Row_Rendered()
  1143.  
  1144.             ' To view properties of field class, use:
  1145.             ' HttpContext.Current.Response.Write(<FieldName>.AsString())
  1146.  
  1147.         End Sub
  1148.  
  1149.         ' Row Inserting event
  1150.         Public Function Row_Inserting(ByRef rs As OrderedDictionary) As Boolean
  1151.  
  1152.             ' Enter your code here
  1153.             ' To cancel, set return value to False and error message to CancelMessage
  1154.  
  1155.             Return True
  1156.         End Function
  1157.  
  1158.         ' Row Inserted event
  1159.         Public Sub Row_Inserted(rs As OrderedDictionary)
  1160.  
  1161.             'HttpContext.Current.Response.Write("Row Inserted")
  1162.         End Sub
  1163.  
  1164.         ' Row Updating event
  1165.         Public Function Row_Updating(rsold As OrderedDictionary, ByRef rsnew As OrderedDictionary) As Boolean
  1166.  
  1167.             ' Enter your code here
  1168.             ' To cancel, set return value to False and error message to CancelMessage
  1169.  
  1170.             Return True
  1171.         End Function
  1172.  
  1173.         ' Row Updated event
  1174.         Public Sub Row_Updated(rsold As OrderedDictionary, rsnew As OrderedDictionary)
  1175.  
  1176.             'HttpContext.Current.Response.Write("Row Updated")
  1177.         End Sub
  1178.  
  1179.         ' Recordset Deleting event
  1180.         Public Function Row_Deleting(rs As OrderedDictionary) As Boolean
  1181.  
  1182.             ' Enter your code here
  1183.             ' To cancel, set return value to False and error message to CancelMessage
  1184.  
  1185.             Return True
  1186.         End Function
  1187.  
  1188.         ' Recordset Deleted event
  1189.         Public Sub Row_Deleted(rs As OrderedDictionary)
  1190.  
  1191.             'HttpContext.Current.Response.Write("Row Deleted")
  1192.         End Sub
  1193.  
  1194.         ' Email Sending event
  1195.         Public Function Email_Sending(ByRef Email As cEmail, Args As Hashtable) As Boolean
  1196.  
  1197.             'HttpContext.Current.Response.Write(Email.AsString())
  1198.             'HttpContext.Current.Response.End()
  1199.  
  1200.             Return True
  1201.         End Function
  1202.  
  1203.         ' Class terminate
  1204.         Public Sub Dispose() Implements IDisposable.Dispose
  1205.             If m_schSchID IsNot Nothing Then m_schSchID.Dispose()
  1206.             If m_schDate IsNot Nothing Then m_schDate.Dispose()
  1207.             If m_schEvtID IsNot Nothing Then m_schEvtID.Dispose()
  1208.             If m_schPartsID IsNot Nothing Then m_schPartsID.Dispose()
  1209.             If m_schCallTime IsNot Nothing Then m_schCallTime.Dispose()
  1210.             If m_schStartTime IsNot Nothing Then m_schStartTime.Dispose()
  1211.             If m_schEndTime IsNot Nothing Then m_schEndTime.Dispose()
  1212.             If m_schOutTime IsNot Nothing Then m_schOutTime.Dispose()
  1213.             If m_schLocID IsNot Nothing Then m_schLocID.Dispose()
  1214.             If m_schEmpID IsNot Nothing Then m_schEmpID.Dispose()
  1215.             If m_schPosID IsNot Nothing Then m_schPosID.Dispose()
  1216.             If m_schTypID IsNot Nothing Then m_schTypID.Dispose()
  1217.             If m_schNotes IsNot Nothing Then m_schNotes.Dispose()
  1218.             If m_schActualStart IsNot Nothing Then m_schActualStart.Dispose()
  1219.             If m_schActualEnd IsNot Nothing Then m_schActualEnd.Dispose()
  1220.             If m_schDateCreated IsNot Nothing Then m_schDateCreated.Dispose()
  1221.             If m_schStatus IsNot Nothing Then m_schStatus.Dispose()
  1222.             If m_schDayOfWeek IsNot Nothing Then m_schDayOfWeek.Dispose()
  1223.         End Sub
  1224.     End Class
  1225. End Class
  1226.