home *** CD-ROM | disk | FTP | other *** search
/ 66.142.0.142 / 66.142.0.142.tar / 66.142.0.142 / tblLPRview.aspx.vb < prev    next >
Text File  |  2010-08-24  |  20KB  |  684 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 tblLPRview
  12.     Inherits AspNetMaker7_tfpssnet
  13.  
  14.     ' Page object
  15.     Public tblLPR_view As ctblLPR_view
  16.  
  17.     '
  18.     ' Page Class
  19.     '
  20.     Class ctblLPR_view
  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 tblLPR.UseTokenInUrl Then Url = Url & "t=" & tblLPR.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 tblLPR.UseTokenInUrl Then
  44.                 Result = False
  45.                 If ObjForm IsNot Nothing Then
  46.                     Result = (tblLPR.TableVar = ObjForm.GetValue("t"))
  47.                 End If
  48.                 If ew_Get("t") <> "" Then
  49.                     Result = (tblLPR.TableVar = ew_Get("t"))
  50.                 End If
  51.                 Return Result
  52.             End If
  53.             Return True            
  54.         End Function    
  55.  
  56.         ' tblLPR
  57.         Public Property tblLPR() As ctblLPR
  58.             Get                
  59.                 Return ParentPage.tblLPR
  60.             End Get
  61.             Set(ByVal v As ctblLPR)
  62.                 ParentPage.tblLPR = v    
  63.             End Set    
  64.         End Property
  65.  
  66.         ' tblLPR
  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 = "view"
  85.             m_PageObjName = "tblLPR_view"
  86.             m_PageObjTypeName = "ctblLPR_view"
  87.  
  88.             ' Table Name
  89.             m_TableName = "tblLPR"
  90.  
  91.             ' Initialize table object
  92.             tblLPR = New ctblLPR(Me)
  93.             tblEmployees = New ctblEmployees(Me)
  94.  
  95.             ' Connect to database
  96.             Conn = New cConnection()
  97.         End Sub
  98.  
  99.         '
  100.         '  Subroutine Page_Init
  101.         '  - called before page main
  102.         '  - check Security
  103.         '  - set up response header
  104.         '  - call page load events
  105.         '
  106.         Public Sub Page_Init()
  107.             Security = New cAdvancedSecurity(Me)
  108.             If Not Security.IsLoggedIn() Then Security.AutoLogin()
  109.             If Not Security.IsLoggedIn() Then
  110.                 Security.SaveLastUrl()
  111.                 Page_Terminate("login.aspx")
  112.             End If
  113.  
  114.             ' Table Permission loading event
  115.             Security.TablePermission_Loading()
  116.             Security.LoadCurrentUserLevel(TableName)
  117.  
  118.             ' Table Permission loaded event
  119.             Security.TablePermission_Loaded()
  120.             If Not Security.CanView Then
  121.                 Security.SaveLastUrl()
  122.                 Page_Terminate("tblLPRlist.aspx")
  123.             End If
  124.  
  125.             ' User ID loading event
  126.             Security.UserID_Loading()
  127.             If Security.IsLoggedIn() Then Call Security.LoadUserID()
  128.  
  129.             ' User ID loaded event
  130.             Security.UserID_Loaded()
  131.             If Security.IsLoggedIn() And ew_Empty(Security.CurrentUserID) Then
  132.                 Message = "You do not have the right permission to view the page"
  133.                 Page_Terminate("tblLPRlist.aspx")
  134.             End If
  135.  
  136.             ' Global page loading event (in ewglobal*.vb)
  137.             ParentPage.Page_Loading()
  138.  
  139.             ' Page load event, used in current page
  140.             Page_Load()
  141.         End Sub
  142.  
  143.         '
  144.         '  Class terminate
  145.         '  - clean up page object
  146.         '
  147.         Public Sub Dispose() Implements IDisposable.Dispose
  148.             Page_Terminate("")
  149.         End Sub
  150.  
  151.         '
  152.         '  Sub Page_Terminate
  153.         '  - called when exit page
  154.         '  - clean up connection and objects
  155.         '  - if URL specified, redirect to URL
  156.         '
  157.         Sub Page_Terminate(url As String)
  158.  
  159.             ' Page unload event, used in current page
  160.             Page_Unload()
  161.  
  162.             ' Global page unloaded event (in ewglobal*.vb)
  163.             ParentPage.Page_Unloaded()
  164.  
  165.             ' Close connection
  166.             Conn.Dispose()
  167.             Security = Nothing
  168.             tblLPR.Dispose()
  169.             tblEmployees.Dispose()
  170.  
  171.             ' Go to URL if specified
  172.             If url <> "" Then
  173.                 HttpContext.Current.Response.Clear()
  174.                 HttpContext.Current.Response.Redirect(url)
  175.             End If
  176.         End Sub
  177.  
  178.     Public lDisplayRecs As Integer ' Number of display records
  179.  
  180.     Public lStartRec As Integer, lStopRec As Integer, lTotalRecs As Integer, lRecRange As Integer
  181.  
  182.     Public lRecCnt As Integer
  183.  
  184.     Public sSrchWhere As String
  185.  
  186.     '
  187.     ' Page main processing
  188.     '
  189.     Sub Page_Main()
  190.         Dim sReturnUrl As String = ""
  191.         Dim bMatchRecord As Boolean = False
  192.         If IsPageRequest Then ' Validate request
  193.             If ew_Get("lprID") <> "" Then
  194.                 tblLPR.lprID.QueryStringValue = ew_Get("lprID")
  195.             Else
  196.                 sReturnUrl = "tblLPRlist.aspx" ' Return to list
  197.             End If
  198.  
  199.             ' Get action
  200.             tblLPR.CurrentAction = "I" ' Display form
  201.             Select Case tblLPR.CurrentAction
  202.                 Case "I" ' Get a record to display
  203.                     If Not LoadRow() Then ' Load record based on key
  204.                         Message = "No records found" ' Set no record message
  205.                         sReturnUrl = "tblLPRlist.aspx" ' No matching record, return to list
  206.                     End If
  207.             End Select
  208.         Else
  209.             sReturnUrl = "tblLPRlist.aspx" ' Not page request, return to list
  210.         End If
  211.         If sReturnUrl <> "" Then Page_Terminate(sReturnUrl)
  212.  
  213.         ' Render row
  214.         tblLPR.RowType = EW_ROWTYPE_VIEW
  215.         RenderRow()
  216.     End Sub
  217.  
  218.     Public Pager As Object
  219.  
  220.     '
  221.     ' Set up Starting Record parameters
  222.     '
  223.     Sub SetUpStartRec()
  224.         Dim nPageNo As Integer
  225.  
  226.         ' Exit if lDisplayRecs = 0
  227.         If lDisplayRecs = 0 Then Exit Sub
  228.         If IsPageRequest Then ' Validate request
  229.  
  230.             ' Check for a "start" parameter
  231.             If ew_Get(EW_TABLE_START_REC) <> "" AndAlso IsNumeric(ew_Get(EW_TABLE_START_REC)) Then
  232.                 lStartRec = ew_ConvertToInt(ew_Get(EW_TABLE_START_REC))
  233.                 tblLPR.StartRecordNumber = lStartRec
  234.             ElseIf ew_Get(EW_TABLE_PAGE_NO) <> "" AndAlso IsNumeric(ew_Get(EW_TABLE_PAGE_NO)) Then
  235.                 nPageNo = ew_ConvertToInt(ew_Get(EW_TABLE_PAGE_NO))
  236.                 lStartRec = (nPageNo-1)*lDisplayRecs+1
  237.                 If lStartRec <= 0 Then
  238.                     lStartRec = 1
  239.                 ElseIf lStartRec >= ((lTotalRecs-1)\lDisplayRecs)*lDisplayRecs+1 Then
  240.                     lStartRec = ((lTotalRecs-1)\lDisplayRecs)*lDisplayRecs+1
  241.                 End If
  242.                 tblLPR.StartRecordNumber = lStartRec
  243.             End If
  244.         End If
  245.         lStartRec = tblLPR.StartRecordNumber
  246.  
  247.         ' Check if correct start record counter
  248.         If lStartRec <= 0 Then ' Avoid invalid start record counter
  249.             lStartRec = 1 ' Reset start record counter
  250.             tblLPR.StartRecordNumber = lStartRec
  251.         ElseIf lStartRec > lTotalRecs Then ' Avoid starting record > total records
  252.             lStartRec = ((lTotalRecs-1)\lDisplayRecs)*lDisplayRecs+1 ' Point to last page first record
  253.             tblLPR.StartRecordNumber = lStartRec
  254.         ElseIf (lStartRec-1) Mod lDisplayRecs <> 0 Then
  255.             lStartRec = ((lStartRec-1)\lDisplayRecs)*lDisplayRecs+1 ' Point to page boundary
  256.             tblLPR.StartRecordNumber = lStartRec
  257.         End If
  258.     End Sub
  259.  
  260.     '
  261.     ' Load default values
  262.     '
  263.     Sub LoadDefaultValues()
  264.     End Sub
  265.  
  266.     '
  267.     ' Load row based on key values
  268.     '
  269.     Function LoadRow() As Boolean
  270.         Dim RsRow As OleDbDataReader
  271.         Dim sFilter As String = tblLPR.KeyFilter
  272.  
  273.         ' Row Selecting event
  274.         tblLPR.Row_Selecting(sFilter)
  275.  
  276.         ' Load SQL based on filter
  277.         tblLPR.CurrentFilter = sFilter
  278.         Dim sSql As String = tblLPR.SQL
  279.  
  280.         ' Write SQL for debug
  281.         If EW_DEBUG_ENABLED Then ew_Write(sSql)
  282.         Try
  283.             RsRow = Conn.GetTempDataReader(sSql)    
  284.             If Not RsRow.Read() Then
  285.                 Return False
  286.             Else                
  287.                 LoadRowValues(RsRow) ' Load row values
  288.  
  289.                 ' Row Selected event
  290.                 tblLPR.Row_Selected(RsRow)
  291.                 Return True    
  292.             End If
  293.         Catch
  294.             If EW_DEBUG_ENABLED Then Throw
  295.             Return False
  296.         Finally
  297.             Conn.CloseTempDataReader()
  298.         End Try
  299.     End Function
  300.  
  301.     '
  302.     ' Load row values from recordset
  303.     '
  304.     Sub LoadRowValues(ByRef RsRow As OleDbDataReader)
  305.         tblLPR.lprID.DbValue = RsRow("lprID")
  306.         tblLPR.lprEmpID.DbValue = RsRow("lprEmpID")
  307.         tblLPR.lprDate.DbValue = RsRow("lprDate")
  308.         tblLPR.lprLocationID.DbValue = RsRow("lprLocationID")
  309.         tblLPR.lprFixtureLocationID.DbValue = RsRow("lprFixtureLocationID")
  310.         tblLPR.lprFixtureTypeID.DbValue = RsRow("lprFixtureTypeID")
  311.         tblLPR.lprFixtureNumber.DbValue = RsRow("lprFixtureNumber")
  312.         tblLPR.lprChannelNumber.DbValue = RsRow("lprChannelNumber")
  313.         tblLPR.lprPriority.DbValue = RsRow("lprPriority")
  314.         tblLPR.lprShortDesc.DbValue = RsRow("lprShortDesc")
  315.         tblLPR.lprSTID.DbValue = RsRow("lprSTID")
  316.         tblLPR.lprSTChangedBy.DbValue = RsRow("lprSTChangedBy")
  317.         tblLPR.lprDesc.DbValue = RsRow("lprDesc")
  318.         tblLPR.lprCreatedBy.DbValue = RsRow("lprCreatedBy")
  319.         tblLPR.lprCreatedOn.DbValue = RsRow("lprCreatedOn")
  320.         tblLPR.lprModifiedBy.DbValue = RsRow("lprModifiedBy")
  321.         tblLPR.lprModifiedOn.DbValue = RsRow("lprModifiedOn")
  322.     End Sub
  323.  
  324.     '
  325.     ' Render row values based on field settings
  326.     '
  327.     Sub RenderRow()
  328.  
  329.         ' Row Rendering event
  330.         tblLPR.Row_Rendering()
  331.  
  332.         '
  333.         '  Common render codes for all row types
  334.         '
  335.         ' lprEmpID
  336.  
  337.         tblLPR.lprEmpID.CellCssStyle = ""
  338.         tblLPR.lprEmpID.CellCssClass = ""
  339.  
  340.         ' lprDate
  341.         tblLPR.lprDate.CellCssStyle = ""
  342.         tblLPR.lprDate.CellCssClass = ""
  343.  
  344.         ' lprLocationID
  345.         tblLPR.lprLocationID.CellCssStyle = ""
  346.         tblLPR.lprLocationID.CellCssClass = ""
  347.  
  348.         ' lprFixtureLocationID
  349.         tblLPR.lprFixtureLocationID.CellCssStyle = ""
  350.         tblLPR.lprFixtureLocationID.CellCssClass = ""
  351.  
  352.         ' lprFixtureTypeID
  353.         tblLPR.lprFixtureTypeID.CellCssStyle = ""
  354.         tblLPR.lprFixtureTypeID.CellCssClass = ""
  355.  
  356.         ' lprFixtureNumber
  357.         tblLPR.lprFixtureNumber.CellCssStyle = ""
  358.         tblLPR.lprFixtureNumber.CellCssClass = ""
  359.  
  360.         ' lprChannelNumber
  361.         tblLPR.lprChannelNumber.CellCssStyle = ""
  362.         tblLPR.lprChannelNumber.CellCssClass = ""
  363.  
  364.         ' lprPriority
  365.         tblLPR.lprPriority.CellCssStyle = ""
  366.         tblLPR.lprPriority.CellCssClass = ""
  367.  
  368.         ' lprShortDesc
  369.         tblLPR.lprShortDesc.CellCssStyle = ""
  370.         tblLPR.lprShortDesc.CellCssClass = ""
  371.  
  372.         ' lprSTID
  373.         tblLPR.lprSTID.CellCssStyle = ""
  374.         tblLPR.lprSTID.CellCssClass = ""
  375.  
  376.         ' lprSTChangedBy
  377.         tblLPR.lprSTChangedBy.CellCssStyle = ""
  378.         tblLPR.lprSTChangedBy.CellCssClass = ""
  379.  
  380.         ' lprDesc
  381.         tblLPR.lprDesc.CellCssStyle = ""
  382.         tblLPR.lprDesc.CellCssClass = ""
  383.  
  384.         ' lprCreatedBy
  385.         tblLPR.lprCreatedBy.CellCssStyle = ""
  386.         tblLPR.lprCreatedBy.CellCssClass = ""
  387.  
  388.         ' lprCreatedOn
  389.         tblLPR.lprCreatedOn.CellCssStyle = ""
  390.         tblLPR.lprCreatedOn.CellCssClass = ""
  391.  
  392.         ' lprModifiedBy
  393.         tblLPR.lprModifiedBy.CellCssStyle = ""
  394.         tblLPR.lprModifiedBy.CellCssClass = ""
  395.  
  396.         ' lprModifiedOn
  397.         tblLPR.lprModifiedOn.CellCssStyle = ""
  398.         tblLPR.lprModifiedOn.CellCssClass = ""
  399.  
  400.         '
  401.         '  View  Row
  402.         '
  403.  
  404.         If tblLPR.RowType = EW_ROWTYPE_VIEW Then ' View row
  405.  
  406.             ' lprEmpID
  407.             If ew_NotEmpty(tblLPR.lprEmpID.CurrentValue) Then
  408.                 sSqlWrk = "SELECT [empName] FROM [tblEmployees] WHERE [empID] = " & ew_AdjustSql(tblLPR.lprEmpID.CurrentValue) & ""
  409.                     sSqlWrk = sSqlWrk & " ORDER BY [empFirstName] "
  410.                 RsWrk = Conn.GetTempDataReader(sSqlWrk)
  411.                 If RsWrk.Read() Then
  412.                     tblLPR.lprEmpID.ViewValue = RsWrk("empName")
  413.                 Else
  414.                     tblLPR.lprEmpID.ViewValue = tblLPR.lprEmpID.CurrentValue
  415.                 End If
  416.                 Conn.CloseTempDataReader()
  417.             Else
  418.                 tblLPR.lprEmpID.ViewValue = System.DBNull.Value
  419.             End If
  420.             tblLPR.lprEmpID.CssStyle = ""
  421.             tblLPR.lprEmpID.CssClass = ""
  422.             tblLPR.lprEmpID.ViewCustomAttributes = ""
  423.  
  424.             ' lprDate
  425.             tblLPR.lprDate.ViewValue = tblLPR.lprDate.CurrentValue
  426.             tblLPR.lprDate.ViewValue = ew_FormatDateTime(tblLPR.lprDate.ViewValue, 6)
  427.             tblLPR.lprDate.CssStyle = ""
  428.             tblLPR.lprDate.CssClass = ""
  429.             tblLPR.lprDate.ViewCustomAttributes = ""
  430.  
  431.             ' lprLocationID
  432.             If ew_NotEmpty(tblLPR.lprLocationID.CurrentValue) Then
  433.                 sSqlWrk = "SELECT [locDescription] FROM [tblLocations] WHERE [locID] = " & ew_AdjustSql(tblLPR.lprLocationID.CurrentValue) & ""
  434.                 sSqlWrk = sSqlWrk & " AND (" & "[locLighting]=True" & ")"
  435.                 sSqlWrk = sSqlWrk & " ORDER BY [locDescription] "
  436.                 RsWrk = Conn.GetTempDataReader(sSqlWrk)
  437.                 If RsWrk.Read() Then
  438.                     tblLPR.lprLocationID.ViewValue = RsWrk("locDescription")
  439.                 Else
  440.                     tblLPR.lprLocationID.ViewValue = tblLPR.lprLocationID.CurrentValue
  441.                 End If
  442.                 Conn.CloseTempDataReader()
  443.             Else
  444.                 tblLPR.lprLocationID.ViewValue = System.DBNull.Value
  445.             End If
  446.             tblLPR.lprLocationID.CssStyle = ""
  447.             tblLPR.lprLocationID.CssClass = ""
  448.             tblLPR.lprLocationID.ViewCustomAttributes = ""
  449.  
  450.             ' lprFixtureLocationID
  451.             If ew_NotEmpty(tblLPR.lprFixtureLocationID.CurrentValue) Then
  452.                 sSqlWrk = "SELECT [floDescription] FROM [tblLPRFixtureLocation] WHERE [floID] = " & ew_AdjustSql(tblLPR.lprFixtureLocationID.CurrentValue) & ""
  453.                 sSqlWrk = sSqlWrk & " ORDER BY [floDescription] "
  454.                 RsWrk = Conn.GetTempDataReader(sSqlWrk)
  455.                 If RsWrk.Read() Then
  456.                     tblLPR.lprFixtureLocationID.ViewValue = RsWrk("floDescription")
  457.                 Else
  458.                     tblLPR.lprFixtureLocationID.ViewValue = tblLPR.lprFixtureLocationID.CurrentValue
  459.                 End If
  460.                 Conn.CloseTempDataReader()
  461.             Else
  462.                 tblLPR.lprFixtureLocationID.ViewValue = System.DBNull.Value
  463.             End If
  464.             tblLPR.lprFixtureLocationID.CssStyle = ""
  465.             tblLPR.lprFixtureLocationID.CssClass = ""
  466.             tblLPR.lprFixtureLocationID.ViewCustomAttributes = ""
  467.  
  468.             ' lprFixtureTypeID
  469.             If ew_NotEmpty(tblLPR.lprFixtureTypeID.CurrentValue) Then
  470.                 sSqlWrk = "SELECT [ftyDescription] FROM [tblLPRFixtureType] WHERE [ftyID] = " & ew_AdjustSql(tblLPR.lprFixtureTypeID.CurrentValue) & ""
  471.                 RsWrk = Conn.GetTempDataReader(sSqlWrk)
  472.                 If RsWrk.Read() Then
  473.                     tblLPR.lprFixtureTypeID.ViewValue = RsWrk("ftyDescription")
  474.                 Else
  475.                     tblLPR.lprFixtureTypeID.ViewValue = tblLPR.lprFixtureTypeID.CurrentValue
  476.                 End If
  477.                 Conn.CloseTempDataReader()
  478.             Else
  479.                 tblLPR.lprFixtureTypeID.ViewValue = System.DBNull.Value
  480.             End If
  481.             tblLPR.lprFixtureTypeID.CssStyle = ""
  482.             tblLPR.lprFixtureTypeID.CssClass = ""
  483.             tblLPR.lprFixtureTypeID.ViewCustomAttributes = ""
  484.  
  485.             ' lprFixtureNumber
  486.             tblLPR.lprFixtureNumber.ViewValue = tblLPR.lprFixtureNumber.CurrentValue
  487.             tblLPR.lprFixtureNumber.CssStyle = ""
  488.             tblLPR.lprFixtureNumber.CssClass = ""
  489.             tblLPR.lprFixtureNumber.ViewCustomAttributes = ""
  490.  
  491.             ' lprChannelNumber
  492.             tblLPR.lprChannelNumber.ViewValue = tblLPR.lprChannelNumber.CurrentValue
  493.             tblLPR.lprChannelNumber.CssStyle = ""
  494.             tblLPR.lprChannelNumber.CssClass = ""
  495.             tblLPR.lprChannelNumber.ViewCustomAttributes = ""
  496.  
  497.             ' lprPriority
  498.             If Not IsDBNull(tblLPR.lprPriority.CurrentValue) Then
  499.                     Select Case tblLPR.lprPriority.CurrentValue
  500.                         Case "0"
  501.                             tblLPR.lprPriority.ViewValue = "Not Specified"
  502.                         Case "1"
  503.                             tblLPR.lprPriority.ViewValue = "High"
  504.                         Case "2"
  505.                             tblLPR.lprPriority.ViewValue = "Medium"
  506.                         Case "3"
  507.                             tblLPR.lprPriority.ViewValue = "Low"
  508.                         Case Else
  509.                             tblLPR.lprPriority.ViewValue = tblLPR.lprPriority.CurrentValue
  510.                     End Select
  511.             Else
  512.                 tblLPR.lprPriority.ViewValue = System.DBNull.Value
  513.             End If
  514.             tblLPR.lprPriority.CssStyle = ""
  515.             tblLPR.lprPriority.CssClass = ""
  516.             tblLPR.lprPriority.ViewCustomAttributes = ""
  517.  
  518.             ' lprShortDesc
  519.             tblLPR.lprShortDesc.ViewValue = tblLPR.lprShortDesc.CurrentValue
  520.             tblLPR.lprShortDesc.CssStyle = ""
  521.             tblLPR.lprShortDesc.CssClass = ""
  522.             tblLPR.lprShortDesc.ViewCustomAttributes = ""
  523.  
  524.             ' lprSTID
  525.             If ew_NotEmpty(tblLPR.lprSTID.CurrentValue) Then
  526.                 sSqlWrk = "SELECT [lstDescription] FROM [tblLPRStatus] WHERE [lstID] = " & ew_AdjustSql(tblLPR.lprSTID.CurrentValue) & ""
  527.                 sSqlWrk = sSqlWrk & " ORDER BY [lstDescription] "
  528.                 RsWrk = Conn.GetTempDataReader(sSqlWrk)
  529.                 If RsWrk.Read() Then
  530.                     tblLPR.lprSTID.ViewValue = RsWrk("lstDescription")
  531.                 Else
  532.                     tblLPR.lprSTID.ViewValue = tblLPR.lprSTID.CurrentValue
  533.                 End If
  534.                 Conn.CloseTempDataReader()
  535.             Else
  536.                 tblLPR.lprSTID.ViewValue = System.DBNull.Value
  537.             End If
  538.             tblLPR.lprSTID.CssStyle = ""
  539.             tblLPR.lprSTID.CssClass = ""
  540.             tblLPR.lprSTID.ViewCustomAttributes = ""
  541.  
  542.             ' lprSTChangedBy
  543.             tblLPR.lprSTChangedBy.ViewValue = tblLPR.lprSTChangedBy.CurrentValue
  544.             tblLPR.lprSTChangedBy.CssStyle = ""
  545.             tblLPR.lprSTChangedBy.CssClass = ""
  546.             tblLPR.lprSTChangedBy.ViewCustomAttributes = ""
  547.  
  548.             ' lprDesc
  549.             tblLPR.lprDesc.ViewValue = tblLPR.lprDesc.CurrentValue
  550.             tblLPR.lprDesc.CssStyle = ""
  551.             tblLPR.lprDesc.CssClass = ""
  552.             tblLPR.lprDesc.ViewCustomAttributes = ""
  553.  
  554.             ' lprCreatedBy
  555.             tblLPR.lprCreatedBy.ViewValue = tblLPR.lprCreatedBy.CurrentValue
  556.             tblLPR.lprCreatedBy.CssStyle = ""
  557.             tblLPR.lprCreatedBy.CssClass = ""
  558.             tblLPR.lprCreatedBy.ViewCustomAttributes = ""
  559.  
  560.             ' lprCreatedOn
  561.             tblLPR.lprCreatedOn.ViewValue = tblLPR.lprCreatedOn.CurrentValue
  562.             tblLPR.lprCreatedOn.ViewValue = ew_FormatDateTime(tblLPR.lprCreatedOn.ViewValue, 6)
  563.             tblLPR.lprCreatedOn.CssStyle = ""
  564.             tblLPR.lprCreatedOn.CssClass = ""
  565.             tblLPR.lprCreatedOn.ViewCustomAttributes = ""
  566.  
  567.             ' lprModifiedBy
  568.             tblLPR.lprModifiedBy.ViewValue = tblLPR.lprModifiedBy.CurrentValue
  569.             tblLPR.lprModifiedBy.CssStyle = ""
  570.             tblLPR.lprModifiedBy.CssClass = ""
  571.             tblLPR.lprModifiedBy.ViewCustomAttributes = ""
  572.  
  573.             ' lprModifiedOn
  574.             tblLPR.lprModifiedOn.ViewValue = tblLPR.lprModifiedOn.CurrentValue
  575.             tblLPR.lprModifiedOn.ViewValue = ew_FormatDateTime(tblLPR.lprModifiedOn.ViewValue, 6)
  576.             tblLPR.lprModifiedOn.CssStyle = ""
  577.             tblLPR.lprModifiedOn.CssClass = ""
  578.             tblLPR.lprModifiedOn.ViewCustomAttributes = ""
  579.  
  580.             ' View refer script
  581.             ' lprEmpID
  582.  
  583.             tblLPR.lprEmpID.HrefValue = ""
  584.  
  585.             ' lprDate
  586.             tblLPR.lprDate.HrefValue = ""
  587.  
  588.             ' lprLocationID
  589.             tblLPR.lprLocationID.HrefValue = ""
  590.  
  591.             ' lprFixtureLocationID
  592.             tblLPR.lprFixtureLocationID.HrefValue = ""
  593.  
  594.             ' lprFixtureTypeID
  595.             tblLPR.lprFixtureTypeID.HrefValue = ""
  596.  
  597.             ' lprFixtureNumber
  598.             tblLPR.lprFixtureNumber.HrefValue = ""
  599.  
  600.             ' lprChannelNumber
  601.             tblLPR.lprChannelNumber.HrefValue = ""
  602.  
  603.             ' lprPriority
  604.             tblLPR.lprPriority.HrefValue = ""
  605.  
  606.             ' lprShortDesc
  607.             tblLPR.lprShortDesc.HrefValue = ""
  608.  
  609.             ' lprSTID
  610.             tblLPR.lprSTID.HrefValue = ""
  611.  
  612.             ' lprSTChangedBy
  613.             tblLPR.lprSTChangedBy.HrefValue = ""
  614.  
  615.             ' lprDesc
  616.             tblLPR.lprDesc.HrefValue = ""
  617.  
  618.             ' lprCreatedBy
  619.             tblLPR.lprCreatedBy.HrefValue = ""
  620.  
  621.             ' lprCreatedOn
  622.             tblLPR.lprCreatedOn.HrefValue = ""
  623.  
  624.             ' lprModifiedBy
  625.             tblLPR.lprModifiedBy.HrefValue = ""
  626.  
  627.             ' lprModifiedOn
  628.             tblLPR.lprModifiedOn.HrefValue = ""
  629.         End If
  630.  
  631.         ' Row Rendered event
  632.         tblLPR.Row_Rendered()
  633.     End Sub
  634.  
  635.     '
  636.     ' Show link optionally based on user ID
  637.     '
  638.     Function ShowOptionLink() As Boolean        
  639.         If Security.IsLoggedIn() AndAlso Not Security.IsAdmin() Then
  640.             Return Security.IsValidUserID(tblLPR.lprEmpID.CurrentValue)
  641.         End If
  642.         Return True
  643.     End Function
  644.  
  645.         ' Page Load event
  646.         Public Sub Page_Load()
  647.  
  648.             'HttpContext.Current.Response.Write("Page Load")
  649.         End Sub
  650.  
  651.         ' Page Unload event
  652.         Public Sub Page_Unload()
  653.  
  654.             'HttpContext.Current.Response.Write("Page Unload")
  655.         End Sub
  656.     End Class
  657.  
  658.     '
  659.     ' ASP.NET Page_Load event
  660.     '
  661.  
  662.     Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
  663.         Response.Buffer = EW_RESPONSE_BUFFER
  664.         Response.Cache.SetCacheability(HttpCacheability.NoCache)
  665.  
  666.         ' Page init
  667.         tblLPR_view = New ctblLPR_view(Me)        
  668.         tblLPR_view.Page_Init()
  669.  
  670.         ' Page main processing
  671.         tblLPR_view.Page_Main()
  672.     End Sub
  673.  
  674.     '
  675.     ' ASP.NET Page_Unload event
  676.     '
  677.  
  678.     Protected Sub Page_Unload(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Unload
  679.  
  680.         ' Dispose page object
  681.         If tblLPR_view IsNot Nothing Then tblLPR_view.Dispose()
  682.     End Sub
  683. End Class
  684.