home *** CD-ROM | disk | FTP | other *** search
/ 66.142.0.142 / 66.142.0.142.tar / 66.142.0.142 / App_Code / ltgFixtureNoteinfo.vb < prev    next >
Text File  |  2014-01-25  |  29KB  |  946 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 ltgFixtureNote As cltgFixtureNote
  12.  
  13.     ' Define table class
  14.     Class cltgFixtureNote
  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 "ltgFixtureNote"
  38.             End Get
  39.         End Property
  40.  
  41.         ' Table name
  42.         Public ReadOnly Property TableName() As String
  43.             Get
  44.                 Return "ltgFixtureNote"
  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 "ltgFixtureNote_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.         ' Current master table name
  175.         Public Property CurrentMasterTable() As String
  176.             Get
  177.                 Return ew_Session(EW_PROJECT_NAME & "_" & TableVar & "_" & EW_TABLE_MASTER_TABLE)
  178.             End Get
  179.             Set(ByVal v As String)
  180.                 ew_Session(EW_PROJECT_NAME & "_" & TableVar & "_" & EW_TABLE_MASTER_TABLE) = v
  181.             End Set
  182.         End Property
  183.  
  184.         ' Session master where clause
  185.         Public Property MasterFilter() As String
  186.             Get    
  187.                 Return ew_Session(EW_PROJECT_NAME & "_" & TableVar & "_" & EW_TABLE_MASTER_FILTER)
  188.             End Get
  189.             Set(ByVal v As String)
  190.                 ew_Session(EW_PROJECT_NAME & "_" & TableVar & "_" & EW_TABLE_MASTER_FILTER) = v
  191.             End Set
  192.         End Property
  193.  
  194.         ' Session detail where clause
  195.         Public Property DetailFilter() As String
  196.             Get
  197.                 Return ew_Session(EW_PROJECT_NAME & "_" & TableVar & "_" & EW_TABLE_DETAIL_FILTER)
  198.             End Get
  199.             Set(ByVal v As String)
  200.                 ew_Session(EW_PROJECT_NAME & "_" & TableVar & "_" & EW_TABLE_DETAIL_FILTER) = v
  201.             End Set
  202.         End Property
  203.  
  204.         ' ltgFixtureMaster
  205.         Public ReadOnly Property ltgFixtureMaster() As cltgFixtureMaster
  206.             Get
  207.                 Return ParentPage.ltgFixtureMaster
  208.             End Get
  209.         End Property        
  210.  
  211.         ' Master filter
  212.         Public ReadOnly Property SqlMasterFilter_ltgFixtureMaster() As String
  213.             Get
  214.                 Return "[lfxID]=@lfxID@"
  215.             End Get
  216.         End Property
  217.  
  218.         ' Detail filter
  219.         Public ReadOnly Property SqlDetailFilter_ltgFixtureMaster() As String
  220.             Get
  221.                 Return "[notFixID]=@notFixID@"
  222.             End Get
  223.         End Property
  224.  
  225.         ' Table level SQL
  226.         Public ReadOnly Property SqlSelect() As String
  227.             Get ' Select
  228.                 Return "SELECT * FROM [ltgFixtureNote]"
  229.             End Get
  230.         End Property
  231.  
  232.         Public ReadOnly Property SqlWhere() As String
  233.             Get ' Where
  234.                 Return ""
  235.             End Get
  236.         End Property
  237.  
  238.         Public ReadOnly Property SqlGroupBy() As String
  239.             Get ' Group By
  240.                 Return ""
  241.             End Get
  242.         End Property
  243.  
  244.         Public ReadOnly Property SqlHaving() As String
  245.             Get ' Having
  246.                 Return ""
  247.             End Get
  248.         End Property
  249.  
  250.         Public ReadOnly Property SqlOrderBy() As String
  251.             Get ' Order By
  252.                 Return ""
  253.             End Get
  254.         End Property
  255.  
  256.         ' SQL variables
  257.         Public CurrentFilter As String ' Current filter
  258.  
  259.         Public CurrentOrder As String ' Current order
  260.  
  261.         Public CurrentOrderType As String ' Current order type
  262.  
  263.         ' Get SQL
  264.         Public Function GetSQL(where As String, orderby As String) As String
  265.             Return ew_BuildSelectSql(SqlSelect, SqlWhere, SqlGroupBy, SqlHaving, SqlOrderBy, where, orderby)
  266.         End Function
  267.  
  268.         ' Table SQL
  269.         Public ReadOnly Property SQL() As String
  270.             Get
  271.                 Dim sFilter As String, sSort As String
  272.                 sFilter = CurrentFilter
  273.                 sSort = SessionOrderBy
  274.                 Return ew_BuildSelectSql(SqlSelect, SqlWhere, SqlGroupBy, SqlHaving, SqlOrderBy, sFilter, sSort)
  275.             End Get
  276.         End Property
  277.  
  278.         ' Return table SQL with list page filter
  279.         Public ReadOnly Property ListSQL() As String
  280.             Get
  281.                 Dim sFilter As String, sSort As String
  282.                 sFilter = SessionWhere
  283.                 If CurrentFilter <> "" Then
  284.                     If sFilter <> "" Then
  285.                         sFilter = "(" & sFilter & ") AND (" & CurrentFilter & ")"
  286.                     Else
  287.                         sFilter = CurrentFilter
  288.                     End If
  289.                 End If
  290.                 sSort = SessionOrderBy
  291.                 Return ew_BuildSelectSql(SqlSelect, SqlWhere, SqlGroupBy, SqlHaving, SqlOrderBy, sFilter, sSort)
  292.             End Get
  293.         End Property
  294.  
  295.         ' Return SQL for record count
  296.         Public ReadOnly Property SelectCountSQL() As String
  297.             Get
  298.                 Dim sFilter As String = SessionWhere
  299.                 If CurrentFilter <> "" Then
  300.                     If sFilter <> "" Then
  301.                         sFilter = "(" & sFilter & ") AND (" & CurrentFilter & ")"
  302.                     Else
  303.                         sFilter = CurrentFilter
  304.                     End If
  305.                 End If
  306.                 Return ew_BuildSelectSql("SELECT COUNT(*) FROM " & SqlSelect.Substring(14), SqlWhere, "", "", "", sFilter, "")
  307.             End Get
  308.         End Property        
  309.  
  310.         ' Insert
  311.         Public Function Insert(ByRef Rs As OrderedDictionary) As Integer
  312.             Dim Sql As String = ""            
  313.             Dim names As String = ""
  314.             Dim values As String = ""            
  315.             Dim value As Object
  316.             Dim fld As cField        
  317.             For Each f As DictionaryEntry In Rs
  318.                 fld = FieldByName(f.Key)
  319.                 If fld IsNot Nothing Then
  320.                     names = names & fld.FldExpression & ","
  321.                     values = values & 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 names.EndsWith(",") Then names = names.Remove(names.Length - 1)
  327.             If values.EndsWith(",") Then values = values.Remove(values.Length - 1)
  328.             If names = "" Then Return -1
  329.             Sql = "INSERT INTO [ltgFixtureNote] (" & names & ") VALUES (" & values & ")"
  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.                     command.Parameters.Add(fld.FldVar, fld.FldDbType).Value = value    
  336.                 End If
  337.             Next
  338.             Return command.ExecuteNonQuery()            
  339.         End Function
  340.  
  341.         ' Update
  342.         Public Function Update(ByRef Rs As OrderedDictionary) As Integer
  343.             Dim Sql As String = ""            
  344.             Dim values As String = ""            
  345.             Dim value As Object
  346.             Dim fld As cField
  347.             For Each f As DictionaryEntry In Rs
  348.                 fld = FieldByName(f.Key)
  349.                 If fld IsNot Nothing Then
  350.                     values = values & fld.FldExpression & "=" & EW_DB_SQLPARAM_SYMBOL
  351.                     If EW_DB_SQLPARAM_SYMBOL <> "?" Then values = values & fld.FldVar
  352.                     values = values & ","
  353.                 End If
  354.             Next f
  355.             If values.EndsWith(",") Then values = values.Remove(values.Length - 1)
  356.             If values = "" Then Return -1
  357.             Sql = "UPDATE [ltgFixtureNote] SET " & values
  358.             If CurrentFilter <> "" Then Sql = Sql & " WHERE " & CurrentFilter
  359.             Dim command As OleDbCommand = Conn.GetCommand(Sql)
  360.             For Each f As DictionaryEntry In Rs
  361.                 fld = FieldByName(f.Key)
  362.                 If fld IsNot Nothing Then
  363.                     value = f.Value    
  364.                     command.Parameters.Add(fld.FldVar, fld.FldDbType).Value = value
  365.                 End If
  366.             Next
  367.             Return command.ExecuteNonQuery()
  368.         End Function
  369.  
  370.         ' Delete
  371.         Public Function Delete(ByRef Rs As OrderedDictionary) As Integer
  372.             Dim Sql As String
  373.             Dim fld As cField            
  374.             Sql = "DELETE FROM [ltgFixtureNote] WHERE "
  375.             fld = FieldByName("notID")
  376.             Sql = Sql & fld.FldExpression & "=" & ew_QuotedValue(Rs("notID"), EW_DATATYPE_NUMBER) & " AND "
  377.             If Sql.EndsWith(" AND ") Then Sql = Sql.Remove(Sql.Length - 5)
  378.             If CurrentFilter <> "" Then    Sql = Sql & " AND " & CurrentFilter
  379.             Return Conn.Execute(Sql)
  380.         End Function
  381.  
  382.         ' Key filter for table
  383.         Private ReadOnly Property SqlKeyFilter() As String
  384.             Get
  385.                 Return "[notID] = @notID@"
  386.             End Get
  387.         End Property
  388.  
  389.         ' Return Key filter for table
  390.         Public ReadOnly Property KeyFilter() As String
  391.             Get
  392.                 Dim sKeyFilter As String
  393.                 sKeyFilter = SqlKeyFilter
  394.                 If Not IsNumeric(notID.CurrentValue) Then
  395.                     sKeyFilter = "0=1" ' Invalid key
  396.                 End If
  397.                 sKeyFilter = sKeyFilter.Replace("@notID@", ew_AdjustSql(notID.CurrentValue)) ' Replace key value
  398.                 Return sKeyFilter
  399.             End Get
  400.         End Property
  401.  
  402.         ' Return URL
  403.         Public ReadOnly Property ReturnUrl() As String
  404.             Get ' Get referer URL automatically
  405.                 If HttpContext.Current.Request.ServerVariables("HTTP_REFERER") IsNot Nothing Then
  406.                     If ew_ReferPage() <> ew_CurrentPage() AndAlso ew_ReferPage() <> "login.aspx" Then ' Referer not same page or login page
  407.                         Dim url As String = HttpContext.Current.Request.ServerVariables("HTTP_REFERER")
  408.                         If url.Contains("?a=") Then ' Remove action
  409.                             Dim p1 As Integer = url.LastIndexOf("?a=")                            
  410.                             Dim p2 As Integer = url.IndexOf("&", p1)                            
  411.                             If p2 > -1 Then
  412.                                 url = url.Substring(0, p1 + 1) & url.Substring(p2 + 1)
  413.                             Else
  414.                                 url = url.Substring(0, p1)                                 
  415.                             End If
  416.                         End If
  417.                         ew_Session(EW_PROJECT_NAME & "_" & TableVar & "_" & EW_TABLE_RETURN_URL) = url ' Save to Session
  418.                     End If
  419.                 End If
  420.                 If ew_NotEmpty(ew_Session(EW_PROJECT_NAME & "_" & TableVar & "_" & EW_TABLE_RETURN_URL)) Then
  421.                     Return ew_Session(EW_PROJECT_NAME & "_" & TableVar & "_" & EW_TABLE_RETURN_URL)
  422.                 Else
  423.                     Return "ltgFixtureNotelist.aspx"
  424.                 End If
  425.             End Get
  426.         End Property
  427.  
  428.         ' View URL
  429.         Public Function ViewUrl() As String
  430.             Return KeyUrl("ltgFixtureNoteview.aspx", UrlParm(""))
  431.         End Function
  432.  
  433.         ' Add URL
  434.         Public Function AddUrl() As String
  435.             AddUrl = "ltgFixtureNoteadd.aspx"
  436.             Dim sUrlParm As String
  437.             sUrlParm = UrlParm("")
  438.             If sUrlParm <> "" Then AddUrl = AddUrl & "?" & sUrlParm
  439.         End Function
  440.  
  441.         ' Edit URL
  442.         Public Function EditUrl() As String
  443.             Return KeyUrl("ltgFixtureNoteedit.aspx", UrlParm(""))
  444.         End Function
  445.  
  446.         ' Inline edit URL
  447.         Public Function InlineEditUrl() As String
  448.             Return KeyUrl(ew_CurrentPage(), UrlParm("a=edit"))
  449.         End Function
  450.  
  451.         ' Copy URL
  452.         Public Function CopyUrl() As String
  453.             Return KeyUrl("ltgFixtureNoteadd.aspx", UrlParm(""))
  454.         End Function
  455.  
  456.         ' Inline copy URL
  457.         Public Function InlineCopyUrl() As String
  458.             Return KeyUrl(ew_CurrentPage(), UrlParm("a=copy"))
  459.         End Function
  460.  
  461.         ' Delete URL
  462.         Public Function DeleteUrl() As String
  463.             Return KeyUrl("ltgFixtureNotedelete.aspx", UrlParm(""))
  464.         End Function
  465.  
  466.         ' Key URL
  467.         Public Function KeyUrl(url As String, parm As String) As String
  468.             Dim sUrl As String
  469.             sUrl = url & "?"
  470.             If parm <> "" Then sUrl = sUrl & parm & "&"
  471.             If Not IsDbNull(notID.CurrentValue) Then
  472.                 sUrl = sUrl & "notID=" & notID.CurrentValue
  473.             Else
  474.                 Return "javascript:alert('Invalid Record! Key is null');"
  475.             End If
  476.             Return sUrl
  477.         End Function
  478.  
  479.         ' URL parm
  480.         Function UrlParm(parm As String) As String
  481.             Dim OutStr As String = ""
  482.             If UseTokenInUrl Then
  483.                 OutStr = "t=ltgFixtureNote"
  484.             End If
  485.             If parm <> "" Then
  486.                 If OutStr <> "" Then OutStr = OutStr & "&"
  487.                 OutStr = OutStr & parm
  488.             End If
  489.             Return OutStr
  490.         End Function
  491.  
  492.         ' Sort URL
  493.         Public Function SortUrl(ByRef fld As cField) As String
  494.             Dim OutStr As String = ""
  495.             If CurrentAction <> "" OrElse Export <> "" OrElse (fld.FldType = 201 OrElse fld.FldType = 203 OrElse fld.FldType = 205) Then
  496.                 OutStr = ""
  497.             Else
  498.                 OutStr = ew_CurrentPage()
  499.                 Dim sUrlParm As String
  500.                 sUrlParm = UrlParm("order=" & HttpContext.Current.Server.UrlEncode(fld.FldName) & "&ordertype=" & fld.ReverseSort)
  501.                 OutStr = OutStr & "?" & sUrlParm
  502.             End If
  503.             Return OutStr
  504.         End Function        
  505.  
  506.         ' Load rows based on filter
  507.         Public Function LoadRs(sFilter As String) As OleDbDataReader
  508.             Dim RsRows As OleDbDataReader
  509.  
  510.             ' Set up filter (SQL WHERE clause)
  511.             CurrentFilter = sFilter
  512.             Dim sSql As String = SQL()
  513.             Try
  514.                 RsRows = Conn.GetDataReader(sSql)
  515.                 If RsRows.HasRows Then
  516.                     Return RsRows
  517.                 Else
  518.                     RsRows.Close()
  519.                     RsRows.Dispose()
  520.                 End If
  521.             Catch
  522.             End Try
  523.             Return Nothing
  524.         End Function
  525.  
  526.         ' Load row values from recordset
  527.         Public Sub LoadListRowValues(ByRef RsRow As OleDbDataReader)            
  528.             notID.DbValue = RsRow("notID")
  529.             notFixID.DbValue = RsRow("notFixID")
  530.             notTypeID.DbValue = RsRow("notTypeID")
  531.             notDate.DbValue = RsRow("notDate")
  532.             notShortDesc.DbValue = RsRow("notShortDesc")
  533.             notNote.DbValue = RsRow("notNote")
  534.             notIsActive.DbValue = IIf(ew_ConvertToBool(RsRow("notIsActive")), "1", "0")
  535.             notLPRStatusID.DbValue = RsRow("notLPRStatusID")
  536.             notPriority.DbValue = RsRow("notPriority")
  537.             notCreatedBy.DbValue = RsRow("notCreatedBy")
  538.             notCreatedOn.DbValue = RsRow("notCreatedOn")
  539.             notModifiedBy.DbValue = RsRow("notModifiedBy")
  540.             notModifiedOn.DbValue = RsRow("notModifiedOn")
  541.         End Sub
  542.  
  543.         ' Render list row values
  544.         Public Sub RenderListRow()
  545.  
  546.             ' Row Rendering event
  547.             Row_Rendering()
  548.  
  549.             ' notFixID
  550.             notFixID.ViewValue = notFixID.CurrentValue
  551.             notFixID.CssStyle = ""
  552.             notFixID.CssClass = ""
  553.             notFixID.ViewCustomAttributes = ""
  554.  
  555.             ' notTypeID
  556.             notTypeID.ViewValue = notTypeID.CurrentValue
  557.             notTypeID.CssStyle = ""
  558.             notTypeID.CssClass = ""
  559.             notTypeID.ViewCustomAttributes = ""
  560.  
  561.             ' notDate
  562.             notDate.ViewValue = notDate.CurrentValue
  563.             notDate.ViewValue = ew_FormatDateTime(notDate.ViewValue, 6)
  564.             notDate.CssStyle = ""
  565.             notDate.CssClass = ""
  566.             notDate.ViewCustomAttributes = ""
  567.  
  568.             ' notShortDesc
  569.             notShortDesc.ViewValue = notShortDesc.CurrentValue
  570.             notShortDesc.CssStyle = ""
  571.             notShortDesc.CssClass = ""
  572.             notShortDesc.ViewCustomAttributes = ""
  573.  
  574.             ' notIsActive
  575.             If Convert.ToString(notIsActive.CurrentValue) = "1" Then
  576.                 notIsActive.ViewValue = "Yes"
  577.             Else
  578.                 notIsActive.ViewValue = "No"
  579.             End If
  580.             notIsActive.CssStyle = ""
  581.             notIsActive.CssClass = ""
  582.             notIsActive.ViewCustomAttributes = ""
  583.  
  584.             ' notLPRStatusID
  585.             notLPRStatusID.ViewValue = notLPRStatusID.CurrentValue
  586.             notLPRStatusID.CssStyle = ""
  587.             notLPRStatusID.CssClass = ""
  588.             notLPRStatusID.ViewCustomAttributes = ""
  589.  
  590.             ' notPriority
  591.             notPriority.ViewValue = notPriority.CurrentValue
  592.             notPriority.CssStyle = ""
  593.             notPriority.CssClass = ""
  594.             notPriority.ViewCustomAttributes = ""
  595.  
  596.             ' notFixID
  597.             notFixID.HrefValue = ""
  598.  
  599.             ' notTypeID
  600.             notTypeID.HrefValue = ""
  601.  
  602.             ' notDate
  603.             notDate.HrefValue = ""
  604.  
  605.             ' notShortDesc
  606.             notShortDesc.HrefValue = ""
  607.  
  608.             ' notIsActive
  609.             notIsActive.HrefValue = ""
  610.  
  611.             ' notLPRStatusID
  612.             notLPRStatusID.HrefValue = ""
  613.  
  614.             ' notPriority
  615.             notPriority.HrefValue = ""
  616.  
  617.             ' Row Rendered event
  618.             Row_Rendered()
  619.         End Sub
  620.  
  621.         Public CurrentAction As String ' Current action
  622.  
  623.         Public EventCancelled As Boolean ' Event cancelled
  624.  
  625.         Public CancelMessage As String ' Cancel message
  626.  
  627.         ' Row Type
  628.         Public RowType As Integer    
  629.  
  630.         Public CssClass As String = "" ' CSS class
  631.  
  632.         Public CssStyle As String = "" ' CSS style
  633.  
  634.         Public RowClientEvents As String = "" ' Row client events
  635.  
  636.         ' Row Attribute
  637.         Public ReadOnly Property RowAttributes() As String
  638.             Get
  639.                 Dim sAtt As String = ""
  640.                 If ew_NotEmpty(CssStyle) Then
  641.                     sAtt = sAtt & " style=""" & CssStyle.Trim() & """"
  642.                 End If
  643.                 If ew_NotEmpty(CssClass) Then
  644.                     sAtt = sAtt & " class=""" & CssClass.Trim() & """"
  645.                 End If
  646.                 If m_Export = "" Then
  647.                     If ew_NotEmpty(RowClientEvents) Then
  648.                         sAtt = sAtt & " " & RowClientEvents.Trim()
  649.                     End If
  650.                 End If
  651.                 Return sAtt
  652.             End Get
  653.         End Property
  654.  
  655.         ' Export
  656.         Private m_Export As String
  657.  
  658.         Public Property Export() As String
  659.             Get
  660.                 Return m_Export
  661.             End Get
  662.             Set(ByVal Value As String)
  663.                 m_Export = Value
  664.             End Set
  665.         End Property
  666.  
  667.         ' Export Original Value
  668.         Public ExportOriginalValue As Boolean = EW_EXPORT_ORIGINAL_VALUE
  669.  
  670.         ' Export All
  671.         Public ExportAll As Boolean = EW_EXPORT_ALL
  672.  
  673.         ' Send Email
  674.         Public SendEmail As Boolean
  675.  
  676.         ' Custom Inner Html
  677.         Public TableCustomInnerHtml As Object
  678.  
  679.         '
  680.         '  Field objects
  681.         '        
  682.         Public Function FieldByName(Name As String) As Object
  683.             If Name = "notID" Then Return notID
  684.             If Name = "notFixID" Then Return notFixID
  685.             If Name = "notTypeID" Then Return notTypeID
  686.             If Name = "notDate" Then Return notDate
  687.             If Name = "notShortDesc" Then Return notShortDesc
  688.             If Name = "notNote" Then Return notNote
  689.             If Name = "notIsActive" Then Return notIsActive
  690.             If Name = "notLPRStatusID" Then Return notLPRStatusID
  691.             If Name = "notPriority" Then Return notPriority
  692.             If Name = "notCreatedBy" Then Return notCreatedBy
  693.             If Name = "notCreatedOn" Then Return notCreatedOn
  694.             If Name = "notModifiedBy" Then Return notModifiedBy
  695.             If Name = "notModifiedOn" Then Return notModifiedOn
  696.             Return Nothing        
  697.         End Function
  698.  
  699.         ' notID
  700.         Private m_notID As cField
  701.  
  702.         Public ReadOnly Property notID() As cField
  703.             Get
  704.                 If m_notID Is Nothing Then m_notID = New cField("ltgFixtureNote", "x_notID", "notID", "[notID]", 3, OleDbType.Integer, EW_DATATYPE_NUMBER,  0)
  705.                 Return m_notID
  706.             End Get
  707.         End Property
  708.  
  709.         ' notFixID
  710.         Private m_notFixID As cField
  711.  
  712.         Public ReadOnly Property notFixID() As cField
  713.             Get
  714.                 If m_notFixID Is Nothing Then m_notFixID = New cField("ltgFixtureNote", "x_notFixID", "notFixID", "[notFixID]", 3, OleDbType.Integer, EW_DATATYPE_NUMBER,  0)
  715.                 Return m_notFixID
  716.             End Get
  717.         End Property
  718.  
  719.         ' notTypeID
  720.         Private m_notTypeID As cField
  721.  
  722.         Public ReadOnly Property notTypeID() As cField
  723.             Get
  724.                 If m_notTypeID Is Nothing Then m_notTypeID = New cField("ltgFixtureNote", "x_notTypeID", "notTypeID", "[notTypeID]", 3, OleDbType.Integer, EW_DATATYPE_NUMBER,  0)
  725.                 Return m_notTypeID
  726.             End Get
  727.         End Property
  728.  
  729.         ' notDate
  730.         Private m_notDate As cField
  731.  
  732.         Public ReadOnly Property notDate() As cField
  733.             Get
  734.                 If m_notDate Is Nothing Then m_notDate = New cField("ltgFixtureNote", "x_notDate", "notDate", "[notDate]", 135, OleDbType.DBTimeStamp, EW_DATATYPE_DATE,  6)
  735.                 Return m_notDate
  736.             End Get
  737.         End Property
  738.  
  739.         ' notShortDesc
  740.         Private m_notShortDesc As cField
  741.  
  742.         Public ReadOnly Property notShortDesc() As cField
  743.             Get
  744.                 If m_notShortDesc Is Nothing Then m_notShortDesc = New cField("ltgFixtureNote", "x_notShortDesc", "notShortDesc", "[notShortDesc]", 202, OleDbType.VarWChar, EW_DATATYPE_STRING,  0)
  745.                 Return m_notShortDesc
  746.             End Get
  747.         End Property
  748.  
  749.         ' notNote
  750.         Private m_notNote As cField
  751.  
  752.         Public ReadOnly Property notNote() As cField
  753.             Get
  754.                 If m_notNote Is Nothing Then m_notNote = New cField("ltgFixtureNote", "x_notNote", "notNote", "[notNote]", 203, OleDbType.LongVarWChar, EW_DATATYPE_MEMO,  0)
  755.                 Return m_notNote
  756.             End Get
  757.         End Property
  758.  
  759.         ' notIsActive
  760.         Private m_notIsActive As cField
  761.  
  762.         Public ReadOnly Property notIsActive() As cField
  763.             Get
  764.                 If m_notIsActive Is Nothing Then m_notIsActive = New cField("ltgFixtureNote", "x_notIsActive", "notIsActive", "[notIsActive]", 11, OleDbType.Boolean, EW_DATATYPE_BOOLEAN,  0)
  765.                 Return m_notIsActive
  766.             End Get
  767.         End Property
  768.  
  769.         ' notLPRStatusID
  770.         Private m_notLPRStatusID As cField
  771.  
  772.         Public ReadOnly Property notLPRStatusID() As cField
  773.             Get
  774.                 If m_notLPRStatusID Is Nothing Then m_notLPRStatusID = New cField("ltgFixtureNote", "x_notLPRStatusID", "notLPRStatusID", "[notLPRStatusID]", 3, OleDbType.Integer, EW_DATATYPE_NUMBER,  0)
  775.                 Return m_notLPRStatusID
  776.             End Get
  777.         End Property
  778.  
  779.         ' notPriority
  780.         Private m_notPriority As cField
  781.  
  782.         Public ReadOnly Property notPriority() As cField
  783.             Get
  784.                 If m_notPriority Is Nothing Then m_notPriority = New cField("ltgFixtureNote", "x_notPriority", "notPriority", "[notPriority]", 3, OleDbType.Integer, EW_DATATYPE_NUMBER,  0)
  785.                 Return m_notPriority
  786.             End Get
  787.         End Property
  788.  
  789.         ' notCreatedBy
  790.         Private m_notCreatedBy As cField
  791.  
  792.         Public ReadOnly Property notCreatedBy() As cField
  793.             Get
  794.                 If m_notCreatedBy Is Nothing Then m_notCreatedBy = New cField("ltgFixtureNote", "x_notCreatedBy", "notCreatedBy", "[notCreatedBy]", 202, OleDbType.VarWChar, EW_DATATYPE_STRING,  0)
  795.                 Return m_notCreatedBy
  796.             End Get
  797.         End Property
  798.  
  799.         ' notCreatedOn
  800.         Private m_notCreatedOn As cField
  801.  
  802.         Public ReadOnly Property notCreatedOn() As cField
  803.             Get
  804.                 If m_notCreatedOn Is Nothing Then m_notCreatedOn = New cField("ltgFixtureNote", "x_notCreatedOn", "notCreatedOn", "[notCreatedOn]", 135, OleDbType.DBTimeStamp, EW_DATATYPE_DATE,  6)
  805.                 Return m_notCreatedOn
  806.             End Get
  807.         End Property
  808.  
  809.         ' notModifiedBy
  810.         Private m_notModifiedBy As cField
  811.  
  812.         Public ReadOnly Property notModifiedBy() As cField
  813.             Get
  814.                 If m_notModifiedBy Is Nothing Then m_notModifiedBy = New cField("ltgFixtureNote", "x_notModifiedBy", "notModifiedBy", "[notModifiedBy]", 202, OleDbType.VarWChar, EW_DATATYPE_STRING,  0)
  815.                 Return m_notModifiedBy
  816.             End Get
  817.         End Property
  818.  
  819.         ' notModifiedOn
  820.         Private m_notModifiedOn As cField
  821.  
  822.         Public ReadOnly Property notModifiedOn() As cField
  823.             Get
  824.                 If m_notModifiedOn Is Nothing Then m_notModifiedOn = New cField("ltgFixtureNote", "x_notModifiedOn", "notModifiedOn", "[notModifiedOn]", 135, OleDbType.DBTimeStamp, EW_DATATYPE_DATE,  6)
  825.                 Return m_notModifiedOn
  826.             End Get
  827.         End Property
  828.  
  829.         ' Table level events
  830.         ' Recordset Selecting event
  831.         Public Sub Recordset_Selecting(ByRef filter As String) 
  832.  
  833.             ' Enter your code here    
  834.         End Sub
  835.  
  836.         ' Recordset Selected event
  837.         Public Sub Recordset_Selected(rs As DbDataReader)
  838.  
  839.             'HttpContext.Current.Response.Write("Recordset Selected")
  840.         End Sub
  841.  
  842.         ' Recordset Searching event
  843.         Public Sub Recordset_Searching(ByRef filter As String)
  844.  
  845.             ' Enter your code here
  846.         End Sub
  847.  
  848.         ' Row_Selecting event
  849.         Public Sub Row_Selecting(ByRef filter As String)
  850.  
  851.             ' Enter your code here    
  852.         End Sub
  853.  
  854.         ' Row Selected event
  855.         Public Sub Row_Selected(rs As DbDataReader)
  856.  
  857.             'HttpContext.Current.Response.Write("Row Selected")
  858.         End Sub
  859.  
  860.         ' Row Rendering event
  861.         Public Sub Row_Rendering()
  862.  
  863.             ' Enter your code here    
  864.         End Sub
  865.  
  866.         ' Row Rendered event
  867.         Public Sub Row_Rendered()
  868.  
  869.             ' To view properties of field class, use:
  870.             ' HttpContext.Current.Response.Write(<FieldName>.AsString())
  871.  
  872.         End Sub
  873.  
  874.         ' Row Inserting event
  875.         Public Function Row_Inserting(ByRef rs As OrderedDictionary) As Boolean
  876.  
  877.             ' Enter your code here
  878.             ' To cancel, set return value to False and error message to CancelMessage
  879.  
  880.             Return True
  881.         End Function
  882.  
  883.         ' Row Inserted event
  884.         Public Sub Row_Inserted(rs As OrderedDictionary)
  885.  
  886.             'HttpContext.Current.Response.Write("Row Inserted")
  887.         End Sub
  888.  
  889.         ' Row Updating event
  890.         Public Function Row_Updating(rsold As OrderedDictionary, ByRef rsnew As OrderedDictionary) As Boolean
  891.  
  892.             ' Enter your code here
  893.             ' To cancel, set return value to False and error message to CancelMessage
  894.  
  895.             Return True
  896.         End Function
  897.  
  898.         ' Row Updated event
  899.         Public Sub Row_Updated(rsold As OrderedDictionary, rsnew As OrderedDictionary)
  900.  
  901.             'HttpContext.Current.Response.Write("Row Updated")
  902.         End Sub
  903.  
  904.         ' Recordset Deleting event
  905.         Public Function Row_Deleting(rs As OrderedDictionary) As Boolean
  906.  
  907.             ' Enter your code here
  908.             ' To cancel, set return value to False and error message to CancelMessage
  909.  
  910.             Return True
  911.         End Function
  912.  
  913.         ' Recordset Deleted event
  914.         Public Sub Row_Deleted(rs As OrderedDictionary)
  915.  
  916.             'HttpContext.Current.Response.Write("Row Deleted")
  917.         End Sub
  918.  
  919.         ' Email Sending event
  920.         Public Function Email_Sending(ByRef Email As cEmail, Args As Hashtable) As Boolean
  921.  
  922.             'HttpContext.Current.Response.Write(Email.AsString())
  923.             'HttpContext.Current.Response.End()
  924.  
  925.             Return True
  926.         End Function
  927.  
  928.         ' Class terminate
  929.         Public Sub Dispose() Implements IDisposable.Dispose
  930.             If m_notID IsNot Nothing Then m_notID.Dispose()
  931.             If m_notFixID IsNot Nothing Then m_notFixID.Dispose()
  932.             If m_notTypeID IsNot Nothing Then m_notTypeID.Dispose()
  933.             If m_notDate IsNot Nothing Then m_notDate.Dispose()
  934.             If m_notShortDesc IsNot Nothing Then m_notShortDesc.Dispose()
  935.             If m_notNote IsNot Nothing Then m_notNote.Dispose()
  936.             If m_notIsActive IsNot Nothing Then m_notIsActive.Dispose()
  937.             If m_notLPRStatusID IsNot Nothing Then m_notLPRStatusID.Dispose()
  938.             If m_notPriority IsNot Nothing Then m_notPriority.Dispose()
  939.             If m_notCreatedBy IsNot Nothing Then m_notCreatedBy.Dispose()
  940.             If m_notCreatedOn IsNot Nothing Then m_notCreatedOn.Dispose()
  941.             If m_notModifiedBy IsNot Nothing Then m_notModifiedBy.Dispose()
  942.             If m_notModifiedOn IsNot Nothing Then m_notModifiedOn.Dispose()
  943.         End Sub
  944.     End Class
  945. End Class
  946.