home *** CD-ROM | disk | FTP | other *** search
/ 66.142.0.142 / 66.142.0.142.tar / 66.142.0.142 / ltgFixtureLocationlist.aspx.vb < prev    next >
Text File  |  2014-01-25  |  19KB  |  715 lines

  1. Imports System.Data
  2. Imports System.Data.Common
  3. Imports System.Xml
  4. Imports System.IO
  5. Imports System.Data.OleDb
  6.  
  7. '
  8. ' ASP.NET code-behind class (Page)
  9. '
  10.  
  11. Partial Class ltgFixtureLocationlist
  12.     Inherits AspNetMaker7_tfpssnet
  13.  
  14.     ' Page object
  15.     Public ltgFixtureLocation_list As cltgFixtureLocation_list
  16.  
  17.     '
  18.     ' Page Class
  19.     '
  20.     Class cltgFixtureLocation_list
  21.         Inherits AspNetMakerPage
  22.         Implements IDisposable        
  23.  
  24.         ' Used by system generated functions
  25.         Private RsWrk As Object, sSqlWrk As String, sWhereWrk As String
  26.  
  27.         Private arwrk As Object
  28.  
  29.         Private armultiwrk() As String        
  30.  
  31.         ' Page URL
  32.         Public ReadOnly Property PageUrl() As String
  33.             Get
  34.                 Dim Url As String = ew_CurrentPage() & "?"
  35.                 If ltgFixtureLocation.UseTokenInUrl Then Url = Url & "t=" & ltgFixtureLocation.TableVar & "&" ' Add page token
  36.                 Return Url    
  37.             End Get
  38.         End Property
  39.  
  40.         ' Validate page request
  41.         Public Function IsPageRequest() As Boolean
  42.             Dim Result As Boolean
  43.             If ltgFixtureLocation.UseTokenInUrl Then
  44.                 Result = False
  45.                 If ObjForm IsNot Nothing Then
  46.                     Result = (ltgFixtureLocation.TableVar = ObjForm.GetValue("t"))
  47.                 End If
  48.                 If ew_Get("t") <> "" Then
  49.                     Result = (ltgFixtureLocation.TableVar = ew_Get("t"))
  50.                 End If
  51.                 Return Result
  52.             End If
  53.             Return True            
  54.         End Function    
  55.  
  56.         ' ltgFixtureLocation
  57.         Public Property ltgFixtureLocation() As cltgFixtureLocation
  58.             Get                
  59.                 Return ParentPage.ltgFixtureLocation
  60.             End Get
  61.             Set(ByVal v As cltgFixtureLocation)
  62.                 ParentPage.ltgFixtureLocation = v    
  63.             End Set    
  64.         End Property
  65.  
  66.         ' ltgFixtureLocation
  67.         Public Property tblEmployees() As ctblEmployees
  68.             Get                
  69.                 Return ParentPage.tblEmployees
  70.             End Get
  71.             Set(ByVal v As ctblEmployees)
  72.                 ParentPage.tblEmployees = v    
  73.             End Set    
  74.         End Property
  75.  
  76.         '
  77.         '  Constructor
  78.         '  - init objects
  79.         '  - open connection
  80.         '
  81.         Public Sub New(ByRef APage As AspNetMaker7_tfpssnet)                
  82.             m_ParentPage = APage
  83.             m_Page = Me    
  84.             m_PageID = "list"
  85.             m_PageObjName = "ltgFixtureLocation_list"
  86.             m_PageObjTypeName = "cltgFixtureLocation_list"
  87.  
  88.             ' Table Name
  89.             m_TableName = "ltgFixtureLocation"
  90.  
  91.             ' Initialize table object
  92.             ltgFixtureLocation = New cltgFixtureLocation(Me)
  93.             tblEmployees = New ctblEmployees(Me)
  94.  
  95.             ' Connect to database
  96.             Conn = New cConnection()
  97.  
  98.             ' Initialize list options
  99.             ListOptions = New cListOptions
  100.         End Sub
  101.  
  102.         '
  103.         '  Subroutine Page_Init
  104.         '  - called before page main
  105.         '  - check Security
  106.         '  - set up response header
  107.         '  - call page load events
  108.         '
  109.         Public Sub Page_Init()
  110.             Security = New cAdvancedSecurity(Me)
  111.             If Not Security.IsLoggedIn() Then Security.AutoLogin()
  112.             If Not Security.IsLoggedIn() Then
  113.                 Security.SaveLastUrl()
  114.                 Page_Terminate("login.aspx")
  115.             End If
  116.  
  117.             ' Table Permission loading event
  118.             Security.TablePermission_Loading()
  119.             Security.LoadCurrentUserLevel(TableName)
  120.  
  121.             ' Table Permission loaded event
  122.             Security.TablePermission_Loaded()
  123.             If Not Security.CanList Then
  124.                 Security.SaveLastUrl()
  125.                 Page_Terminate("login.aspx")
  126.             End If
  127.  
  128.             ' User ID loading event
  129.             Security.UserID_Loading()
  130.             If Security.IsLoggedIn() Then Call Security.LoadUserID()
  131.  
  132.             ' User ID loaded event
  133.             Security.UserID_Loaded()
  134.             ltgFixtureLocation.Export = ew_Get("export") ' Get export parameter
  135.             ParentPage.gsExport = ltgFixtureLocation.Export ' Get export parameter, used in header
  136.             ParentPage.gsExportFile = ltgFixtureLocation.TableVar ' Get export file, used in header
  137.  
  138.             ' Global page loading event (in ewglobal*.vb)
  139.             ParentPage.Page_Loading()
  140.  
  141.             ' Page load event, used in current page
  142.             Page_Load()
  143.         End Sub
  144.  
  145.         '
  146.         '  Class terminate
  147.         '  - clean up page object
  148.         '
  149.         Public Sub Dispose() Implements IDisposable.Dispose
  150.             Page_Terminate("")
  151.         End Sub
  152.  
  153.         '
  154.         '  Sub Page_Terminate
  155.         '  - called when exit page
  156.         '  - clean up connection and objects
  157.         '  - if URL specified, redirect to URL
  158.         '
  159.         Sub Page_Terminate(url As String)
  160.  
  161.             ' Page unload event, used in current page
  162.             Page_Unload()
  163.  
  164.             ' Global page unloaded event (in ewglobal*.vb)
  165.             ParentPage.Page_Unloaded()
  166.  
  167.             ' Close connection
  168.             Conn.Dispose()
  169.             Security = Nothing
  170.             ltgFixtureLocation.Dispose()
  171.             tblEmployees.Dispose()
  172.             ListOptions = Nothing
  173.  
  174.             ' Go to URL if specified
  175.             If url <> "" Then
  176.                 HttpContext.Current.Response.Clear()
  177.                 HttpContext.Current.Response.Redirect(url)
  178.             End If
  179.         End Sub
  180.  
  181.     Public lDisplayRecs As Integer ' Number of display records
  182.  
  183.     Public lStartRec As Integer, lStopRec As Integer, lTotalRecs As Integer, lRecRange As Integer
  184.  
  185.     Public sSrchWhere As String
  186.  
  187.     Public lRecCnt As Integer
  188.  
  189.     Public lEditRowCnt As Integer
  190.  
  191.     Public lRowCnt As Integer, lRowIndex As Integer
  192.  
  193.     Public lOptionCnt As Integer
  194.  
  195.     Public lRecPerRow As Integer, lColCnt As Integer
  196.  
  197.     Public sDeleteConfirmMsg As String ' Delete confirm message
  198.  
  199.     Public sDbMasterFilter As String, sDbDetailFilter As String
  200.  
  201.     Public bMasterRecordExists As Boolean
  202.  
  203.     Public ListOptions As Object
  204.  
  205.     Public sMultiSelectKey As String
  206.  
  207.     Public x_ewPriv As Integer
  208.  
  209.     '
  210.     ' Page main processing
  211.     '
  212.     Public Sub Page_Main()
  213.         lDisplayRecs = 20
  214.         lRecRange = EW_PAGER_RANGE
  215.         lRecCnt = 0 ' Record count
  216.  
  217.         ' Search filters        
  218.         Dim sSrchAdvanced As String = "" ' Advanced search filter
  219.         Dim sSrchBasic As String = "" ' Basic search filter
  220.         Dim sFilter As String = ""
  221.         sSrchWhere = "" ' Search WHERE clause        
  222.  
  223.         ' Master/Detail
  224.         sDbMasterFilter = "" ' Master filter
  225.         sDbDetailFilter = "" ' Detail filter
  226.         If IsPageRequest Then ' Validate request
  227.  
  228.             ' Set up records per page dynamically
  229.             SetUpDisplayRecs()
  230.  
  231.             ' Handle reset command
  232.             ResetCmd()
  233.  
  234.             ' Get basic search criteria
  235.             If ParentPage.gsSearchError = "" Then
  236.                 sSrchBasic = BasicSearchWhere()
  237.             End If
  238.  
  239.             ' Set Up Sorting Order
  240.             SetUpSortOrder()
  241.         End If
  242.  
  243.         ' Restore display records
  244.         If (ltgFixtureLocation.RecordsPerPage = -1 OrElse ltgFixtureLocation.RecordsPerPage > 0) Then
  245.             lDisplayRecs = ltgFixtureLocation.RecordsPerPage ' Restore from Session
  246.         Else
  247.             lDisplayRecs = 20 ' Load default
  248.         End If
  249.  
  250.         ' Load Sorting Order
  251.         LoadSortOrder()
  252.  
  253.         ' Build search criteria
  254.         If sSrchAdvanced <> "" Then
  255.             If sSrchWhere <> "" Then
  256.                 sSrchWhere = "(" & sSrchWhere & ") AND (" & sSrchAdvanced & ")"
  257.             Else
  258.                 sSrchWhere = sSrchAdvanced
  259.             End If
  260.         End If
  261.         If sSrchBasic <> "" Then
  262.             If sSrchWhere <> "" Then
  263.                 sSrchWhere = "(" & sSrchWhere & ") AND (" & sSrchBasic & ")"
  264.             Else
  265.                 sSrchWhere = sSrchBasic
  266.             End If
  267.         End If
  268.  
  269.         ' Recordset Searching event
  270.         ltgFixtureLocation.Recordset_Searching(sSrchWhere)
  271.  
  272.         ' Save search criteria
  273.         If sSrchWhere <> "" Then
  274.             If sSrchBasic = "" Then ResetBasicSearchParms()
  275.             ltgFixtureLocation.SearchWhere = sSrchWhere ' Save to Session
  276.             lStartRec = 1 ' Reset start record counter
  277.             ltgFixtureLocation.StartRecordNumber = lStartRec
  278.         Else
  279.             RestoreSearchParms()
  280.         End If
  281.  
  282.         ' Build filter
  283.         sFilter = ""
  284.         If Not Security.CanList Then
  285.             sFilter = "(0=1)" ' Filter all records
  286.         End If
  287.         If sDbDetailFilter <> "" Then
  288.             If sFilter <> "" Then
  289.                 sFilter = "(" & sFilter & ") AND (" & sDbDetailFilter & ")"
  290.             Else
  291.                 sFilter = sDbDetailFilter
  292.             End If
  293.         End If
  294.         If sSrchWhere <> "" Then
  295.             If sFilter <> "" Then
  296.                 sFilter = "(" & sFilter & ") AND (" & sSrchWhere & ")"
  297.             Else
  298.                 sFilter = sSrchWhere
  299.             End If
  300.         End If
  301.  
  302.         ' Set up filter in Session
  303.         ltgFixtureLocation.SessionWhere = sFilter
  304.         ltgFixtureLocation.CurrentFilter = ""
  305.     End Sub
  306.  
  307.     '
  308.     ' Set up number of records displayed per page
  309.     '
  310.     Sub SetUpDisplayRecs()
  311.         Dim sWrk As String
  312.         sWrk = ew_Get(EW_TABLE_REC_PER_PAGE)
  313.         If sWrk <> "" Then
  314.             If IsNumeric(sWrk) Then
  315.                 lDisplayRecs = ew_ConvertToInt(sWrk)
  316.             Else
  317.                 If ew_SameText(sWrk, "all") Then ' Display all records
  318.                     lDisplayRecs = -1
  319.                 Else
  320.                     lDisplayRecs = 20 ' Non-numeric, load default
  321.                 End If
  322.             End If
  323.             ltgFixtureLocation.RecordsPerPage = lDisplayRecs ' Save to Session
  324.  
  325.             ' Reset start position
  326.             lStartRec = 1
  327.             ltgFixtureLocation.StartRecordNumber = lStartRec
  328.         End If
  329.     End Sub
  330.  
  331.     '
  332.     ' Return Basic Search SQL
  333.     '
  334.     Function BasicSearchSQL(Keyword As String) As String
  335.         Dim sKeyword As String, sSql As String = ""
  336.         sKeyword = ew_AdjustSql(Keyword)        
  337.         sSql = sSql & "[floDescription] LIKE '%" & sKeyword & "%' OR "
  338.         If sSql.EndsWith(" OR ") Then sSql = sSql.SubString(0, sSql.Length-4)
  339.         Return sSql
  340.     End Function
  341.  
  342.     '
  343.     ' Return Basic Search WHERE based on search keyword and type
  344.     '
  345.     Function BasicSearchWhere() As String
  346.         Dim sSearchStr As String = "", sSearchKeyword As String, sSearchType As String
  347.         Dim sSearch As String, arKeyword() As String, sKeyword As String
  348.         If Not Security.CanSearch Then Return ""
  349.         sSearchKeyword = ew_Get(EW_TABLE_BASIC_SEARCH)
  350.         sSearchType = ew_Get(EW_TABLE_BASIC_SEARCH_TYPE)
  351.         If sSearchKeyword <> "" Then
  352.             sSearch = sSearchKeyword.Trim()
  353.             If sSearchType <> "" Then
  354.                 While InStr(sSearch, "  ") > 0
  355.                     sSearch = sSearch.Replace("  ", " ")
  356.                 End While
  357.                 arKeyword = sSearch.Trim().Split(New Char() {" "c})
  358.                 For Each sKeyword In arKeyword
  359.                     If sSearchStr <> "" Then sSearchStr = sSearchStr & " " & sSearchType & " "
  360.                     sSearchStr = sSearchStr & "(" & BasicSearchSQL(sKeyword) & ")"
  361.                 Next
  362.             Else
  363.                 sSearchStr = BasicSearchSQL(sSearch)
  364.             End If
  365.         End If
  366.         If sSearchKeyword <> "" then
  367.             ltgFixtureLocation.BasicSearchKeyword = sSearchKeyword
  368.             ltgFixtureLocation.BasicSearchType = sSearchType
  369.         End If
  370.         Return sSearchStr
  371.     End Function
  372.  
  373.     '
  374.     ' Clear all search parameters
  375.     '
  376.     Sub ResetSearchParms()
  377.  
  378.         ' Clear search where
  379.         sSrchWhere = ""
  380.         ltgFixtureLocation.SearchWhere = sSrchWhere
  381.  
  382.         ' Clear basic search parameters
  383.         ResetBasicSearchParms()
  384.     End Sub
  385.  
  386.     '
  387.     ' Clear all basic search parameters
  388.     '
  389.     Sub ResetBasicSearchParms()
  390.  
  391.         ' Clear basic search parameters
  392.         ltgFixtureLocation.BasicSearchKeyword = ""
  393.         ltgFixtureLocation.BasicSearchType = ""
  394.     End Sub
  395.  
  396.     '
  397.     ' Restore all search parameters
  398.     '
  399.     Sub RestoreSearchParms()
  400.         sSrchWhere = ltgFixtureLocation.SearchWhere
  401.     End Sub
  402.  
  403.     '
  404.     ' Set up Sort parameters based on Sort Links clicked
  405.     '
  406.     Sub SetUpSortOrder()
  407.         Dim sOrderBy As String
  408.         Dim sSortField As String, sLastSort As String, sThisSort As String
  409.         Dim bCtrl As Boolean
  410.  
  411.         ' Check for Ctrl pressed
  412.         bCtrl = (ew_Get("ctrl") <> "")
  413.  
  414.         ' Check for an Order parameter
  415.         If ew_Get("order") <> "" Then
  416.             ltgFixtureLocation.CurrentOrder = ew_Get("order")
  417.             ltgFixtureLocation.CurrentOrderType = ew_Get("ordertype")
  418.             ltgFixtureLocation.UpdateSort(ltgFixtureLocation.floDescription, bCtrl) ' floDescription
  419.             ltgFixtureLocation.UpdateSort(ltgFixtureLocation.floIsActive, bCtrl) ' floIsActive
  420.             ltgFixtureLocation.StartRecordNumber = 1 ' Reset start position
  421.         End If
  422.     End Sub
  423.  
  424.     '
  425.     ' Load Sort Order parameters
  426.     '
  427.     Sub LoadSortOrder()
  428.         Dim sOrderBy As String
  429.         sOrderBy = ltgFixtureLocation.SessionOrderBy ' Get order by from Session
  430.         If sOrderBy = "" Then
  431.             If ltgFixtureLocation.SqlOrderBy <> "" Then
  432.                 sOrderBy = ltgFixtureLocation.SqlOrderBy
  433.                 ltgFixtureLocation.SessionOrderBy = sOrderBy
  434.             End If
  435.         End If
  436.     End Sub
  437.  
  438.     '
  439.     ' Reset command based on querystring parameter "cmd"
  440.     ' - reset: reset search parameters
  441.     ' - resetall: reset search and master/detail parameters
  442.     ' - resetsort: reset sort parameters
  443.     '
  444.     Sub ResetCmd()
  445.         Dim sCmd As String
  446.  
  447.         ' Get reset cmd
  448.         If ew_Get("cmd") <> "" Then
  449.             sCmd = ew_Get("cmd")
  450.  
  451.             ' Reset search criteria
  452.             If ew_SameText(sCmd, "reset") OrElse ew_SameText(sCmd, "resetall") Then
  453.                 ResetSearchParms()
  454.             End If
  455.  
  456.             ' Reset sort criteria
  457.             If ew_SameText(sCmd, "resetsort") Then
  458.                 Dim sOrderBy As String = ""
  459.                 ltgFixtureLocation.SessionOrderBy = sOrderBy
  460.                 ltgFixtureLocation.floDescription.Sort = ""
  461.                 ltgFixtureLocation.floIsActive.Sort = ""
  462.             End If
  463.  
  464.             ' Reset start position
  465.             lStartRec = 1
  466.             ltgFixtureLocation.StartRecordNumber = lStartRec
  467.         End If
  468.     End Sub
  469.  
  470.     Public Pager As Object
  471.  
  472.     '
  473.     ' Set up Starting Record parameters
  474.     '
  475.     Sub SetUpStartRec()
  476.         Dim nPageNo As Integer
  477.  
  478.         ' Exit if lDisplayRecs = 0
  479.         If lDisplayRecs = 0 Then Exit Sub
  480.         If IsPageRequest Then ' Validate request
  481.  
  482.             ' Check for a "start" parameter
  483.             If ew_Get(EW_TABLE_START_REC) <> "" AndAlso IsNumeric(ew_Get(EW_TABLE_START_REC)) Then
  484.                 lStartRec = ew_ConvertToInt(ew_Get(EW_TABLE_START_REC))
  485.                 ltgFixtureLocation.StartRecordNumber = lStartRec
  486.             ElseIf ew_Get(EW_TABLE_PAGE_NO) <> "" AndAlso IsNumeric(ew_Get(EW_TABLE_PAGE_NO)) Then
  487.                 nPageNo = ew_ConvertToInt(ew_Get(EW_TABLE_PAGE_NO))
  488.                 lStartRec = (nPageNo-1)*lDisplayRecs+1
  489.                 If lStartRec <= 0 Then
  490.                     lStartRec = 1
  491.                 ElseIf lStartRec >= ((lTotalRecs-1)\lDisplayRecs)*lDisplayRecs+1 Then
  492.                     lStartRec = ((lTotalRecs-1)\lDisplayRecs)*lDisplayRecs+1
  493.                 End If
  494.                 ltgFixtureLocation.StartRecordNumber = lStartRec
  495.             End If
  496.         End If
  497.         lStartRec = ltgFixtureLocation.StartRecordNumber
  498.  
  499.         ' Check if correct start record counter
  500.         If lStartRec <= 0 Then ' Avoid invalid start record counter
  501.             lStartRec = 1 ' Reset start record counter
  502.             ltgFixtureLocation.StartRecordNumber = lStartRec
  503.         ElseIf lStartRec > lTotalRecs Then ' Avoid starting record > total records
  504.             lStartRec = ((lTotalRecs-1)\lDisplayRecs)*lDisplayRecs+1 ' Point to last page first record
  505.             ltgFixtureLocation.StartRecordNumber = lStartRec
  506.         ElseIf (lStartRec-1) Mod lDisplayRecs <> 0 Then
  507.             lStartRec = ((lStartRec-1)\lDisplayRecs)*lDisplayRecs+1 ' Point to page boundary
  508.             ltgFixtureLocation.StartRecordNumber = lStartRec
  509.         End If
  510.     End Sub
  511.  
  512.     '
  513.     ' Load default values
  514.     '
  515.     Sub LoadDefaultValues()
  516.         ltgFixtureLocation.floIsActive.CurrentValue = 1
  517.     End Sub
  518.  
  519.     '
  520.     ' Load recordset
  521.     '
  522.     Function LoadRecordset() As OleDbDataReader
  523.  
  524.         ' Recordset Selecting event
  525.         ltgFixtureLocation.Recordset_Selecting(ltgFixtureLocation.CurrentFilter)
  526.  
  527.         ' Load list page SQL
  528.         Dim sSql As String = ltgFixtureLocation.ListSQL
  529.  
  530.         ' Write SQL for debug
  531.         If EW_DEBUG_ENABLED Then ew_Write(sSql)
  532.  
  533.         ' Count
  534.         lTotalRecs = -1        
  535.         Try            
  536.             If sSql.StartsWith("SELECT * FROM ", StringComparison.InvariantCultureIgnoreCase) AndAlso _                
  537.                 ew_Empty(ltgFixtureLocation.SqlGroupBy) AndAlso _
  538.                 ew_Empty(ltgFixtureLocation.SqlHaving) Then
  539.                 Dim sCntSql As String = ltgFixtureLocation.SelectCountSQL
  540.  
  541.                 ' Write SQL for debug
  542.                 If EW_DEBUG_ENABLED Then ew_Write("<br>" & sCntSql)
  543.                 lTotalRecs = Conn.ExecuteScalar(sCntSql)
  544.             End If            
  545.         Catch
  546.         End Try
  547.  
  548.         ' Load recordset
  549.         Dim Rs As OleDbDataReader = Conn.GetDataReader(sSql)
  550.         If lTotalRecs < 0 AndAlso Rs.HasRows Then
  551.             lTotalRecs = 0
  552.             While Rs.Read()
  553.                 lTotalRecs = lTotalRecs + 1
  554.             End While
  555.             Rs.Close()        
  556.             Rs = Conn.GetDataReader(sSql)
  557.         End If
  558.  
  559.         ' Recordset Selected event
  560.         ltgFixtureLocation.Recordset_Selected(Rs)
  561.         Return Rs
  562.     End Function
  563.  
  564.     '
  565.     ' Load row based on key values
  566.     '
  567.     Function LoadRow() As Boolean
  568.         Dim RsRow As OleDbDataReader
  569.         Dim sFilter As String = ltgFixtureLocation.KeyFilter
  570.  
  571.         ' Row Selecting event
  572.         ltgFixtureLocation.Row_Selecting(sFilter)
  573.  
  574.         ' Load SQL based on filter
  575.         ltgFixtureLocation.CurrentFilter = sFilter
  576.         Dim sSql As String = ltgFixtureLocation.SQL
  577.  
  578.         ' Write SQL for debug
  579.         If EW_DEBUG_ENABLED Then ew_Write(sSql)
  580.         Try
  581.             RsRow = Conn.GetTempDataReader(sSql)    
  582.             If Not RsRow.Read() Then
  583.                 Return False
  584.             Else                
  585.                 LoadRowValues(RsRow) ' Load row values
  586.  
  587.                 ' Row Selected event
  588.                 ltgFixtureLocation.Row_Selected(RsRow)
  589.                 Return True    
  590.             End If
  591.         Catch
  592.             If EW_DEBUG_ENABLED Then Throw
  593.             Return False
  594.         Finally
  595.             Conn.CloseTempDataReader()
  596.         End Try
  597.     End Function
  598.  
  599.     '
  600.     ' Load row values from recordset
  601.     '
  602.     Sub LoadRowValues(ByRef RsRow As OleDbDataReader)
  603.         ltgFixtureLocation.floID.DbValue = RsRow("floID")
  604.         ltgFixtureLocation.floDescription.DbValue = RsRow("floDescription")
  605.         ltgFixtureLocation.floIsActive.DbValue = IIf(ew_ConvertToBool(RsRow("floIsActive")), "1", "0")
  606.     End Sub
  607.  
  608.     '
  609.     ' Render row values based on field settings
  610.     '
  611.     Sub RenderRow()
  612.  
  613.         ' Row Rendering event
  614.         ltgFixtureLocation.Row_Rendering()
  615.  
  616.         '
  617.         '  Common render codes for all row types
  618.         '
  619.         ' floDescription
  620.  
  621.         ltgFixtureLocation.floDescription.CellCssStyle = ""
  622.         ltgFixtureLocation.floDescription.CellCssClass = ""
  623.  
  624.         ' floIsActive
  625.         ltgFixtureLocation.floIsActive.CellCssStyle = ""
  626.         ltgFixtureLocation.floIsActive.CellCssClass = ""
  627.  
  628.         '
  629.         '  View  Row
  630.         '
  631.  
  632.         If ltgFixtureLocation.RowType = EW_ROWTYPE_VIEW Then ' View row
  633.  
  634.             ' floID
  635.             ltgFixtureLocation.floID.ViewValue = ltgFixtureLocation.floID.CurrentValue
  636.             ltgFixtureLocation.floID.CssStyle = ""
  637.             ltgFixtureLocation.floID.CssClass = ""
  638.             ltgFixtureLocation.floID.ViewCustomAttributes = ""
  639.  
  640.             ' floDescription
  641.             ltgFixtureLocation.floDescription.ViewValue = ltgFixtureLocation.floDescription.CurrentValue
  642.             ltgFixtureLocation.floDescription.CssStyle = ""
  643.             ltgFixtureLocation.floDescription.CssClass = ""
  644.             ltgFixtureLocation.floDescription.ViewCustomAttributes = ""
  645.  
  646.             ' floIsActive
  647.             If Convert.ToString(ltgFixtureLocation.floIsActive.CurrentValue) = "1" Then
  648.                 ltgFixtureLocation.floIsActive.ViewValue = "Yes"
  649.             Else
  650.                 ltgFixtureLocation.floIsActive.ViewValue = "No"
  651.             End If
  652.             ltgFixtureLocation.floIsActive.CssStyle = ""
  653.             ltgFixtureLocation.floIsActive.CssClass = ""
  654.             ltgFixtureLocation.floIsActive.ViewCustomAttributes = ""
  655.  
  656.             ' View refer script
  657.             ' floDescription
  658.  
  659.             ltgFixtureLocation.floDescription.HrefValue = ""
  660.  
  661.             ' floIsActive
  662.             ltgFixtureLocation.floIsActive.HrefValue = ""
  663.         End If
  664.  
  665.         ' Row Rendered event
  666.         ltgFixtureLocation.Row_Rendered()
  667.     End Sub
  668.  
  669.         ' Page Load event
  670.         Public Sub Page_Load()
  671.  
  672.             'HttpContext.Current.Response.Write("Page Load")
  673.         End Sub
  674.  
  675.         ' Page Unload event
  676.         Public Sub Page_Unload()
  677.  
  678.             'HttpContext.Current.Response.Write("Page Unload")
  679.         End Sub
  680.  
  681.     ' Form Custom Validate event
  682.     Public Function Form_CustomValidate(ByRef CustomError As String) As Boolean
  683.  
  684.         'Return error message in CustomError
  685.         Return True
  686.     End Function
  687.     End Class
  688.  
  689.     '
  690.     ' ASP.NET Page_Load event
  691.     '
  692.  
  693.     Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
  694.         Response.Buffer = EW_RESPONSE_BUFFER
  695.         Response.Cache.SetCacheability(HttpCacheability.NoCache)
  696.  
  697.         ' Page init
  698.         ltgFixtureLocation_list = New cltgFixtureLocation_list(Me)        
  699.         ltgFixtureLocation_list.Page_Init()
  700.  
  701.         ' Page main processing
  702.         ltgFixtureLocation_list.Page_Main()
  703.     End Sub
  704.  
  705.     '
  706.     ' ASP.NET Page_Unload event
  707.     '
  708.  
  709.     Protected Sub Page_Unload(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Unload
  710.  
  711.         ' Dispose page object
  712.         If ltgFixtureLocation_list IsNot Nothing Then ltgFixtureLocation_list.Dispose()
  713.     End Sub
  714. End Class
  715.