home *** CD-ROM | disk | FTP | other *** search
/ 66.142.0.142 / 66.142.0.142.tar / 66.142.0.142 / App_Code / tblEmployeesinfo.vb < prev    next >
Text File  |  2012-01-28  |  38KB  |  1,151 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 tblEmployees As ctblEmployees
  12.  
  13.     ' Define table class
  14.     Class ctblEmployees
  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 "tblEmployees"
  38.             End Get
  39.         End Property
  40.  
  41.         ' Table name
  42.         Public ReadOnly Property TableName() As String
  43.             Get
  44.                 Return "tblEmployees"
  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 "tblEmployees_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 * FROM [tblEmployees]"
  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 And ew_Session("tfpssnet_Status_UserLevel") <> 3 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 And ew_Session("tfpssnet_Status_UserLevel") <> 3 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 And ew_Session("tfpssnet_Status_UserLevel") <> 3 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.                     values = values & EW_DB_SQLPARAM_SYMBOL
  286.                     If EW_DB_SQLPARAM_SYMBOL <> "?" Then values = values & fld.FldVar
  287.                     values = values & ","
  288.                 End If
  289.             Next f
  290.             If names.EndsWith(",") Then names = names.Remove(names.Length - 1)
  291.             If values.EndsWith(",") Then values = values.Remove(values.Length - 1)
  292.             If names = "" Then Return -1
  293.             Sql = "INSERT INTO [tblEmployees] (" & names & ") VALUES (" & values & ")"
  294.             Dim command As OleDbCommand = Conn.GetCommand(Sql)
  295.             For Each f As DictionaryEntry In Rs
  296.                 fld = FieldByName(f.Key)
  297.                 If fld IsNot Nothing Then
  298.                     value = f.Value    
  299.                     If EW_MD5_PASSWORD AndAlso ew_SameStr(f.Key, "empUserPass") Then
  300.                         If EW_CASE_SENSITIVE_PASSWORD Then
  301.                             value = MD5(Convert.ToString(value))
  302.                         Else
  303.                             value = MD5(Convert.ToString(value).ToLower())
  304.                         End If                        
  305.                     End If            
  306.                     command.Parameters.Add(fld.FldVar, fld.FldDbType).Value = value    
  307.                 End If
  308.             Next
  309.             Return command.ExecuteNonQuery()            
  310.         End Function
  311.  
  312.         ' Update
  313.         Public Function Update(ByRef Rs As OrderedDictionary) As Integer
  314.             Dim Sql As String = ""            
  315.             Dim values As String = ""            
  316.             Dim value As Object
  317.             Dim fld As cField
  318.             For Each f As DictionaryEntry In Rs
  319.                 fld = FieldByName(f.Key)
  320.                 If fld IsNot Nothing Then
  321.                     values = values & fld.FldExpression & "=" & EW_DB_SQLPARAM_SYMBOL
  322.                     If EW_DB_SQLPARAM_SYMBOL <> "?" Then values = values & fld.FldVar
  323.                     values = values & ","
  324.                 End If
  325.             Next f
  326.             If values.EndsWith(",") Then values = values.Remove(values.Length - 1)
  327.             If values = "" Then Return -1
  328.             Sql = "UPDATE [tblEmployees] SET " & values
  329.             If CurrentFilter <> "" Then Sql = Sql & " WHERE " & CurrentFilter
  330.             Dim command As OleDbCommand = Conn.GetCommand(Sql)
  331.             For Each f As DictionaryEntry In Rs
  332.                 fld = FieldByName(f.Key)
  333.                 If fld IsNot Nothing Then
  334.                     value = f.Value    
  335.                     If EW_MD5_PASSWORD AndAlso ew_SameStr(f.Key, "empUserPass") Then
  336.                         If EW_CASE_SENSITIVE_PASSWORD Then
  337.                             value = MD5(Convert.ToString(value))
  338.                         Else
  339.                             value = MD5(Convert.ToString(value).ToLower())
  340.                         End If
  341.                     End If
  342.                     command.Parameters.Add(fld.FldVar, fld.FldDbType).Value = value
  343.                 End If
  344.             Next
  345.             Return command.ExecuteNonQuery()
  346.         End Function
  347.  
  348.         ' Delete
  349.         Public Function Delete(ByRef Rs As OrderedDictionary) As Integer
  350.             Dim Sql As String
  351.             Dim fld As cField            
  352.             Sql = "DELETE FROM [tblEmployees] WHERE "
  353.             fld = FieldByName("empID")
  354.             Sql = Sql & fld.FldExpression & "=" & ew_QuotedValue(Rs("empID"), EW_DATATYPE_NUMBER) & " AND "
  355.             If Sql.EndsWith(" AND ") Then Sql = Sql.Remove(Sql.Length - 5)
  356.             If CurrentFilter <> "" Then    Sql = Sql & " AND " & CurrentFilter
  357.             Return Conn.Execute(Sql)
  358.         End Function
  359.  
  360.         ' Key filter for table
  361.         Private ReadOnly Property SqlKeyFilter() As String
  362.             Get
  363.                 Return "[empID] = @empID@"
  364.             End Get
  365.         End Property
  366.  
  367.         ' Return Key filter for table
  368.         Public ReadOnly Property KeyFilter() As String
  369.             Get
  370.                 Dim sKeyFilter As String
  371.                 sKeyFilter = SqlKeyFilter
  372.                 If Not IsNumeric(empID.CurrentValue) Then
  373.                     sKeyFilter = "0=1" ' Invalid key
  374.                 End If
  375.                 sKeyFilter = sKeyFilter.Replace("@empID@", ew_AdjustSql(empID.CurrentValue)) ' Replace key value
  376.                 Return sKeyFilter
  377.             End Get
  378.         End Property
  379.  
  380.         ' Return URL
  381.         Public ReadOnly Property ReturnUrl() As String
  382.             Get ' Get referer URL automatically
  383.                 If HttpContext.Current.Request.ServerVariables("HTTP_REFERER") IsNot Nothing Then
  384.                     If ew_ReferPage() <> ew_CurrentPage() AndAlso ew_ReferPage() <> "login.aspx" Then ' Referer not same page or login page
  385.                         Dim url As String = HttpContext.Current.Request.ServerVariables("HTTP_REFERER")
  386.                         If url.Contains("?a=") Then ' Remove action
  387.                             Dim p1 As Integer = url.LastIndexOf("?a=")                            
  388.                             Dim p2 As Integer = url.IndexOf("&", p1)                            
  389.                             If p2 > -1 Then
  390.                                 url = url.Substring(0, p1 + 1) & url.Substring(p2 + 1)
  391.                             Else
  392.                                 url = url.Substring(0, p1)                                 
  393.                             End If
  394.                         End If
  395.                         ew_Session(EW_PROJECT_NAME & "_" & TableVar & "_" & EW_TABLE_RETURN_URL) = url ' Save to Session
  396.                     End If
  397.                 End If
  398.                 If ew_NotEmpty(ew_Session(EW_PROJECT_NAME & "_" & TableVar & "_" & EW_TABLE_RETURN_URL)) Then
  399.                     Return ew_Session(EW_PROJECT_NAME & "_" & TableVar & "_" & EW_TABLE_RETURN_URL)
  400.                 Else
  401.                     Return "tblEmployeeslist.aspx"
  402.                 End If
  403.             End Get
  404.         End Property
  405.  
  406.         ' View URL
  407.         Public Function ViewUrl() As String
  408.             Return KeyUrl("tblEmployeesview.aspx", UrlParm(""))
  409.         End Function
  410.  
  411.         ' Add URL
  412.         Public Function AddUrl() As String
  413.             AddUrl = "tblEmployeesadd.aspx"
  414.             Dim sUrlParm As String
  415.             sUrlParm = UrlParm("")
  416.             If sUrlParm <> "" Then AddUrl = AddUrl & "?" & sUrlParm
  417.         End Function
  418.  
  419.         ' Edit URL
  420.         Public Function EditUrl() As String
  421.             Return KeyUrl("tblEmployeesedit.aspx", UrlParm(""))
  422.         End Function
  423.  
  424.         ' Inline edit URL
  425.         Public Function InlineEditUrl() As String
  426.             Return KeyUrl(ew_CurrentPage(), UrlParm("a=edit"))
  427.         End Function
  428.  
  429.         ' Copy URL
  430.         Public Function CopyUrl() As String
  431.             Return KeyUrl("tblEmployeesadd.aspx", UrlParm(""))
  432.         End Function
  433.  
  434.         ' Inline copy URL
  435.         Public Function InlineCopyUrl() As String
  436.             Return KeyUrl(ew_CurrentPage(), UrlParm("a=copy"))
  437.         End Function
  438.  
  439.         ' Delete URL
  440.         Public Function DeleteUrl() As String
  441.             Return KeyUrl("tblEmployeesdelete.aspx", UrlParm(""))
  442.         End Function
  443.  
  444.         ' Key URL
  445.         Public Function KeyUrl(url As String, parm As String) As String
  446.             Dim sUrl As String
  447.             sUrl = url & "?"
  448.             If parm <> "" Then sUrl = sUrl & parm & "&"
  449.             If Not IsDbNull(empID.CurrentValue) Then
  450.                 sUrl = sUrl & "empID=" & empID.CurrentValue
  451.             Else
  452.                 Return "javascript:alert('Invalid Record! Key is null');"
  453.             End If
  454.             Return sUrl
  455.         End Function
  456.  
  457.         ' URL parm
  458.         Function UrlParm(parm As String) As String
  459.             Dim OutStr As String = ""
  460.             If UseTokenInUrl Then
  461.                 OutStr = "t=tblEmployees"
  462.             End If
  463.             If parm <> "" Then
  464.                 If OutStr <> "" Then OutStr = OutStr & "&"
  465.                 OutStr = OutStr & parm
  466.             End If
  467.             Return OutStr
  468.         End Function
  469.  
  470.         ' Sort URL
  471.         Public Function SortUrl(ByRef fld As cField) As String
  472.             Dim OutStr As String = ""
  473.             If CurrentAction <> "" OrElse Export <> "" OrElse (fld.FldType = 201 OrElse fld.FldType = 203 OrElse fld.FldType = 205) Then
  474.                 OutStr = ""
  475.             Else
  476.                 OutStr = ew_CurrentPage()
  477.                 Dim sUrlParm As String
  478.                 sUrlParm = UrlParm("order=" & HttpContext.Current.Server.UrlEncode(fld.FldName) & "&ordertype=" & fld.ReverseSort)
  479.                 OutStr = OutStr & "?" & sUrlParm
  480.             End If
  481.             Return OutStr
  482.         End Function        
  483.  
  484.         ' Load rows based on filter
  485.         Public Function LoadRs(sFilter As String) As OleDbDataReader
  486.             Dim RsRows As OleDbDataReader
  487.  
  488.             ' Set up filter (SQL WHERE clause)
  489.             CurrentFilter = sFilter
  490.             Dim sSql As String = SQL()
  491.             Try
  492.                 RsRows = Conn.GetDataReader(sSql)
  493.                 If RsRows.HasRows Then
  494.                     Return RsRows
  495.                 Else
  496.                     RsRows.Close()
  497.                     RsRows.Dispose()
  498.                 End If
  499.             Catch
  500.             End Try
  501.             Return Nothing
  502.         End Function
  503.  
  504.         ' Load row values from recordset
  505.         Public Sub LoadListRowValues(ByRef RsRow As OleDbDataReader)            
  506.             empID.DbValue = RsRow("empID")
  507.             empPayrollNumber.DbValue = RsRow("empPayrollNumber")
  508.             empUsername.DbValue = RsRow("empUsername")
  509.             empName.DbValue = RsRow("empName")
  510.             empFirstName.DbValue = RsRow("empFirstName")
  511.             empLastName.DbValue = RsRow("empLastName")
  512.             empAddress.DbValue = RsRow("empAddress")
  513.             empCity.DbValue = RsRow("empCity")
  514.             empState.DbValue = RsRow("empState")
  515.             empZIP.DbValue = RsRow("empZIP")
  516.             empPhone.DbValue = RsRow("empPhone")
  517.             empStatusID.DbValue = RsRow("empStatusID")
  518.             empStartDate.DbValue = RsRow("empStartDate")
  519.             empPositionID.DbValue = RsRow("empPositionID")
  520.             empRate.DbValue = RsRow("empRate")
  521.             empLastRaiseDate.DbValue = RsRow("empLastRaiseDate")
  522.             empLastRaiseAmount.DbValue = RsRow("empLastRaiseAmount")
  523.             empEmail.DbValue = RsRow("empEmail")
  524.             empLiftCert.DbValue = IIf(ew_ConvertToBool(RsRow("empLiftCert")), "1", "0")
  525.             empForkCert.DbValue = IIf(ew_ConvertToBool(RsRow("empForkCert")), "1", "0")
  526.             empDriveAuth.DbValue = IIf(ew_ConvertToBool(RsRow("empDriveAuth")), "1", "0")
  527.             empTimeClock.DbValue = IIf(ew_ConvertToBool(RsRow("empTimeClock")), "1", "0")
  528.             empIsActive.DbValue = IIf(ew_ConvertToBool(RsRow("empIsActive")), "1", "0")
  529.             empUserPass.DbValue = RsRow("empUserPass")
  530.             empUserLevel.DbValue = RsRow("empUserLevel")
  531.         End Sub
  532.  
  533.         ' Render list row values
  534.         Public Sub RenderListRow()
  535.  
  536.             ' Row Rendering event
  537.             Row_Rendering()
  538.  
  539.             ' empID
  540.             empID.ViewValue = empID.CurrentValue
  541.             empID.CssStyle = ""
  542.             empID.CssClass = ""
  543.             empID.ViewCustomAttributes = ""
  544.  
  545.             ' empPayrollNumber
  546.             empPayrollNumber.ViewValue = empPayrollNumber.CurrentValue
  547.             empPayrollNumber.CssStyle = ""
  548.             empPayrollNumber.CssClass = ""
  549.             empPayrollNumber.ViewCustomAttributes = ""
  550.  
  551.             ' empUsername
  552.             empUsername.ViewValue = empUsername.CurrentValue
  553.             empUsername.CssStyle = ""
  554.             empUsername.CssClass = ""
  555.             empUsername.ViewCustomAttributes = ""
  556.  
  557.             ' empName
  558.             empName.ViewValue = empName.CurrentValue
  559.             empName.CssStyle = ""
  560.             empName.CssClass = ""
  561.             empName.ViewCustomAttributes = ""
  562.  
  563.             ' empPhone
  564.             empPhone.ViewValue = empPhone.CurrentValue
  565.             empPhone.CssStyle = ""
  566.             empPhone.CssClass = ""
  567.             empPhone.ViewCustomAttributes = ""
  568.  
  569.             ' empStatusID
  570.             If ew_NotEmpty(empStatusID.CurrentValue) Then
  571.                 sSqlWrk = "SELECT [tscStatus] FROM [tblEmployeeStatus] WHERE [ID] = " & ew_AdjustSql(empStatusID.CurrentValue) & ""
  572.                 sSqlWrk = sSqlWrk & " ORDER BY [tscStatus] "
  573.                 RsWrk = Conn.GetTempDataReader(sSqlWrk)
  574.                 If RsWrk.Read() Then
  575.                     empStatusID.ViewValue = RsWrk("tscStatus")
  576.                 Else
  577.                     empStatusID.ViewValue = empStatusID.CurrentValue
  578.                 End If
  579.                 Conn.CloseTempDataReader()
  580.             Else
  581.                 empStatusID.ViewValue = System.DBNull.Value
  582.             End If
  583.             empStatusID.CssStyle = ""
  584.             empStatusID.CssClass = ""
  585.             empStatusID.ViewCustomAttributes = ""
  586.  
  587.             ' empPositionID
  588.             If ew_NotEmpty(empPositionID.CurrentValue) Then
  589.                 sSqlWrk = "SELECT [posDescription] FROM [tblPositions] WHERE [posID] = " & ew_AdjustSql(empPositionID.CurrentValue) & ""
  590.                 sSqlWrk = sSqlWrk & " ORDER BY [posDescription] "
  591.                 RsWrk = Conn.GetTempDataReader(sSqlWrk)
  592.                 If RsWrk.Read() Then
  593.                     empPositionID.ViewValue = RsWrk("posDescription")
  594.                 Else
  595.                     empPositionID.ViewValue = empPositionID.CurrentValue
  596.                 End If
  597.                 Conn.CloseTempDataReader()
  598.             Else
  599.                 empPositionID.ViewValue = System.DBNull.Value
  600.             End If
  601.             empPositionID.CssStyle = ""
  602.             empPositionID.CssClass = ""
  603.             empPositionID.ViewCustomAttributes = ""
  604.  
  605.             ' empEmail
  606.             empEmail.ViewValue = empEmail.CurrentValue
  607.             empEmail.CssStyle = ""
  608.             empEmail.CssClass = ""
  609.             empEmail.ViewCustomAttributes = ""
  610.  
  611.             ' empID
  612.             empID.HrefValue = ""
  613.  
  614.             ' empPayrollNumber
  615.             empPayrollNumber.HrefValue = ""
  616.  
  617.             ' empUsername
  618.             empUsername.HrefValue = ""
  619.  
  620.             ' empName
  621.             empName.HrefValue = ""
  622.  
  623.             ' empPhone
  624.             empPhone.HrefValue = ""
  625.  
  626.             ' empStatusID
  627.             empStatusID.HrefValue = ""
  628.  
  629.             ' empPositionID
  630.             empPositionID.HrefValue = ""
  631.  
  632.             ' empEmail
  633.             empEmail.HrefValue = ""
  634.  
  635.             ' Row Rendered event
  636.             Row_Rendered()
  637.         End Sub
  638.  
  639.         ' User ID filter
  640.         Public Function UserIDFilter(userid As Object) As String
  641.             Dim sUserIDFilter As String
  642.             sUserIDFilter = "[empID] = " & ew_QuotedValue(userid, EW_DATATYPE_NUMBER)
  643.             Return sUserIDFilter
  644.         End Function
  645.  
  646.         ' Add user ID filter
  647.         Public Function AddUserIDFilter(sFilter As String) As String
  648.             Dim sFilterWrk As String
  649.             sFilterWrk = Security.UserIDList
  650.             If Not Security.IsAdmin And ew_Session("tfpssnet_Status_UserLevel") <> 3 AndAlso sFilterWrk <> "" Then
  651.                 sFilterWrk = "[empID] IN (" & sFilterWrk & ")"
  652.                 If sFilter <> "" Then sFilterWrk = "(" & sFilter & ") AND (" & sFilterWrk & ")"
  653.             Else
  654.                 sFilterWrk = sFilter
  655.             End If
  656.             Return sFilterWrk
  657.         End Function        
  658.  
  659.         ' Get user ID subquery
  660.         Public Function GetUserIDSubquery(ByRef fld As Object, ByRef masterfld As Object) As String
  661.             Dim sWrk As String = ""
  662.             Dim sSql As String = "SELECT " & masterfld.FldExpression & " FROM [tblEmployees] WHERE " & AddUserIDFilter("")            
  663.             If EW_USE_SUBQUERY_FOR_MASTER_USER_ID Then ' Use subquery
  664.                 sWrk = sSql
  665.             Else ' List all values
  666.                 Dim RsUser As OleDbDataReader = Conn.GetTempDataReader(sSql)
  667.                 Try
  668.                     Do While RsUser.Read()
  669.                         If sWrk <> "" Then sWrk = sWrk & ","
  670.                         sWrk = sWrk & ew_QuotedValue(RsUser(0), masterfld.FldDataType)
  671.                     Loop
  672.                 Finally
  673.                     Conn.CloseTempDataReader()
  674.                 End Try
  675.             End If
  676.             If sWrk <> "" Then
  677.                 sWrk = fld.FldExpression & " IN (" & sWrk & ")"
  678.             End If
  679.             Return sWrk
  680.         End Function
  681.  
  682.         Public CurrentAction As String ' Current action
  683.  
  684.         Public EventCancelled As Boolean ' Event cancelled
  685.  
  686.         Public CancelMessage As String ' Cancel message
  687.  
  688.         ' Row Type
  689.         Public RowType As Integer    
  690.  
  691.         Public CssClass As String = "" ' CSS class
  692.  
  693.         Public CssStyle As String = "" ' CSS style
  694.  
  695.         Public RowClientEvents As String = "" ' Row client events
  696.  
  697.         ' Row Attribute
  698.         Public ReadOnly Property RowAttributes() As String
  699.             Get
  700.                 Dim sAtt As String = ""
  701.                 If ew_NotEmpty(CssStyle) Then
  702.                     sAtt = sAtt & " style=""" & CssStyle.Trim() & """"
  703.                 End If
  704.                 If ew_NotEmpty(CssClass) Then
  705.                     sAtt = sAtt & " class=""" & CssClass.Trim() & """"
  706.                 End If
  707.                 If m_Export = "" Then
  708.                     If ew_NotEmpty(RowClientEvents) Then
  709.                         sAtt = sAtt & " " & RowClientEvents.Trim()
  710.                     End If
  711.                 End If
  712.                 Return sAtt
  713.             End Get
  714.         End Property
  715.  
  716.         ' Export
  717.         Private m_Export As String
  718.  
  719.         Public Property Export() As String
  720.             Get
  721.                 Return m_Export
  722.             End Get
  723.             Set(ByVal Value As String)
  724.                 m_Export = Value
  725.             End Set
  726.         End Property
  727.  
  728.         ' Export Original Value
  729.         Public ExportOriginalValue As Boolean = EW_EXPORT_ORIGINAL_VALUE
  730.  
  731.         ' Export All
  732.         Public ExportAll As Boolean = EW_EXPORT_ALL
  733.  
  734.         ' Send Email
  735.         Public SendEmail As Boolean
  736.  
  737.         ' Custom Inner Html
  738.         Public TableCustomInnerHtml As Object
  739.  
  740.         '
  741.         '  Field objects
  742.         '        
  743.         Public Function FieldByName(Name As String) As Object
  744.             If Name = "empID" Then Return empID
  745.             If Name = "empPayrollNumber" Then Return empPayrollNumber
  746.             If Name = "empUsername" Then Return empUsername
  747.             If Name = "empName" Then Return empName
  748.             If Name = "empFirstName" Then Return empFirstName
  749.             If Name = "empLastName" Then Return empLastName
  750.             If Name = "empAddress" Then Return empAddress
  751.             If Name = "empCity" Then Return empCity
  752.             If Name = "empState" Then Return empState
  753.             If Name = "empZIP" Then Return empZIP
  754.             If Name = "empPhone" Then Return empPhone
  755.             If Name = "empStatusID" Then Return empStatusID
  756.             If Name = "empStartDate" Then Return empStartDate
  757.             If Name = "empPositionID" Then Return empPositionID
  758.             If Name = "empRate" Then Return empRate
  759.             If Name = "empLastRaiseDate" Then Return empLastRaiseDate
  760.             If Name = "empLastRaiseAmount" Then Return empLastRaiseAmount
  761.             If Name = "empEmail" Then Return empEmail
  762.             If Name = "empLiftCert" Then Return empLiftCert
  763.             If Name = "empForkCert" Then Return empForkCert
  764.             If Name = "empDriveAuth" Then Return empDriveAuth
  765.             If Name = "empTimeClock" Then Return empTimeClock
  766.             If Name = "empIsActive" Then Return empIsActive
  767.             If Name = "empUserPass" Then Return empUserPass
  768.             If Name = "empUserLevel" Then Return empUserLevel
  769.             Return Nothing        
  770.         End Function
  771.  
  772.         ' empID
  773.         Private m_empID As cField
  774.  
  775.         Public ReadOnly Property empID() As cField
  776.             Get
  777.                 If m_empID Is Nothing Then m_empID = New cField("tblEmployees", "x_empID", "empID", "[empID]", 3, OleDbType.Integer, EW_DATATYPE_NUMBER, 0)
  778.                 Return m_empID
  779.             End Get
  780.         End Property
  781.  
  782.         ' empPayrollNumber
  783.         Private m_empPayrollNumber As cField
  784.  
  785.         Public ReadOnly Property empPayrollNumber() As cField
  786.             Get
  787.                 If m_empPayrollNumber Is Nothing Then m_empPayrollNumber = New cField("tblEmployees", "x_empPayrollNumber", "empPayrollNumber", "[empPayrollNumber]", 3, OleDbType.Integer, EW_DATATYPE_NUMBER, 0)
  788.                 Return m_empPayrollNumber
  789.             End Get
  790.         End Property
  791.  
  792.         ' empUsername
  793.         Private m_empUsername As cField
  794.  
  795.         Public ReadOnly Property empUsername() As cField
  796.             Get
  797.                 If m_empUsername Is Nothing Then m_empUsername = New cField("tblEmployees", "x_empUsername", "empUsername", "[empUsername]", 202, OleDbType.VarWChar, EW_DATATYPE_STRING,  0)
  798.                 Return m_empUsername
  799.             End Get
  800.         End Property
  801.  
  802.         ' empName
  803.         Private m_empName As cField
  804.  
  805.         Public ReadOnly Property empName() As cField
  806.             Get
  807.                 If m_empName Is Nothing Then m_empName = New cField("tblEmployees", "x_empName", "empName", "[empName]", 202, OleDbType.VarWChar, EW_DATATYPE_STRING,  0)
  808.                 Return m_empName
  809.             End Get
  810.         End Property
  811.  
  812.         ' empFirstName
  813.         Private m_empFirstName As cField
  814.  
  815.         Public ReadOnly Property empFirstName() As cField
  816.             Get
  817.                 If m_empFirstName Is Nothing Then m_empFirstName = New cField("tblEmployees", "x_empFirstName", "empFirstName", "[empFirstName]", 202, OleDbType.VarWChar, EW_DATATYPE_STRING,  0)
  818.                 Return m_empFirstName
  819.             End Get
  820.         End Property
  821.  
  822.         ' empLastName
  823.         Private m_empLastName As cField
  824.  
  825.         Public ReadOnly Property empLastName() As cField
  826.             Get
  827.                 If m_empLastName Is Nothing Then m_empLastName = New cField("tblEmployees", "x_empLastName", "empLastName", "[empLastName]", 202, OleDbType.VarWChar, EW_DATATYPE_STRING,  0)
  828.                 Return m_empLastName
  829.             End Get
  830.         End Property
  831.  
  832.         ' empAddress
  833.         Private m_empAddress As cField
  834.  
  835.         Public ReadOnly Property empAddress() As cField
  836.             Get
  837.                 If m_empAddress Is Nothing Then m_empAddress = New cField("tblEmployees", "x_empAddress", "empAddress", "[empAddress]", 202, OleDbType.VarWChar, EW_DATATYPE_STRING,  0)
  838.                 Return m_empAddress
  839.             End Get
  840.         End Property
  841.  
  842.         ' empCity
  843.         Private m_empCity As cField
  844.  
  845.         Public ReadOnly Property empCity() As cField
  846.             Get
  847.                 If m_empCity Is Nothing Then m_empCity = New cField("tblEmployees", "x_empCity", "empCity", "[empCity]", 202, OleDbType.VarWChar, EW_DATATYPE_STRING,  0)
  848.                 Return m_empCity
  849.             End Get
  850.         End Property
  851.  
  852.         ' empState
  853.         Private m_empState As cField
  854.  
  855.         Public ReadOnly Property empState() As cField
  856.             Get
  857.                 If m_empState Is Nothing Then m_empState = New cField("tblEmployees", "x_empState", "empState", "[empState]", 202, OleDbType.VarWChar, EW_DATATYPE_STRING,  0)
  858.                 Return m_empState
  859.             End Get
  860.         End Property
  861.  
  862.         ' empZIP
  863.         Private m_empZIP As cField
  864.  
  865.         Public ReadOnly Property empZIP() As cField
  866.             Get
  867.                 If m_empZIP Is Nothing Then m_empZIP = New cField("tblEmployees", "x_empZIP", "empZIP", "[empZIP]", 202, OleDbType.VarWChar, EW_DATATYPE_STRING,  0)
  868.                 Return m_empZIP
  869.             End Get
  870.         End Property
  871.  
  872.         ' empPhone
  873.         Private m_empPhone As cField
  874.  
  875.         Public ReadOnly Property empPhone() As cField
  876.             Get
  877.                 If m_empPhone Is Nothing Then m_empPhone = New cField("tblEmployees", "x_empPhone", "empPhone", "[empPhone]", 202, OleDbType.VarWChar, EW_DATATYPE_STRING,  0)
  878.                 Return m_empPhone
  879.             End Get
  880.         End Property
  881.  
  882.         ' empStatusID
  883.         Private m_empStatusID As cField
  884.  
  885.         Public ReadOnly Property empStatusID() As cField
  886.             Get
  887.                 If m_empStatusID Is Nothing Then m_empStatusID = New cField("tblEmployees", "x_empStatusID", "empStatusID", "[empStatusID]", 3, OleDbType.Integer, EW_DATATYPE_NUMBER,  0)
  888.                 Return m_empStatusID
  889.             End Get
  890.         End Property
  891.  
  892.         ' empStartDate
  893.         Private m_empStartDate As cField
  894.  
  895.         Public ReadOnly Property empStartDate() As cField
  896.             Get
  897.                 If m_empStartDate Is Nothing Then m_empStartDate = New cField("tblEmployees", "x_empStartDate", "empStartDate", "[empStartDate]", 135, OleDbType.DBTimeStamp, EW_DATATYPE_DATE,  6)
  898.                 Return m_empStartDate
  899.             End Get
  900.         End Property
  901.  
  902.         ' empPositionID
  903.         Private m_empPositionID As cField
  904.  
  905.         Public ReadOnly Property empPositionID() As cField
  906.             Get
  907.                 If m_empPositionID Is Nothing Then m_empPositionID = New cField("tblEmployees", "x_empPositionID", "empPositionID", "[empPositionID]", 3, OleDbType.Integer, EW_DATATYPE_NUMBER,  0)
  908.                 Return m_empPositionID
  909.             End Get
  910.         End Property
  911.  
  912.         ' empRate
  913.         Private m_empRate As cField
  914.  
  915.         Public ReadOnly Property empRate() As cField
  916.             Get
  917.                 If m_empRate Is Nothing Then m_empRate = New cField("tblEmployees", "x_empRate", "empRate", "[empRate]", 6, OleDbType.Currency, EW_DATATYPE_NUMBER,  0)
  918.                 Return m_empRate
  919.             End Get
  920.         End Property
  921.  
  922.         ' empLastRaiseDate
  923.         Private m_empLastRaiseDate As cField
  924.  
  925.         Public ReadOnly Property empLastRaiseDate() As cField
  926.             Get
  927.                 If m_empLastRaiseDate Is Nothing Then m_empLastRaiseDate = New cField("tblEmployees", "x_empLastRaiseDate", "empLastRaiseDate", "[empLastRaiseDate]", 135, OleDbType.DBTimeStamp, EW_DATATYPE_DATE,  6)
  928.                 Return m_empLastRaiseDate
  929.             End Get
  930.         End Property
  931.  
  932.         ' empLastRaiseAmount
  933.         Private m_empLastRaiseAmount As cField
  934.  
  935.         Public ReadOnly Property empLastRaiseAmount() As cField
  936.             Get
  937.                 If m_empLastRaiseAmount Is Nothing Then m_empLastRaiseAmount = New cField("tblEmployees", "x_empLastRaiseAmount", "empLastRaiseAmount", "[empLastRaiseAmount]", 6, OleDbType.Currency, EW_DATATYPE_NUMBER,  0)
  938.                 Return m_empLastRaiseAmount
  939.             End Get
  940.         End Property
  941.  
  942.         ' empEmail
  943.         Private m_empEmail As cField
  944.  
  945.         Public ReadOnly Property empEmail() As cField
  946.             Get
  947.                 If m_empEmail Is Nothing Then m_empEmail = New cField("tblEmployees", "x_empEmail", "empEmail", "[empEmail]", 202, OleDbType.VarWChar, EW_DATATYPE_STRING,  0)
  948.                 Return m_empEmail
  949.             End Get
  950.         End Property
  951.  
  952.         ' empLiftCert
  953.         Private m_empLiftCert As cField
  954.  
  955.         Public ReadOnly Property empLiftCert() As cField
  956.             Get
  957.                 If m_empLiftCert Is Nothing Then m_empLiftCert = New cField("tblEmployees", "x_empLiftCert", "empLiftCert", "[empLiftCert]", 11, OleDbType.Boolean, EW_DATATYPE_BOOLEAN,  0)
  958.                 Return m_empLiftCert
  959.             End Get
  960.         End Property
  961.  
  962.         ' empForkCert
  963.         Private m_empForkCert As cField
  964.  
  965.         Public ReadOnly Property empForkCert() As cField
  966.             Get
  967.                 If m_empForkCert Is Nothing Then m_empForkCert = New cField("tblEmployees", "x_empForkCert", "empForkCert", "[empForkCert]", 11, OleDbType.Boolean, EW_DATATYPE_BOOLEAN,  0)
  968.                 Return m_empForkCert
  969.             End Get
  970.         End Property
  971.  
  972.         ' empDriveAuth
  973.         Private m_empDriveAuth As cField
  974.  
  975.         Public ReadOnly Property empDriveAuth() As cField
  976.             Get
  977.                 If m_empDriveAuth Is Nothing Then m_empDriveAuth = New cField("tblEmployees", "x_empDriveAuth", "empDriveAuth", "[empDriveAuth]", 11, OleDbType.Boolean, EW_DATATYPE_BOOLEAN, 0)
  978.                 Return m_empDriveAuth
  979.             End Get
  980.         End Property
  981.  
  982.         ' empTimeClock
  983.         Private m_empTimeClock As cField
  984.  
  985.         Public ReadOnly Property empTimeClock() As cField
  986.             Get
  987.                 If m_empTimeClock Is Nothing Then m_empTimeClock = New cField("tblEmployees", "x_empTimeClock", "empTimeClock", "[empTimeClock]", 11, OleDbType.Boolean, EW_DATATYPE_BOOLEAN, 0)
  988.                 Return m_empTimeClock
  989.             End Get
  990.         End Property
  991.  
  992.         ' empIsActive
  993.         Private m_empIsActive As cField
  994.  
  995.         Public ReadOnly Property empIsActive() As cField
  996.             Get
  997.                 If m_empIsActive Is Nothing Then m_empIsActive = New cField("tblEmployees", "x_empIsActive", "empIsActive", "[empIsActive]", 11, OleDbType.Boolean, EW_DATATYPE_BOOLEAN, 0)
  998.                 Return m_empIsActive
  999.             End Get
  1000.         End Property
  1001.  
  1002.         ' empUserPass
  1003.         Private m_empUserPass As cField
  1004.  
  1005.         Public ReadOnly Property empUserPass() As cField
  1006.             Get
  1007.                 If m_empUserPass Is Nothing Then m_empUserPass = New cField("tblEmployees", "x_empUserPass", "empUserPass", "[empUserPass]", 202, OleDbType.VarWChar, EW_DATATYPE_STRING,  0)
  1008.                 Return m_empUserPass
  1009.             End Get
  1010.         End Property
  1011.  
  1012.         ' empUserLevel
  1013.         Private m_empUserLevel As cField
  1014.  
  1015.         Public ReadOnly Property empUserLevel() As cField
  1016.             Get
  1017.                 If m_empUserLevel Is Nothing Then m_empUserLevel = New cField("tblEmployees", "x_empUserLevel", "empUserLevel", "[empUserLevel]", 3, OleDbType.Integer, EW_DATATYPE_NUMBER,  0)
  1018.                 Return m_empUserLevel
  1019.             End Get
  1020.         End Property
  1021.  
  1022.         ' Table level events
  1023.         ' Recordset Selecting event
  1024.         Public Sub Recordset_Selecting(ByRef filter As String) 
  1025.  
  1026.             ' Enter your code here    
  1027.         End Sub
  1028.  
  1029.         ' Recordset Selected event
  1030.         Public Sub Recordset_Selected(rs As DbDataReader)
  1031.  
  1032.             'HttpContext.Current.Response.Write("Recordset Selected")
  1033.         End Sub
  1034.  
  1035.         ' Recordset Searching event
  1036.         Public Sub Recordset_Searching(ByRef filter As String)
  1037.  
  1038.             ' Enter your code here
  1039.         End Sub
  1040.  
  1041.         ' Row_Selecting event
  1042.         Public Sub Row_Selecting(ByRef filter As String)
  1043.  
  1044.             ' Enter your code here    
  1045.         End Sub
  1046.  
  1047.         ' Row Selected event
  1048.         Public Sub Row_Selected(rs As DbDataReader)
  1049.  
  1050.             'HttpContext.Current.Response.Write("Row Selected")
  1051.         End Sub
  1052.  
  1053.         ' Row Rendering event
  1054.         Public Sub Row_Rendering()
  1055.  
  1056.             ' Enter your code here    
  1057.         End Sub
  1058.  
  1059.         ' Row Rendered event
  1060.         Public Sub Row_Rendered()
  1061.  
  1062.             ' To view properties of field class, use:
  1063.             ' HttpContext.Current.Response.Write(<FieldName>.AsString())
  1064.  
  1065.         End Sub
  1066.  
  1067.         ' Row Inserting event
  1068.         Public Function Row_Inserting(ByRef rs As OrderedDictionary) As Boolean
  1069.  
  1070.             ' Enter your code here
  1071.             ' To cancel, set return value to False and error message to CancelMessage
  1072.  
  1073.             Return True
  1074.         End Function
  1075.  
  1076.         ' Row Inserted event
  1077.         Public Sub Row_Inserted(rs As OrderedDictionary)
  1078.  
  1079.             'HttpContext.Current.Response.Write("Row Inserted")
  1080.         End Sub
  1081.  
  1082.         ' Row Updating event
  1083.         Public Function Row_Updating(rsold As OrderedDictionary, ByRef rsnew As OrderedDictionary) As Boolean
  1084.  
  1085.             ' Enter your code here
  1086.             ' To cancel, set return value to False and error message to CancelMessage
  1087.  
  1088.             Return True
  1089.         End Function
  1090.  
  1091.         ' Row Updated event
  1092.         Public Sub Row_Updated(rsold As OrderedDictionary, rsnew As OrderedDictionary)
  1093.  
  1094.             'HttpContext.Current.Response.Write("Row Updated")
  1095.         End Sub
  1096.  
  1097.         ' Recordset Deleting event
  1098.         Public Function Row_Deleting(rs As OrderedDictionary) As Boolean
  1099.  
  1100.             ' Enter your code here
  1101.             ' To cancel, set return value to False and error message to CancelMessage
  1102.  
  1103.             Return True
  1104.         End Function
  1105.  
  1106.         ' Recordset Deleted event
  1107.         Public Sub Row_Deleted(rs As OrderedDictionary)
  1108.  
  1109.             'HttpContext.Current.Response.Write("Row Deleted")
  1110.         End Sub
  1111.  
  1112.         ' Email Sending event
  1113.         Public Function Email_Sending(ByRef Email As cEmail, Args As Hashtable) As Boolean
  1114.  
  1115.             'HttpContext.Current.Response.Write(Email.AsString())
  1116.             'HttpContext.Current.Response.End()
  1117.  
  1118.             Return True
  1119.         End Function
  1120.  
  1121.         ' Class terminate
  1122.         Public Sub Dispose() Implements IDisposable.Dispose
  1123.             If m_empID IsNot Nothing Then m_empID.Dispose()
  1124.             If m_empPayrollNumber IsNot Nothing Then m_empPayrollNumber.Dispose()
  1125.             If m_empUsername IsNot Nothing Then m_empUsername.Dispose()
  1126.             If m_empName IsNot Nothing Then m_empName.Dispose()
  1127.             If m_empFirstName IsNot Nothing Then m_empFirstName.Dispose()
  1128.             If m_empLastName IsNot Nothing Then m_empLastName.Dispose()
  1129.             If m_empAddress IsNot Nothing Then m_empAddress.Dispose()
  1130.             If m_empCity IsNot Nothing Then m_empCity.Dispose()
  1131.             If m_empState IsNot Nothing Then m_empState.Dispose()
  1132.             If m_empZIP IsNot Nothing Then m_empZIP.Dispose()
  1133.             If m_empPhone IsNot Nothing Then m_empPhone.Dispose()
  1134.             If m_empStatusID IsNot Nothing Then m_empStatusID.Dispose()
  1135.             If m_empStartDate IsNot Nothing Then m_empStartDate.Dispose()
  1136.             If m_empPositionID IsNot Nothing Then m_empPositionID.Dispose()
  1137.             If m_empRate IsNot Nothing Then m_empRate.Dispose()
  1138.             If m_empLastRaiseDate IsNot Nothing Then m_empLastRaiseDate.Dispose()
  1139.             If m_empLastRaiseAmount IsNot Nothing Then m_empLastRaiseAmount.Dispose()
  1140.             If m_empEmail IsNot Nothing Then m_empEmail.Dispose()
  1141.             If m_empLiftCert IsNot Nothing Then m_empLiftCert.Dispose()
  1142.             If m_empForkCert IsNot Nothing Then m_empForkCert.Dispose()
  1143.             If m_empDriveAuth IsNot Nothing Then m_empDriveAuth.Dispose()
  1144.             If m_empTimeClock IsNot Nothing Then m_empTimeClock.Dispose()
  1145.             If m_empIsActive IsNot Nothing Then m_empIsActive.Dispose()
  1146.             If m_empUserPass IsNot Nothing Then m_empUserPass.Dispose()
  1147.             If m_empUserLevel IsNot Nothing Then m_empUserLevel.Dispose()
  1148.         End Sub
  1149.     End Class
  1150. End Class
  1151.