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