home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
66.142.0.142
/
66.142.0.142.tar
/
66.142.0.142
/
ltgFixtureNotelist.aspx.vb
< prev
next >
Wrap
Text File
|
2014-01-25
|
29KB
|
966 lines
Imports System.Data
Imports System.Data.Common
Imports System.Xml
Imports System.IO
Imports System.Data.OleDb
'
' ASP.NET code-behind class (Page)
'
Partial Class ltgFixtureNotelist
Inherits AspNetMaker7_tfpssnet
' Page object
Public ltgFixtureNote_list As cltgFixtureNote_list
'
' Page Class
'
Class cltgFixtureNote_list
Inherits AspNetMakerPage
Implements IDisposable
' Used by system generated functions
Private RsWrk As Object, sSqlWrk As String, sWhereWrk As String
Private arwrk As Object
Private armultiwrk() As String
' Page URL
Public ReadOnly Property PageUrl() As String
Get
Dim Url As String = ew_CurrentPage() & "?"
If ltgFixtureNote.UseTokenInUrl Then Url = Url & "t=" & ltgFixtureNote.TableVar & "&" ' Add page token
Return Url
End Get
End Property
' Validate page request
Public Function IsPageRequest() As Boolean
Dim Result As Boolean
If ltgFixtureNote.UseTokenInUrl Then
Result = False
If ObjForm IsNot Nothing Then
Result = (ltgFixtureNote.TableVar = ObjForm.GetValue("t"))
End If
If ew_Get("t") <> "" Then
Result = (ltgFixtureNote.TableVar = ew_Get("t"))
End If
Return Result
End If
Return True
End Function
' ltgFixtureNote
Public Property ltgFixtureNote() As cltgFixtureNote
Get
Return ParentPage.ltgFixtureNote
End Get
Set(ByVal v As cltgFixtureNote)
ParentPage.ltgFixtureNote = v
End Set
End Property
' ltgFixtureNote
Public Property tblEmployees() As ctblEmployees
Get
Return ParentPage.tblEmployees
End Get
Set(ByVal v As ctblEmployees)
ParentPage.tblEmployees = v
End Set
End Property
' ltgFixtureNote
Public Property ltgFixtureMaster() As cltgFixtureMaster
Get
Return ParentPage.ltgFixtureMaster
End Get
Set(ByVal v As cltgFixtureMaster)
ParentPage.ltgFixtureMaster = v
End Set
End Property
'
' Constructor
' - init objects
' - open connection
'
Public Sub New(ByRef APage As AspNetMaker7_tfpssnet)
m_ParentPage = APage
m_Page = Me
m_PageID = "list"
m_PageObjName = "ltgFixtureNote_list"
m_PageObjTypeName = "cltgFixtureNote_list"
' Table Name
m_TableName = "ltgFixtureNote"
' Initialize table object
ltgFixtureNote = New cltgFixtureNote(Me)
tblEmployees = New ctblEmployees(Me)
ltgFixtureMaster = New cltgFixtureMaster(Me)
' Connect to database
Conn = New cConnection()
' Initialize list options
ListOptions = New cListOptions
End Sub
'
' Subroutine Page_Init
' - called before page main
' - check Security
' - set up response header
' - call page load events
'
Public Sub Page_Init()
Security = New cAdvancedSecurity(Me)
If Not Security.IsLoggedIn() Then Security.AutoLogin()
If Not Security.IsLoggedIn() Then
Security.SaveLastUrl()
Page_Terminate("login.aspx")
End If
' Table Permission loading event
Security.TablePermission_Loading()
Security.LoadCurrentUserLevel(TableName)
' Table Permission loaded event
Security.TablePermission_Loaded()
If Not Security.CanList Then
Security.SaveLastUrl()
Page_Terminate("login.aspx")
End If
' User ID loading event
Security.UserID_Loading()
If Security.IsLoggedIn() Then Call Security.LoadUserID()
' User ID loaded event
Security.UserID_Loaded()
ltgFixtureNote.Export = ew_Get("export") ' Get export parameter
ParentPage.gsExport = ltgFixtureNote.Export ' Get export parameter, used in header
ParentPage.gsExportFile = ltgFixtureNote.TableVar ' Get export file, used in header
' Global page loading event (in ewglobal*.vb)
ParentPage.Page_Loading()
' Page load event, used in current page
Page_Load()
End Sub
'
' Class terminate
' - clean up page object
'
Public Sub Dispose() Implements IDisposable.Dispose
Page_Terminate("")
End Sub
'
' Sub Page_Terminate
' - called when exit page
' - clean up connection and objects
' - if URL specified, redirect to URL
'
Sub Page_Terminate(url As String)
' Page unload event, used in current page
Page_Unload()
' Global page unloaded event (in ewglobal*.vb)
ParentPage.Page_Unloaded()
' Close connection
Conn.Dispose()
Security = Nothing
ltgFixtureNote.Dispose()
tblEmployees.Dispose()
ltgFixtureMaster.Dispose()
ListOptions = Nothing
' Go to URL if specified
If url <> "" Then
HttpContext.Current.Response.Clear()
HttpContext.Current.Response.Redirect(url)
End If
End Sub
Public lDisplayRecs As Integer ' Number of display records
Public lStartRec As Integer, lStopRec As Integer, lTotalRecs As Integer, lRecRange As Integer
Public sSrchWhere As String
Public lRecCnt As Integer
Public lEditRowCnt As Integer
Public lRowCnt As Integer, lRowIndex As Integer
Public lOptionCnt As Integer
Public lRecPerRow As Integer, lColCnt As Integer
Public sDeleteConfirmMsg As String ' Delete confirm message
Public sDbMasterFilter As String, sDbDetailFilter As String
Public bMasterRecordExists As Boolean
Public ListOptions As Object
Public sMultiSelectKey As String
Public x_ewPriv As Integer
'
' Page main processing
'
Public Sub Page_Main()
lDisplayRecs = 20
lRecRange = EW_PAGER_RANGE
lRecCnt = 0 ' Record count
' Search filters
Dim sSrchAdvanced As String = "" ' Advanced search filter
Dim sSrchBasic As String = "" ' Basic search filter
Dim sFilter As String = ""
sSrchWhere = "" ' Search WHERE clause
' Master/Detail
sDbMasterFilter = "" ' Master filter
sDbDetailFilter = "" ' Detail filter
If IsPageRequest Then ' Validate request
' Set up records per page dynamically
SetUpDisplayRecs()
' Handle reset command
ResetCmd()
' Set up master detail parameters
SetUpMasterDetail()
' Get basic search criteria
If ParentPage.gsSearchError = "" Then
sSrchBasic = BasicSearchWhere()
End If
' Set Up Sorting Order
SetUpSortOrder()
End If
' Restore display records
If (ltgFixtureNote.RecordsPerPage = -1 OrElse ltgFixtureNote.RecordsPerPage > 0) Then
lDisplayRecs = ltgFixtureNote.RecordsPerPage ' Restore from Session
Else
lDisplayRecs = 20 ' Load default
End If
' Load Sorting Order
LoadSortOrder()
' Build search criteria
If sSrchAdvanced <> "" Then
If sSrchWhere <> "" Then
sSrchWhere = "(" & sSrchWhere & ") AND (" & sSrchAdvanced & ")"
Else
sSrchWhere = sSrchAdvanced
End If
End If
If sSrchBasic <> "" Then
If sSrchWhere <> "" Then
sSrchWhere = "(" & sSrchWhere & ") AND (" & sSrchBasic & ")"
Else
sSrchWhere = sSrchBasic
End If
End If
' Recordset Searching event
ltgFixtureNote.Recordset_Searching(sSrchWhere)
' Save search criteria
If sSrchWhere <> "" Then
If sSrchBasic = "" Then ResetBasicSearchParms()
ltgFixtureNote.SearchWhere = sSrchWhere ' Save to Session
lStartRec = 1 ' Reset start record counter
ltgFixtureNote.StartRecordNumber = lStartRec
Else
RestoreSearchParms()
End If
' Build filter
sFilter = ""
If Not Security.CanList Then
sFilter = "(0=1)" ' Filter all records
End If
' Restore master/detail filter
sDbMasterFilter = ltgFixtureNote.MasterFilter ' Restore master filter
sDbDetailFilter = ltgFixtureNote.DetailFilter ' Restore detail filter
If sDbDetailFilter <> "" Then
If sFilter <> "" Then
sFilter = "(" & sFilter & ") AND (" & sDbDetailFilter & ")"
Else
sFilter = sDbDetailFilter
End If
End If
If sSrchWhere <> "" Then
If sFilter <> "" Then
sFilter = "(" & sFilter & ") AND (" & sSrchWhere & ")"
Else
sFilter = sSrchWhere
End If
End If
Dim RsMaster As OleDbDataReader
' Load master record
If ltgFixtureNote.MasterFilter <> "" AndAlso ltgFixtureNote.CurrentMasterTable = "ltgFixtureMaster" Then
RsMaster = ltgFixtureMaster.LoadRs(sDbMasterFilter)
bMasterRecordExists = RsMaster IsNot Nothing
If Not bMasterRecordExists Then
ltgFixtureNote.MasterFilter = "" ' Clear master filter
ltgFixtureNote.DetailFilter = "" ' Clear detail filter
Message = "No records found" ' Set no record found
Page_Terminate(ltgFixtureNote.ReturnUrl) ' Return to caller
Else
RsMaster.Read()
ltgFixtureMaster.LoadListRowValues(RsMaster)
ltgFixtureMaster.RowType = EW_ROWTYPE_MASTER ' Master row
ltgFixtureMaster.RenderListRow()
RsMaster.Close()
RsMaster.Dispose()
End If
End If
' Set up filter in Session
ltgFixtureNote.SessionWhere = sFilter
ltgFixtureNote.CurrentFilter = ""
End Sub
'
' Set up number of records displayed per page
'
Sub SetUpDisplayRecs()
Dim sWrk As String
sWrk = ew_Get(EW_TABLE_REC_PER_PAGE)
If sWrk <> "" Then
If IsNumeric(sWrk) Then
lDisplayRecs = ew_ConvertToInt(sWrk)
Else
If ew_SameText(sWrk, "all") Then ' Display all records
lDisplayRecs = -1
Else
lDisplayRecs = 20 ' Non-numeric, load default
End If
End If
ltgFixtureNote.RecordsPerPage = lDisplayRecs ' Save to Session
' Reset start position
lStartRec = 1
ltgFixtureNote.StartRecordNumber = lStartRec
End If
End Sub
'
' Return Basic Search SQL
'
Function BasicSearchSQL(Keyword As String) As String
Dim sKeyword As String, sSql As String = ""
sKeyword = ew_AdjustSql(Keyword)
sSql = sSql & "[notShortDesc] LIKE '%" & sKeyword & "%' OR "
sSql = sSql & "[notNote] LIKE '%" & sKeyword & "%' OR "
sSql = sSql & "[notCreatedBy] LIKE '%" & sKeyword & "%' OR "
sSql = sSql & "[notModifiedBy] LIKE '%" & sKeyword & "%' OR "
If sSql.EndsWith(" OR ") Then sSql = sSql.SubString(0, sSql.Length-4)
Return sSql
End Function
'
' Return Basic Search WHERE based on search keyword and type
'
Function BasicSearchWhere() As String
Dim sSearchStr As String = "", sSearchKeyword As String, sSearchType As String
Dim sSearch As String, arKeyword() As String, sKeyword As String
If Not Security.CanSearch Then Return ""
sSearchKeyword = ew_Get(EW_TABLE_BASIC_SEARCH)
sSearchType = ew_Get(EW_TABLE_BASIC_SEARCH_TYPE)
If sSearchKeyword <> "" Then
sSearch = sSearchKeyword.Trim()
If sSearchType <> "" Then
While InStr(sSearch, " ") > 0
sSearch = sSearch.Replace(" ", " ")
End While
arKeyword = sSearch.Trim().Split(New Char() {" "c})
For Each sKeyword In arKeyword
If sSearchStr <> "" Then sSearchStr = sSearchStr & " " & sSearchType & " "
sSearchStr = sSearchStr & "(" & BasicSearchSQL(sKeyword) & ")"
Next
Else
sSearchStr = BasicSearchSQL(sSearch)
End If
End If
If sSearchKeyword <> "" then
ltgFixtureNote.BasicSearchKeyword = sSearchKeyword
ltgFixtureNote.BasicSearchType = sSearchType
End If
Return sSearchStr
End Function
'
' Clear all search parameters
'
Sub ResetSearchParms()
' Clear search where
sSrchWhere = ""
ltgFixtureNote.SearchWhere = sSrchWhere
' Clear basic search parameters
ResetBasicSearchParms()
End Sub
'
' Clear all basic search parameters
'
Sub ResetBasicSearchParms()
' Clear basic search parameters
ltgFixtureNote.BasicSearchKeyword = ""
ltgFixtureNote.BasicSearchType = ""
End Sub
'
' Restore all search parameters
'
Sub RestoreSearchParms()
sSrchWhere = ltgFixtureNote.SearchWhere
End Sub
'
' Set up Sort parameters based on Sort Links clicked
'
Sub SetUpSortOrder()
Dim sOrderBy As String
Dim sSortField As String, sLastSort As String, sThisSort As String
Dim bCtrl As Boolean
' Check for Ctrl pressed
bCtrl = (ew_Get("ctrl") <> "")
' Check for an Order parameter
If ew_Get("order") <> "" Then
ltgFixtureNote.CurrentOrder = ew_Get("order")
ltgFixtureNote.CurrentOrderType = ew_Get("ordertype")
ltgFixtureNote.UpdateSort(ltgFixtureNote.notFixID, bCtrl) ' notFixID
ltgFixtureNote.UpdateSort(ltgFixtureNote.notTypeID, bCtrl) ' notTypeID
ltgFixtureNote.UpdateSort(ltgFixtureNote.notDate, bCtrl) ' notDate
ltgFixtureNote.UpdateSort(ltgFixtureNote.notShortDesc, bCtrl) ' notShortDesc
ltgFixtureNote.UpdateSort(ltgFixtureNote.notLPRStatusID, bCtrl) ' notLPRStatusID
ltgFixtureNote.UpdateSort(ltgFixtureNote.notPriority, bCtrl) ' notPriority
ltgFixtureNote.UpdateSort(ltgFixtureNote.notIsActive, bCtrl) ' notIsActive
ltgFixtureNote.StartRecordNumber = 1 ' Reset start position
End If
End Sub
'
' Load Sort Order parameters
'
Sub LoadSortOrder()
Dim sOrderBy As String
sOrderBy = ltgFixtureNote.SessionOrderBy ' Get order by from Session
If sOrderBy = "" Then
If ltgFixtureNote.SqlOrderBy <> "" Then
sOrderBy = ltgFixtureNote.SqlOrderBy
ltgFixtureNote.SessionOrderBy = sOrderBy
End If
End If
End Sub
'
' Reset command based on querystring parameter "cmd"
' - reset: reset search parameters
' - resetall: reset search and master/detail parameters
' - resetsort: reset sort parameters
'
Sub ResetCmd()
Dim sCmd As String
' Get reset cmd
If ew_Get("cmd") <> "" Then
sCmd = ew_Get("cmd")
' Reset search criteria
If ew_SameText(sCmd, "reset") OrElse ew_SameText(sCmd, "resetall") Then
ResetSearchParms()
End If
' Reset master/detail keys
If ew_SameText(sCmd, "resetall") Then
ltgFixtureNote.CurrentMasterTable = "" ' Clear master table
ltgFixtureNote.MasterFilter = "" ' Clear master filter
sDbMasterFilter = ""
ltgFixtureNote.DetailFilter = "" ' Clear detail filter
sDbDetailFilter = ""
ltgFixtureNote.notFixID.SessionValue = ""
End If
' Reset sort criteria
If ew_SameText(sCmd, "resetsort") Then
Dim sOrderBy As String = ""
ltgFixtureNote.SessionOrderBy = sOrderBy
ltgFixtureNote.notFixID.Sort = ""
ltgFixtureNote.notTypeID.Sort = ""
ltgFixtureNote.notDate.Sort = ""
ltgFixtureNote.notShortDesc.Sort = ""
ltgFixtureNote.notLPRStatusID.Sort = ""
ltgFixtureNote.notPriority.Sort = ""
ltgFixtureNote.notIsActive.Sort = ""
End If
' Reset start position
lStartRec = 1
ltgFixtureNote.StartRecordNumber = lStartRec
End If
End Sub
Public Pager As Object
'
' Set up Starting Record parameters
'
Sub SetUpStartRec()
Dim nPageNo As Integer
' Exit if lDisplayRecs = 0
If lDisplayRecs = 0 Then Exit Sub
If IsPageRequest Then ' Validate request
' Check for a "start" parameter
If ew_Get(EW_TABLE_START_REC) <> "" AndAlso IsNumeric(ew_Get(EW_TABLE_START_REC)) Then
lStartRec = ew_ConvertToInt(ew_Get(EW_TABLE_START_REC))
ltgFixtureNote.StartRecordNumber = lStartRec
ElseIf ew_Get(EW_TABLE_PAGE_NO) <> "" AndAlso IsNumeric(ew_Get(EW_TABLE_PAGE_NO)) Then
nPageNo = ew_ConvertToInt(ew_Get(EW_TABLE_PAGE_NO))
lStartRec = (nPageNo-1)*lDisplayRecs+1
If lStartRec <= 0 Then
lStartRec = 1
ElseIf lStartRec >= ((lTotalRecs-1)\lDisplayRecs)*lDisplayRecs+1 Then
lStartRec = ((lTotalRecs-1)\lDisplayRecs)*lDisplayRecs+1
End If
ltgFixtureNote.StartRecordNumber = lStartRec
End If
End If
lStartRec = ltgFixtureNote.StartRecordNumber
' Check if correct start record counter
If lStartRec <= 0 Then ' Avoid invalid start record counter
lStartRec = 1 ' Reset start record counter
ltgFixtureNote.StartRecordNumber = lStartRec
ElseIf lStartRec > lTotalRecs Then ' Avoid starting record > total records
lStartRec = ((lTotalRecs-1)\lDisplayRecs)*lDisplayRecs+1 ' Point to last page first record
ltgFixtureNote.StartRecordNumber = lStartRec
ElseIf (lStartRec-1) Mod lDisplayRecs <> 0 Then
lStartRec = ((lStartRec-1)\lDisplayRecs)*lDisplayRecs+1 ' Point to page boundary
ltgFixtureNote.StartRecordNumber = lStartRec
End If
End Sub
'
' Load default values
'
Sub LoadDefaultValues()
ltgFixtureNote.notIsActive.CurrentValue = 1
End Sub
'
' Load recordset
'
Function LoadRecordset() As OleDbDataReader
' Recordset Selecting event
ltgFixtureNote.Recordset_Selecting(ltgFixtureNote.CurrentFilter)
' Load list page SQL
Dim sSql As String = ltgFixtureNote.ListSQL
' Write SQL for debug
If EW_DEBUG_ENABLED Then ew_Write(sSql)
' Count
lTotalRecs = -1
Try
If sSql.StartsWith("SELECT * FROM ", StringComparison.InvariantCultureIgnoreCase) AndAlso _
ew_Empty(ltgFixtureNote.SqlGroupBy) AndAlso _
ew_Empty(ltgFixtureNote.SqlHaving) Then
Dim sCntSql As String = ltgFixtureNote.SelectCountSQL
' Write SQL for debug
If EW_DEBUG_ENABLED Then ew_Write("<br>" & sCntSql)
lTotalRecs = Conn.ExecuteScalar(sCntSql)
End If
Catch
End Try
' Load recordset
Dim Rs As OleDbDataReader = Conn.GetDataReader(sSql)
If lTotalRecs < 0 AndAlso Rs.HasRows Then
lTotalRecs = 0
While Rs.Read()
lTotalRecs = lTotalRecs + 1
End While
Rs.Close()
Rs = Conn.GetDataReader(sSql)
End If
' Recordset Selected event
ltgFixtureNote.Recordset_Selected(Rs)
Return Rs
End Function
'
' Load row based on key values
'
Function LoadRow() As Boolean
Dim RsRow As OleDbDataReader
Dim sFilter As String = ltgFixtureNote.KeyFilter
' Row Selecting event
ltgFixtureNote.Row_Selecting(sFilter)
' Load SQL based on filter
ltgFixtureNote.CurrentFilter = sFilter
Dim sSql As String = ltgFixtureNote.SQL
' Write SQL for debug
If EW_DEBUG_ENABLED Then ew_Write(sSql)
Try
RsRow = Conn.GetTempDataReader(sSql)
If Not RsRow.Read() Then
Return False
Else
LoadRowValues(RsRow) ' Load row values
' Row Selected event
ltgFixtureNote.Row_Selected(RsRow)
Return True
End If
Catch
If EW_DEBUG_ENABLED Then Throw
Return False
Finally
Conn.CloseTempDataReader()
End Try
End Function
'
' Load row values from recordset
'
Sub LoadRowValues(ByRef RsRow As OleDbDataReader)
ltgFixtureNote.notID.DbValue = RsRow("notID")
ltgFixtureNote.notFixID.DbValue = RsRow("notFixID")
ltgFixtureNote.notTypeID.DbValue = RsRow("notTypeID")
ltgFixtureNote.notDate.DbValue = RsRow("notDate")
ltgFixtureNote.notShortDesc.DbValue = RsRow("notShortDesc")
ltgFixtureNote.notNote.DbValue = RsRow("notNote")
ltgFixtureNote.notLPRStatusID.DbValue = RsRow("notLPRStatusID")
ltgFixtureNote.notPriority.DbValue = RsRow("notPriority")
ltgFixtureNote.notIsActive.DbValue = IIf(ew_ConvertToBool(RsRow("notIsActive")), "1", "0")
ltgFixtureNote.notCreatedBy.DbValue = RsRow("notCreatedBy")
ltgFixtureNote.notCreatedOn.DbValue = RsRow("notCreatedOn")
ltgFixtureNote.notModifiedBy.DbValue = RsRow("notModifiedBy")
ltgFixtureNote.notModifiedOn.DbValue = RsRow("notModifiedOn")
End Sub
'
' Render row values based on field settings
'
Sub RenderRow()
' Row Rendering event
ltgFixtureNote.Row_Rendering()
'
' Common render codes for all row types
'
' notFixID
ltgFixtureNote.notFixID.CellCssStyle = ""
ltgFixtureNote.notFixID.CellCssClass = ""
' notTypeID
ltgFixtureNote.notTypeID.CellCssStyle = ""
ltgFixtureNote.notTypeID.CellCssClass = ""
' notDate
ltgFixtureNote.notDate.CellCssStyle = ""
ltgFixtureNote.notDate.CellCssClass = ""
' notShortDesc
ltgFixtureNote.notShortDesc.CellCssStyle = ""
ltgFixtureNote.notShortDesc.CellCssClass = ""
' notLPRStatusID
ltgFixtureNote.notLPRStatusID.CellCssStyle = ""
ltgFixtureNote.notLPRStatusID.CellCssClass = ""
' notPriority
ltgFixtureNote.notPriority.CellCssStyle = ""
ltgFixtureNote.notPriority.CellCssClass = ""
' notIsActive
ltgFixtureNote.notIsActive.CellCssStyle = ""
ltgFixtureNote.notIsActive.CellCssClass = ""
'
' View Row
'
If ltgFixtureNote.RowType = EW_ROWTYPE_VIEW Then ' View row
' notID
ltgFixtureNote.notID.ViewValue = ltgFixtureNote.notID.CurrentValue
ltgFixtureNote.notID.CssStyle = ""
ltgFixtureNote.notID.CssClass = ""
ltgFixtureNote.notID.ViewCustomAttributes = ""
' notFixID
ltgFixtureNote.notFixID.ViewValue = ltgFixtureNote.notFixID.CurrentValue
ltgFixtureNote.notFixID.CssStyle = ""
ltgFixtureNote.notFixID.CssClass = ""
ltgFixtureNote.notFixID.ViewCustomAttributes = ""
' notTypeID
If ew_NotEmpty(ltgFixtureNote.notTypeID.CurrentValue) Then
sSqlWrk = "SELECT [ntyDescription] FROM [ltgFixtureNoteType] WHERE [ntyID] = " & ew_AdjustSql(ltgFixtureNote.notTypeID.CurrentValue) & ""
sSqlWrk = sSqlWrk & " AND (" & "[ntyIsActive]=True" & ")"
sSqlWrk = sSqlWrk & " ORDER BY [ntyDescription] "
RsWrk = Conn.GetTempDataReader(sSqlWrk)
If RsWrk.Read() Then
ltgFixtureNote.notTypeID.ViewValue = RsWrk("ntyDescription")
Else
ltgFixtureNote.notTypeID.ViewValue = ltgFixtureNote.notTypeID.CurrentValue
End If
Conn.CloseTempDataReader()
Else
ltgFixtureNote.notTypeID.ViewValue = System.DBNull.Value
End If
ltgFixtureNote.notTypeID.CssStyle = ""
ltgFixtureNote.notTypeID.CssClass = ""
ltgFixtureNote.notTypeID.ViewCustomAttributes = ""
' notDate
ltgFixtureNote.notDate.ViewValue = ltgFixtureNote.notDate.CurrentValue
ltgFixtureNote.notDate.ViewValue = ew_FormatDateTime(ltgFixtureNote.notDate.ViewValue, 6)
ltgFixtureNote.notDate.CssStyle = ""
ltgFixtureNote.notDate.CssClass = ""
ltgFixtureNote.notDate.ViewCustomAttributes = ""
' notShortDesc
ltgFixtureNote.notShortDesc.ViewValue = ltgFixtureNote.notShortDesc.CurrentValue
ltgFixtureNote.notShortDesc.CssStyle = ""
ltgFixtureNote.notShortDesc.CssClass = ""
ltgFixtureNote.notShortDesc.ViewCustomAttributes = ""
' notLPRStatusID
If ew_NotEmpty(ltgFixtureNote.notLPRStatusID.CurrentValue) Then
sSqlWrk = "SELECT [lstDescription] FROM [tblLPRStatus] WHERE [lstID] = " & ew_AdjustSql(ltgFixtureNote.notLPRStatusID.CurrentValue) & ""
sSqlWrk = sSqlWrk & " AND (" & "[lstIsActive]=True" & ")"
sSqlWrk = sSqlWrk & " ORDER BY [lstDescription] "
RsWrk = Conn.GetTempDataReader(sSqlWrk)
If RsWrk.Read() Then
ltgFixtureNote.notLPRStatusID.ViewValue = RsWrk("lstDescription")
Else
ltgFixtureNote.notLPRStatusID.ViewValue = ltgFixtureNote.notLPRStatusID.CurrentValue
End If
Conn.CloseTempDataReader()
Else
ltgFixtureNote.notLPRStatusID.ViewValue = System.DBNull.Value
End If
ltgFixtureNote.notLPRStatusID.CssStyle = ""
ltgFixtureNote.notLPRStatusID.CssClass = ""
ltgFixtureNote.notLPRStatusID.ViewCustomAttributes = ""
' notPriority
If Not IsDBNull(ltgFixtureNote.notPriority.CurrentValue) Then
Select Case ltgFixtureNote.notPriority.CurrentValue
Case "1"
ltgFixtureNote.notPriority.ViewValue = "High"
Case "2"
ltgFixtureNote.notPriority.ViewValue = "Medium"
Case "3"
ltgFixtureNote.notPriority.ViewValue = "Low"
Case Else
ltgFixtureNote.notPriority.ViewValue = ltgFixtureNote.notPriority.CurrentValue
End Select
Else
ltgFixtureNote.notPriority.ViewValue = System.DBNull.Value
End If
ltgFixtureNote.notPriority.CssStyle = ""
ltgFixtureNote.notPriority.CssClass = ""
ltgFixtureNote.notPriority.ViewCustomAttributes = ""
' notIsActive
If Convert.ToString(ltgFixtureNote.notIsActive.CurrentValue) = "1" Then
ltgFixtureNote.notIsActive.ViewValue = "Yes"
Else
ltgFixtureNote.notIsActive.ViewValue = "No"
End If
ltgFixtureNote.notIsActive.CssStyle = ""
ltgFixtureNote.notIsActive.CssClass = ""
ltgFixtureNote.notIsActive.ViewCustomAttributes = ""
' notCreatedBy
ltgFixtureNote.notCreatedBy.ViewValue = ltgFixtureNote.notCreatedBy.CurrentValue
ltgFixtureNote.notCreatedBy.CssStyle = ""
ltgFixtureNote.notCreatedBy.CssClass = ""
ltgFixtureNote.notCreatedBy.ViewCustomAttributes = ""
' notCreatedOn
ltgFixtureNote.notCreatedOn.ViewValue = ltgFixtureNote.notCreatedOn.CurrentValue
ltgFixtureNote.notCreatedOn.ViewValue = ew_FormatDateTime(ltgFixtureNote.notCreatedOn.ViewValue, 6)
ltgFixtureNote.notCreatedOn.CssStyle = ""
ltgFixtureNote.notCreatedOn.CssClass = ""
ltgFixtureNote.notCreatedOn.ViewCustomAttributes = ""
' notModifiedBy
ltgFixtureNote.notModifiedBy.ViewValue = ltgFixtureNote.notModifiedBy.CurrentValue
ltgFixtureNote.notModifiedBy.CssStyle = ""
ltgFixtureNote.notModifiedBy.CssClass = ""
ltgFixtureNote.notModifiedBy.ViewCustomAttributes = ""
' notModifiedOn
ltgFixtureNote.notModifiedOn.ViewValue = ltgFixtureNote.notModifiedOn.CurrentValue
ltgFixtureNote.notModifiedOn.ViewValue = ew_FormatDateTime(ltgFixtureNote.notModifiedOn.ViewValue, 6)
ltgFixtureNote.notModifiedOn.CssStyle = ""
ltgFixtureNote.notModifiedOn.CssClass = ""
ltgFixtureNote.notModifiedOn.ViewCustomAttributes = ""
' View refer script
' notFixID
ltgFixtureNote.notFixID.HrefValue = ""
' notTypeID
ltgFixtureNote.notTypeID.HrefValue = ""
' notDate
ltgFixtureNote.notDate.HrefValue = ""
' notShortDesc
ltgFixtureNote.notShortDesc.HrefValue = ""
' notLPRStatusID
ltgFixtureNote.notLPRStatusID.HrefValue = ""
' notPriority
ltgFixtureNote.notPriority.HrefValue = ""
' notIsActive
ltgFixtureNote.notIsActive.HrefValue = ""
End If
' Row Rendered event
ltgFixtureNote.Row_Rendered()
End Sub
'
' Set up Master Detail based on querystring parameter
'
Sub SetUpMasterDetail()
Dim bValidMaster As Boolean = False, sMasterTblVar As String
' Get the keys for master table
If ew_Get(EW_TABLE_SHOW_MASTER) <> "" Then
sMasterTblVar = ew_Get(EW_TABLE_SHOW_MASTER)
If sMasterTblVar = "" Then
bValidMaster = True
sDbMasterFilter = ""
sDbDetailFilter = ""
End If
If sMasterTblVar = "ltgFixtureMaster" Then
bValidMaster = True
sDbMasterFilter = ltgFixtureNote.SqlMasterFilter_ltgFixtureMaster
sDbDetailFilter = ltgFixtureNote.SqlDetailFilter_ltgFixtureMaster
If ew_Get("lfxID") <> "" Then
ltgFixtureMaster.lfxID.QueryStringValue = ew_Get("lfxID")
ltgFixtureNote.notFixID.QueryStringValue = ltgFixtureMaster.lfxID.QueryStringValue
ltgFixtureNote.notFixID.SessionValue = ltgFixtureNote.notFixID.QueryStringValue
If Not IsNumeric(ltgFixtureMaster.lfxID.QueryStringValue) Then bValidMaster = False
sDbMasterFilter = sDbMasterFilter.Replace("@lfxID@", ew_AdjustSql(ltgFixtureMaster.lfxID.QueryStringValue))
sDbDetailFilter = sDbDetailFilter.Replace("@notFixID@", ew_AdjustSql(ltgFixtureMaster.lfxID.QueryStringValue))
Else
bValidMaster = False
End If
End If
End If
If bValidMaster Then
' Save current master table
ltgFixtureNote.CurrentMasterTable = sMasterTblVar
' Reset start record counter (new master key)
lStartRec = 1
ltgFixtureNote.StartRecordNumber = lStartRec
ltgFixtureNote.MasterFilter = sDbMasterFilter ' Set up master filter
ltgFixtureNote.DetailFilter = sDbDetailFilter ' Set up detail filter
' Clear previous master session values
If sMasterTblVar <> "ltgFixtureMaster" Then
If ltgFixtureNote.notFixID.QueryStringValue = "" Then ltgFixtureNote.notFixID.SessionValue = ""
End If
End If
End Sub
' Page Load event
Public Sub Page_Load()
'HttpContext.Current.Response.Write("Page Load")
End Sub
' Page Unload event
Public Sub Page_Unload()
'HttpContext.Current.Response.Write("Page Unload")
End Sub
' Form Custom Validate event
Public Function Form_CustomValidate(ByRef CustomError As String) As Boolean
'Return error message in CustomError
Return True
End Function
End Class
'
' ASP.NET Page_Load event
'
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
Response.Buffer = EW_RESPONSE_BUFFER
Response.Cache.SetCacheability(HttpCacheability.NoCache)
' Page init
ltgFixtureNote_list = New cltgFixtureNote_list(Me)
ltgFixtureNote_list.Page_Init()
' Page main processing
ltgFixtureNote_list.Page_Main()
End Sub
'
' ASP.NET Page_Unload event
'
Protected Sub Page_Unload(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Unload
' Dispose page object
If ltgFixtureNote_list IsNot Nothing Then ltgFixtureNote_list.Dispose()
End Sub
End Class