home *** CD-ROM | disk | FTP | other *** search
/ 66.142.0.142 / 66.142.0.142.tar / 66.142.0.142 / tblEmployeeStatuslist.aspx.vb < prev    next >
Text File  |  2010-08-24  |  18KB  |  694 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 tblEmployeeStatuslist
  12.     Inherits AspNetMaker7_tfpssnet
  13.  
  14.     ' Page object
  15.     Public tblEmployeeStatus_list As ctblEmployeeStatus_list
  16.  
  17.     '
  18.     ' Page Class
  19.     '
  20.     Class ctblEmployeeStatus_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 tblEmployeeStatus.UseTokenInUrl Then Url = Url & "t=" & tblEmployeeStatus.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 tblEmployeeStatus.UseTokenInUrl Then
  44.                 Result = False
  45.                 If ObjForm IsNot Nothing Then
  46.                     Result = (tblEmployeeStatus.TableVar = ObjForm.GetValue("t"))
  47.                 End If
  48.                 If ew_Get("t") <> "" Then
  49.                     Result = (tblEmployeeStatus.TableVar = ew_Get("t"))
  50.                 End If
  51.                 Return Result
  52.             End If
  53.             Return True            
  54.         End Function    
  55.  
  56.         ' tblEmployeeStatus
  57.         Public Property tblEmployeeStatus() As ctblEmployeeStatus
  58.             Get                
  59.                 Return ParentPage.tblEmployeeStatus
  60.             End Get
  61.             Set(ByVal v As ctblEmployeeStatus)
  62.                 ParentPage.tblEmployeeStatus = v    
  63.             End Set    
  64.         End Property
  65.  
  66.         ' tblEmployeeStatus
  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 = "tblEmployeeStatus_list"
  86.             m_PageObjTypeName = "ctblEmployeeStatus_list"
  87.  
  88.             ' Table Name
  89.             m_TableName = "tblEmployeeStatus"
  90.  
  91.             ' Initialize table object
  92.             tblEmployeeStatus = New ctblEmployeeStatus(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.             tblEmployeeStatus.Export = ew_Get("export") ' Get export parameter
  135.             ParentPage.gsExport = tblEmployeeStatus.Export ' Get export parameter, used in header
  136.             ParentPage.gsExportFile = tblEmployeeStatus.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.             tblEmployeeStatus.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 (tblEmployeeStatus.RecordsPerPage = -1 OrElse tblEmployeeStatus.RecordsPerPage > 0) Then
  245.             lDisplayRecs = tblEmployeeStatus.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.         tblEmployeeStatus.Recordset_Searching(sSrchWhere)
  271.  
  272.         ' Save search criteria
  273.         If sSrchWhere <> "" Then
  274.             If sSrchBasic = "" Then ResetBasicSearchParms()
  275.             tblEmployeeStatus.SearchWhere = sSrchWhere ' Save to Session
  276.             lStartRec = 1 ' Reset start record counter
  277.             tblEmployeeStatus.StartRecordNumber = lStartRec
  278.         Else
  279.             RestoreSearchParms()
  280.         End If
  281.  
  282.         ' Build filter
  283.             sFilter = "[tscIsActive]=True"
  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.         tblEmployeeStatus.SessionWhere = sFilter
  304.         tblEmployeeStatus.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.             tblEmployeeStatus.RecordsPerPage = lDisplayRecs ' Save to Session
  324.  
  325.             ' Reset start position
  326.             lStartRec = 1
  327.             tblEmployeeStatus.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 & "[tscStatus] 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.             tblEmployeeStatus.BasicSearchKeyword = sSearchKeyword
  368.             tblEmployeeStatus.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.         tblEmployeeStatus.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.         tblEmployeeStatus.BasicSearchKeyword = ""
  393.         tblEmployeeStatus.BasicSearchType = ""
  394.     End Sub
  395.  
  396.     '
  397.     ' Restore all search parameters
  398.     '
  399.     Sub RestoreSearchParms()
  400.         sSrchWhere = tblEmployeeStatus.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.             tblEmployeeStatus.CurrentOrder = ew_Get("order")
  417.             tblEmployeeStatus.CurrentOrderType = ew_Get("ordertype")
  418.             tblEmployeeStatus.UpdateSort(tblEmployeeStatus.tscStatus, bCtrl) ' tscStatus
  419.             tblEmployeeStatus.StartRecordNumber = 1 ' Reset start position
  420.         End If
  421.     End Sub
  422.  
  423.     '
  424.     ' Load Sort Order parameters
  425.     '
  426.     Sub LoadSortOrder()
  427.         Dim sOrderBy As String
  428.         sOrderBy = tblEmployeeStatus.SessionOrderBy ' Get order by from Session
  429.         If sOrderBy = "" Then
  430.             If tblEmployeeStatus.SqlOrderBy <> "" Then
  431.                 sOrderBy = tblEmployeeStatus.SqlOrderBy
  432.                 tblEmployeeStatus.SessionOrderBy = sOrderBy
  433.             End If
  434.         End If
  435.     End Sub
  436.  
  437.     '
  438.     ' Reset command based on querystring parameter "cmd"
  439.     ' - reset: reset search parameters
  440.     ' - resetall: reset search and master/detail parameters
  441.     ' - resetsort: reset sort parameters
  442.     '
  443.     Sub ResetCmd()
  444.         Dim sCmd As String
  445.  
  446.         ' Get reset cmd
  447.         If ew_Get("cmd") <> "" Then
  448.             sCmd = ew_Get("cmd")
  449.  
  450.             ' Reset search criteria
  451.             If ew_SameText(sCmd, "reset") OrElse ew_SameText(sCmd, "resetall") Then
  452.                 ResetSearchParms()
  453.             End If
  454.  
  455.             ' Reset sort criteria
  456.             If ew_SameText(sCmd, "resetsort") Then
  457.                 Dim sOrderBy As String = ""
  458.                 tblEmployeeStatus.SessionOrderBy = sOrderBy
  459.                 tblEmployeeStatus.tscStatus.Sort = ""
  460.             End If
  461.  
  462.             ' Reset start position
  463.             lStartRec = 1
  464.             tblEmployeeStatus.StartRecordNumber = lStartRec
  465.         End If
  466.     End Sub
  467.  
  468.     Public Pager As Object
  469.  
  470.     '
  471.     ' Set up Starting Record parameters
  472.     '
  473.     Sub SetUpStartRec()
  474.         Dim nPageNo As Integer
  475.  
  476.         ' Exit if lDisplayRecs = 0
  477.         If lDisplayRecs = 0 Then Exit Sub
  478.         If IsPageRequest Then ' Validate request
  479.  
  480.             ' Check for a "start" parameter
  481.             If ew_Get(EW_TABLE_START_REC) <> "" AndAlso IsNumeric(ew_Get(EW_TABLE_START_REC)) Then
  482.                 lStartRec = ew_ConvertToInt(ew_Get(EW_TABLE_START_REC))
  483.                 tblEmployeeStatus.StartRecordNumber = lStartRec
  484.             ElseIf ew_Get(EW_TABLE_PAGE_NO) <> "" AndAlso IsNumeric(ew_Get(EW_TABLE_PAGE_NO)) Then
  485.                 nPageNo = ew_ConvertToInt(ew_Get(EW_TABLE_PAGE_NO))
  486.                 lStartRec = (nPageNo-1)*lDisplayRecs+1
  487.                 If lStartRec <= 0 Then
  488.                     lStartRec = 1
  489.                 ElseIf lStartRec >= ((lTotalRecs-1)\lDisplayRecs)*lDisplayRecs+1 Then
  490.                     lStartRec = ((lTotalRecs-1)\lDisplayRecs)*lDisplayRecs+1
  491.                 End If
  492.                 tblEmployeeStatus.StartRecordNumber = lStartRec
  493.             End If
  494.         End If
  495.         lStartRec = tblEmployeeStatus.StartRecordNumber
  496.  
  497.         ' Check if correct start record counter
  498.         If lStartRec <= 0 Then ' Avoid invalid start record counter
  499.             lStartRec = 1 ' Reset start record counter
  500.             tblEmployeeStatus.StartRecordNumber = lStartRec
  501.         ElseIf lStartRec > lTotalRecs Then ' Avoid starting record > total records
  502.             lStartRec = ((lTotalRecs-1)\lDisplayRecs)*lDisplayRecs+1 ' Point to last page first record
  503.             tblEmployeeStatus.StartRecordNumber = lStartRec
  504.         ElseIf (lStartRec-1) Mod lDisplayRecs <> 0 Then
  505.             lStartRec = ((lStartRec-1)\lDisplayRecs)*lDisplayRecs+1 ' Point to page boundary
  506.             tblEmployeeStatus.StartRecordNumber = lStartRec
  507.         End If
  508.     End Sub
  509.  
  510.     '
  511.     ' Load default values
  512.     '
  513.     Sub LoadDefaultValues()
  514.     End Sub
  515.  
  516.     '
  517.     ' Load recordset
  518.     '
  519.     Function LoadRecordset() As OleDbDataReader
  520.  
  521.         ' Recordset Selecting event
  522.         tblEmployeeStatus.Recordset_Selecting(tblEmployeeStatus.CurrentFilter)
  523.  
  524.         ' Load list page SQL
  525.         Dim sSql As String = tblEmployeeStatus.ListSQL
  526.  
  527.         ' Write SQL for debug
  528.         If EW_DEBUG_ENABLED Then ew_Write(sSql)
  529.  
  530.         ' Count
  531.         lTotalRecs = -1        
  532.         Try            
  533.             If sSql.StartsWith("SELECT * FROM ", StringComparison.InvariantCultureIgnoreCase) AndAlso _                
  534.                 ew_Empty(tblEmployeeStatus.SqlGroupBy) AndAlso _
  535.                 ew_Empty(tblEmployeeStatus.SqlHaving) Then
  536.                 Dim sCntSql As String = tblEmployeeStatus.SelectCountSQL
  537.  
  538.                 ' Write SQL for debug
  539.                 If EW_DEBUG_ENABLED Then ew_Write("<br>" & sCntSql)
  540.                 lTotalRecs = Conn.ExecuteScalar(sCntSql)
  541.             End If            
  542.         Catch
  543.         End Try
  544.  
  545.         ' Load recordset
  546.         Dim Rs As OleDbDataReader = Conn.GetDataReader(sSql)
  547.         If lTotalRecs < 0 AndAlso Rs.HasRows Then
  548.             lTotalRecs = 0
  549.             While Rs.Read()
  550.                 lTotalRecs = lTotalRecs + 1
  551.             End While
  552.             Rs.Close()        
  553.             Rs = Conn.GetDataReader(sSql)
  554.         End If
  555.  
  556.         ' Recordset Selected event
  557.         tblEmployeeStatus.Recordset_Selected(Rs)
  558.         Return Rs
  559.     End Function
  560.  
  561.     '
  562.     ' Load row based on key values
  563.     '
  564.     Function LoadRow() As Boolean
  565.         Dim RsRow As OleDbDataReader
  566.         Dim sFilter As String = tblEmployeeStatus.KeyFilter
  567.  
  568.         ' Row Selecting event
  569.         tblEmployeeStatus.Row_Selecting(sFilter)
  570.  
  571.         ' Load SQL based on filter
  572.         tblEmployeeStatus.CurrentFilter = sFilter
  573.         Dim sSql As String = tblEmployeeStatus.SQL
  574.  
  575.         ' Write SQL for debug
  576.         If EW_DEBUG_ENABLED Then ew_Write(sSql)
  577.         Try
  578.             RsRow = Conn.GetTempDataReader(sSql)    
  579.             If Not RsRow.Read() Then
  580.                 Return False
  581.             Else                
  582.                 LoadRowValues(RsRow) ' Load row values
  583.  
  584.                 ' Row Selected event
  585.                 tblEmployeeStatus.Row_Selected(RsRow)
  586.                 Return True    
  587.             End If
  588.         Catch
  589.             If EW_DEBUG_ENABLED Then Throw
  590.             Return False
  591.         Finally
  592.             Conn.CloseTempDataReader()
  593.         End Try
  594.     End Function
  595.  
  596.     '
  597.     ' Load row values from recordset
  598.     '
  599.     Sub LoadRowValues(ByRef RsRow As OleDbDataReader)
  600.         tblEmployeeStatus.ID.DbValue = RsRow("ID")
  601.         tblEmployeeStatus.tscStatus.DbValue = RsRow("tscStatus")
  602.     End Sub
  603.  
  604.     '
  605.     ' Render row values based on field settings
  606.     '
  607.     Sub RenderRow()
  608.  
  609.         ' Row Rendering event
  610.         tblEmployeeStatus.Row_Rendering()
  611.  
  612.         '
  613.         '  Common render codes for all row types
  614.         '
  615.         ' tscStatus
  616.  
  617.         tblEmployeeStatus.tscStatus.CellCssStyle = ""
  618.         tblEmployeeStatus.tscStatus.CellCssClass = ""
  619.  
  620.         '
  621.         '  View  Row
  622.         '
  623.  
  624.         If tblEmployeeStatus.RowType = EW_ROWTYPE_VIEW Then ' View row
  625.  
  626.             ' ID
  627.             tblEmployeeStatus.ID.ViewValue = tblEmployeeStatus.ID.CurrentValue
  628.             tblEmployeeStatus.ID.CssStyle = ""
  629.             tblEmployeeStatus.ID.CssClass = ""
  630.             tblEmployeeStatus.ID.ViewCustomAttributes = ""
  631.  
  632.             ' tscStatus
  633.             tblEmployeeStatus.tscStatus.ViewValue = tblEmployeeStatus.tscStatus.CurrentValue
  634.             tblEmployeeStatus.tscStatus.CssStyle = ""
  635.             tblEmployeeStatus.tscStatus.CssClass = ""
  636.             tblEmployeeStatus.tscStatus.ViewCustomAttributes = ""
  637.  
  638.             ' View refer script
  639.             ' tscStatus
  640.  
  641.             tblEmployeeStatus.tscStatus.HrefValue = ""
  642.         End If
  643.  
  644.         ' Row Rendered event
  645.         tblEmployeeStatus.Row_Rendered()
  646.     End Sub
  647.  
  648.         ' Page Load event
  649.         Public Sub Page_Load()
  650.  
  651.             'HttpContext.Current.Response.Write("Page Load")
  652.         End Sub
  653.  
  654.         ' Page Unload event
  655.         Public Sub Page_Unload()
  656.  
  657.             'HttpContext.Current.Response.Write("Page Unload")
  658.         End Sub
  659.  
  660.     ' Form Custom Validate event
  661.     Public Function Form_CustomValidate(ByRef CustomError As String) As Boolean
  662.  
  663.         'Return error message in CustomError
  664.         Return True
  665.     End Function
  666.     End Class
  667.  
  668.     '
  669.     ' ASP.NET Page_Load event
  670.     '
  671.  
  672.     Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
  673.         Response.Buffer = EW_RESPONSE_BUFFER
  674.         Response.Cache.SetCacheability(HttpCacheability.NoCache)
  675.  
  676.         ' Page init
  677.         tblEmployeeStatus_list = New ctblEmployeeStatus_list(Me)        
  678.         tblEmployeeStatus_list.Page_Init()
  679.  
  680.         ' Page main processing
  681.         tblEmployeeStatus_list.Page_Main()
  682.     End Sub
  683.  
  684.     '
  685.     ' ASP.NET Page_Unload event
  686.     '
  687.  
  688.     Protected Sub Page_Unload(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Unload
  689.  
  690.         ' Dispose page object
  691.         If tblEmployeeStatus_list IsNot Nothing Then tblEmployeeStatus_list.Dispose()
  692.     End Sub
  693. End Class
  694.