home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
66.142.0.142
/
66.142.0.142.tar
/
66.142.0.142
/
askScheduleRecurringform.aspx.vb
< prev
next >
Wrap
Text File
|
2014-11-09
|
49KB
|
967 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 askScheduleRecurringform
Inherits AspNetMaker7_tfpssnet
' Page object
Public askScheduleRecurring_form As caskScheduleRecurring_form
'
' Page Class
'
Class caskScheduleRecurring_form
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 askScheduleReport.UseTokenInUrl Then Url = Url & "t=" & askScheduleReport.TableVar & "&" ' Add page token
Return Url
End Get
End Property
' Validate page request
Public Function IsPageRequest() As Boolean
Dim Result As Boolean
If askScheduleReport.UseTokenInUrl Then
Result = False
If ObjForm IsNot Nothing Then
Result = (askScheduleReport.TableVar = ObjForm.GetValue("t"))
End If
If ew_Get("t") <> "" Then
Result = (askScheduleReport.TableVar = ew_Get("t"))
End If
Return Result
End If
Return True
End Function
' askScheduleReport
Public Property askScheduleReport() As caskScheduleReport
Get
Return ParentPage.askScheduleReport
End Get
Set(ByVal v As caskScheduleReport)
ParentPage.askScheduleReport = v
End Set
End Property
' askScheduleReport
Public Property tblEmployees() As ctblEmployees
Get
Return ParentPage.tblEmployees
End Get
Set(ByVal v As ctblEmployees)
ParentPage.tblEmployees = v
End Set
End Property
' askScheduleReport
Public Property tblEvents() As ctblEvents
Get
Return ParentPage.tblEvents
End Get
Set(ByVal v As ctblEvents)
ParentPage.tblEvents = 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 = "askScheduleRecurring_form"
m_PageObjTypeName = "caskScheduleRecurring_form"
' Table Name
m_TableName = "askScheduleReport"
' Initialize table object
askScheduleReport = New caskScheduleReport(Me)
tblEmployees = New ctblEmployees(Me)
tblEvents = New ctblEvents(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()
askScheduleReport.Export = ew_Get("export") ' Get export parameter
ParentPage.gsExport = askScheduleReport.Export ' Get export parameter, used in header
ParentPage.gsExportFile = askScheduleReport.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(ByVal 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
askScheduleReport.Dispose()
tblEmployees.Dispose()
tblEvents.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()
If IsPageRequest() Then ' Validate request
Dim sDate As String, eDate As String, sPartsID As Integer, sEmployeeID As Long, sEventsID As Long, sCallTime As DateTime, sStartTime As DateTime
Dim sEndTime As DateTime, sOutTime As DateTime, sLocID As Integer, sPosID As Integer, sTypID As Integer, sDepID As Integer, sRate As Double
Dim sNotes As String, tmpDate As DateTime, tmpCount As Integer, strSQL As String, bUpdateFlag As Boolean, arRecKeys As String(), i As Integer
Dim tmpCallTime As String, tmpStartTime As String, tmpEndTime As String, tmpOutTime As String, tmpBiWeekly As String, tmpDayNum As Integer
ReDim arRecKeys(42)
If ew_Get("t") = "e" Then
'askScheduleReport.schCallTime.FormValue = ew_Get("x_schCallTime")
End If
If ew_Get("t") = "u" Then
tmpCallTime = ew_Get("x_schCallTime")
tmpStartTime = ew_Get("x_schStartTime")
tmpEndTime = ew_Get("x_schEndTime")
tmpOutTime = ew_Get("x_schOutTime")
' Validate Form
If Not ValidateTimes(tmpCallTime, tmpStartTime, tmpEndTime, tmpOutTime) Then
Message = ParentPage.gsFormError
askScheduleReport.schEvtID.EditValue = ew_Get("x_schEvtID")
askScheduleReport.schPartsID.EditValue = ew_Get("x_schPartsID")
'askScheduleReport.schCallTime.EditValue = tmpCallTime
'askScheduleReport.schStartTime.EditValue = tmpStartTime
'askScheduleReport.schEndTime.EditValue = tmpEndTime
'askScheduleReport.schOutTime.EditValue = tmpOutTime
askScheduleReport.schLocID.EditValue = ew_Get("x_schLocID")
askScheduleReport.schEmpID.EditValue = ew_Get("x_schEmpID")
askScheduleReport.schPosID.EditValue = ew_Get("x_schPosID")
askScheduleReport.schTypID.EditValue = ew_Get("x_schTypID")
askScheduleReport.schDepID.EditValue = ew_Get("x_schDepID")
askScheduleReport.schNotes.EditValue = ew_Get("x_schNotes")
askScheduleReport.RowType = 1
ew_Session("x_startDate") = ew_Get("x_startDate")
ew_Session("x_endDate") = ew_Get("x_endDate")
ew_Session("x_schEvtID") = ew_Get("x_schEvtID")
ew_Session("x_schPartsID") = ew_Get("x_schPartsID")
ew_Session("x_schCallTime") = tmpCallTime
ew_Session("x_schStartTime") = tmpStartTime
ew_Session("x_schEndTime") = tmpEndTime
ew_Session("x_schOutTime") = tmpOutTime
ew_Session("x_schLocID") = ew_Get("x_schLodID")
ew_Session("x_schEmpID") = ew_Get("x_schEmpID")
ew_Session("x_schPosID") = ew_Get("x_schPosID")
ew_Session("x_schTypID") = ew_Get("x_schTypID")
ew_Session("x_schDepID") = ew_Get("x_schDepID")
ew_Session("x_schNotes") = ew_Get("x_schNotes")
ew_Session("biweekly") = ew_Get("x_biweekly")
Exit Sub
End If
For i = 1 To 42
arRecKeys(i) = ew_Get("key_" & i)
Next
Dim tlcsub As New AspNetMaker7_tfpssnet
sDate = ew_Get("x_startDate")
eDate = ew_Get("x_endDate")
sEventsID = ew_Get("x_schEvtID")
sPartsID = ew_Get("x_schPartsID")
'sCallTime = ew_Get("x_schCallTime")
'sStartTime = ew_Get("x_schStartTime")
'sEndTime = ew_Get("x_schEndTime")
'sOutTime = ew_Get("x_schOutTime")
sCallTime = sDate & " " & tmpCallTime
sStartTime = sDate & " " & tmpStartTime
sEndTime = sDate & " " & tmpEndTime
sOutTime = sDate & " " & tmpOutTime
sLocID = ew_Get("x_schLocID")
sEmployeeID = ew_Get("x_schEmpID")
sPosID = ew_Get("x_schPosID")
sTypID = ew_Get("x_schTypID")
sDepID = ew_Get("x_schDepID")
sNotes = Replace(ew_Get("x_schNotes"), "'", "''")
tmpDate = sDate
tmpBiWeekly = ew_Get("x_biweekly")
While tmpDate <= eDate
bUpdateFlag = False
If tmpBiWeekly <> "Y" Then
Select Case tmpDate.DayOfWeek
Case 0 'sunday
If arRecKeys(1) = "1" Then bUpdateFlag = True 'all Sundays
If arRecKeys(8) = "8" Then '1st Sunday
If tlcsub.tlcGetXDay(0, 1, Month(tmpDate), Year(tmpDate)) = Day(tmpDate) Then bUpdateFlag = True
End If
If arRecKeys(15) = "15" Then '2nd Sunday
If tlcsub.tlcGetXDay(0, 2, Month(tmpDate), Year(tmpDate)) = Day(tmpDate) Then bUpdateFlag = True
End If
If arRecKeys(22) = "22" Then '3rd Sunday
If tlcsub.tlcGetXDay(0, 3, Month(tmpDate), Year(tmpDate)) = Day(tmpDate) Then bUpdateFlag = True
End If
If arRecKeys(29) = "29" Then '4th Sunday
If tlcsub.tlcGetXDay(0, 4, Month(tmpDate), Year(tmpDate)) = Day(tmpDate) Then bUpdateFlag = True
End If
If arRecKeys(36) = "36" Then '5th Sunday
If tlcsub.tlcGetXDay(0, 5, Month(tmpDate), Year(tmpDate)) = Day(tmpDate) Then bUpdateFlag = True
End If
Case 1 'monday
If arRecKeys(2) = "2" Then bUpdateFlag = True
If arRecKeys(9) = "9" Then '1st Monday
If tlcsub.tlcGetXDay(1, 1, Month(tmpDate), Year(tmpDate)) = Day(tmpDate) Then bUpdateFlag = True
End If
If arRecKeys(16) = "16" Then '2nd Monday
If tlcsub.tlcGetXDay(1, 2, Month(tmpDate), Year(tmpDate)) = Day(tmpDate) Then bUpdateFlag = True
End If
If arRecKeys(23) = "23" Then '3rd Monday
If tlcsub.tlcGetXDay(1, 3, Month(tmpDate), Year(tmpDate)) = Day(tmpDate) Then bUpdateFlag = True
End If
If arRecKeys(30) = "30" Then '4th Monday
If tlcsub.tlcGetXDay(1, 4, Month(tmpDate), Year(tmpDate)) = Day(tmpDate) Then bUpdateFlag = True
End If
If arRecKeys(37) = "37" Then '5th Monday
If tlcsub.tlcGetXDay(1, 5, Month(tmpDate), Year(tmpDate)) = Day(tmpDate) Then bUpdateFlag = True
End If
Case 2 'tuesday
If arRecKeys(3) = "3" Then bUpdateFlag = True
If arRecKeys(10) = "10" Then '1st Tuesday
If tlcsub.tlcGetXDay(2, 1, Month(tmpDate), Year(tmpDate)) = Day(tmpDate) Then bUpdateFlag = True
End If
If arRecKeys(17) = "17" Then '2nd Tuesday
If tlcsub.tlcGetXDay(2, 2, Month(tmpDate), Year(tmpDate)) = Day(tmpDate) Then bUpdateFlag = True
End If
If arRecKeys(24) = "24" Then '3rd Tuesday
If tlcsub.tlcGetXDay(2, 3, Month(tmpDate), Year(tmpDate)) = Day(tmpDate) Then bUpdateFlag = True
End If
If arRecKeys(31) = "31" Then '4th Tuesday
If tlcsub.tlcGetXDay(2, 4, Month(tmpDate), Year(tmpDate)) = Day(tmpDate) Then bUpdateFlag = True
End If
If arRecKeys(38) = "38" Then '5th Tuesday
If tlcsub.tlcGetXDay(2, 5, Month(tmpDate), Year(tmpDate)) = Day(tmpDate) Then bUpdateFlag = True
End If
Case 3 'wednesday
If arRecKeys(4) = "4" Then bUpdateFlag = True
If arRecKeys(11) = "11" Then '1st Wednesday
If tlcsub.tlcGetXDay(3, 1, Month(tmpDate), Year(tmpDate)) = Day(tmpDate) Then bUpdateFlag = True
End If
If arRecKeys(18) = "18" Then '2nd Wednesday
If tlcsub.tlcGetXDay(3, 2, Month(tmpDate), Year(tmpDate)) = Day(tmpDate) Then bUpdateFlag = True
End If
If arRecKeys(25) = "25" Then '3rd Wednesday
If tlcsub.tlcGetXDay(3, 3, Month(tmpDate), Year(tmpDate)) = Day(tmpDate) Then bUpdateFlag = True
End If
If arRecKeys(32) = "32" Then '4th Wednesday
If tlcsub.tlcGetXDay(3, 4, Month(tmpDate), Year(tmpDate)) = Day(tmpDate) Then bUpdateFlag = True
End If
If arRecKeys(39) = "39" Then '5th Wednesday
If tlcsub.tlcGetXDay(3, 5, Month(tmpDate), Year(tmpDate)) = Day(tmpDate) Then bUpdateFlag = True
End If
Case 4 'thursday
If arRecKeys(5) = "5" Then bUpdateFlag = True
If arRecKeys(12) = "12" Then '1st Thursday
If tlcsub.tlcGetXDay(4, 1, Month(tmpDate), Year(tmpDate)) = Day(tmpDate) Then bUpdateFlag = True
End If
If arRecKeys(19) = "19" Then '2nd Thursday
If tlcsub.tlcGetXDay(4, 2, Month(tmpDate), Year(tmpDate)) = Day(tmpDate) Then bUpdateFlag = True
End If
If arRecKeys(26) = "26" Then '3rd Thursday
If tlcsub.tlcGetXDay(4, 3, Month(tmpDate), Year(tmpDate)) = Day(tmpDate) Then bUpdateFlag = True
End If
If arRecKeys(33) = "33" Then '4th Thursday
If tlcsub.tlcGetXDay(4, 4, Month(tmpDate), Year(tmpDate)) = Day(tmpDate) Then bUpdateFlag = True
End If
If arRecKeys(40) = "40" Then '5th Thursday
If tlcsub.tlcGetXDay(4, 5, Month(tmpDate), Year(tmpDate)) = Day(tmpDate) Then bUpdateFlag = True
End If
Case 5 'friday
If arRecKeys(6) = "6" Then bUpdateFlag = True
If arRecKeys(13) = "13" Then '1st Friday
If tlcsub.tlcGetXDay(5, 1, Month(tmpDate), Year(tmpDate)) = Day(tmpDate) Then bUpdateFlag = True
End If
If arRecKeys(20) = "20" Then '2nd Friday
If tlcsub.tlcGetXDay(5, 2, Month(tmpDate), Year(tmpDate)) = Day(tmpDate) Then bUpdateFlag = True
End If
If arRecKeys(27) = "27" Then '3rd Friday
If tlcsub.tlcGetXDay(5, 3, Month(tmpDate), Year(tmpDate)) = Day(tmpDate) Then bUpdateFlag = True
End If
If arRecKeys(34) = "34" Then '4th Friday
If tlcsub.tlcGetXDay(5, 4, Month(tmpDate), Year(tmpDate)) = Day(tmpDate) Then bUpdateFlag = True
End If
If arRecKeys(41) = "41" Then '5th Friday
If tlcsub.tlcGetXDay(5, 5, Month(tmpDate), Year(tmpDate)) = Day(tmpDate) Then bUpdateFlag = True
End If
Case 6 'saturday
If arRecKeys(7) = "7" Then bUpdateFlag = True
If arRecKeys(14) = "14" Then '1st Saturday
If tlcsub.tlcGetXDay(6, 1, Month(tmpDate), Year(tmpDate)) = Day(tmpDate) Then bUpdateFlag = True
End If
If arRecKeys(21) = "21" Then '2nd Saturday
If tlcsub.tlcGetXDay(6, 2, Month(tmpDate), Year(tmpDate)) = Day(tmpDate) Then bUpdateFlag = True
End If
If arRecKeys(28) = "28" Then '3rd Saturday
If tlcsub.tlcGetXDay(6, 3, Month(tmpDate), Year(tmpDate)) = Day(tmpDate) Then bUpdateFlag = True
End If
If arRecKeys(35) = "35" Then '4th Saturday
If tlcsub.tlcGetXDay(6, 4, Month(tmpDate), Year(tmpDate)) = Day(tmpDate) Then bUpdateFlag = True
End If
If arRecKeys(42) = "42" Then '5th Saturday
If tlcsub.tlcGetXDay(6, 5, Month(tmpDate), Year(tmpDate)) = Day(tmpDate) Then bUpdateFlag = True
End If
End Select
Else
If tmpDayNum = 0 Then
bUpdateFlag = True
End If
End If
If bUpdateFlag = True Then
sRate = tlcsub.tlcGetEmployeeRate(sEmployeeID)
strSQL = "INSERT INTO [tblSchedule] ([schDate],[schDayOfWeek],[schEvtID],[schPartsID],[schCallTime],[schStartTime],[schEndTime],[schOutTime],[schLocID]," _
& "[schEmpID],[schPosID],[schTypID],[schDepID],[schNotes],[schDateCreated],[schRate]," _
& "[schStatus]) VALUES ('" & tmpDate & "'," & Weekday(tmpDate) & "," & sEventsID & "," & sPartsID & ",'" & ew_FormatDateTime(tmpDate, vbShortDate) & " " & ew_FormatDateTime(sCallTime, vbLongTime) & "','" & ew_FormatDateTime(tmpDate, vbShortDate) & " " & ew_FormatDateTime(sStartTime, vbLongTime) & "','" & ew_FormatDateTime(tmpDate, vbShortDate) & " " & ew_FormatDateTime(sEndTime, vbLongTime) & "','" & ew_FormatDateTime(tmpDate, vbShortDate) & " " & ew_FormatDateTime(sOutTime, vbLongTime) & "'," _
& sLocID & "," & sEmployeeID & "," & sPosID & "," & sTypID & "," & sDepID & ",'" & sNotes & "','" & Now() & "'," & sRate & ",2)"
' strSQL = "INSERT INTO [tblSchedule] ([schDate],[schDayOfWeek],[schEvtID],[schPartsID],[schCallTime],[schStartTime],[schEndTime],[schOutTime],[schLocID]," _
'& "[schEmpID],[schPosID],[schTypID],[schDepID],[schNotes],[schDateCreated],[schRate]," _
'& "[schStatus]) VALUES ('" & tmpDate & "'," & Weekday(tmpDate) & "," & sEventsID & "," & sPartsID & ",'" & sCallTime & "','" & sStartTime & "','" & sEndTime & "','" & sOutTime & "'," _
'& sLocID & "," & sEmployeeID & "," & sPosID & "," & sTypID & "," & sDepID & ",'" & sNotes & "','" & Now() & "'," & sRate & ",2)"
Try
Conn = New cConnection()
Conn.Execute(strSQL)
Conn.Dispose()
tmpCount += 1
Catch exp As Exception
Page_Terminate("askScheduleRecurringform_results.aspx?e=T&c=" & tmpCount & "&m=" & exp.Message)
End Try
End If
tmpDate = DateAdd("d", 1, tmpDate)
tmpDayNum = tmpDayNum + 1
If tmpDayNum = 14 Then tmpDayNum = 0
End While
Page_Terminate("askScheduleRecurringform_results.aspx?e=F&c=" & tmpCount)
End If
End If
End Sub
'
' Load recordset
'
Function LoadRecordset() As OleDbDataReader
' Recordset Selecting event
askScheduleReport.Recordset_Selecting(askScheduleReport.CurrentFilter)
' Load list page SQL
Dim sSql As String = askScheduleReport.ListSQL
' Write SQL for debug
If EW_DEBUG_ENABLED Then ew_Write(sSql)
' Count
lTotalRecs = -1
' 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
askScheduleReport.Recordset_Selected(Rs)
Return Rs
End Function
'
' Render row values based on field settings
'
Sub RenderRow()
' Row Rendering event
askScheduleReport.Row_Rendering()
'
' Common render codes for all row types
'
' schDate
askScheduleReport.schDate.CellCssStyle = "white-space: nowrap;"
askScheduleReport.schDate.CellCssClass = ""
' schEvtID
askScheduleReport.schEvtID.CellCssStyle = ""
askScheduleReport.schEvtID.CellCssClass = ""
' schPartsID
askScheduleReport.schPartsID.CellCssStyle = ""
askScheduleReport.schPartsID.CellCssClass = ""
' schCallTime
askScheduleReport.schCallTime.CellCssStyle = ""
askScheduleReport.schCallTime.CellCssClass = ""
' schStartTime
askScheduleReport.schStartTime.CellCssStyle = ""
askScheduleReport.schStartTime.CellCssClass = ""
' schEndTime
askScheduleReport.schEndTime.CellCssStyle = ""
askScheduleReport.schEndTime.CellCssClass = ""
' schOutTime
askScheduleReport.schOutTime.CellCssStyle = ""
askScheduleReport.schOutTime.CellCssClass = ""
' schLocID
askScheduleReport.schLocID.CellCssStyle = ""
askScheduleReport.schLocID.CellCssClass = ""
' schEmpID
askScheduleReport.schEmpID.CellCssStyle = ""
askScheduleReport.schEmpID.CellCssClass = ""
' schPosID
askScheduleReport.schPosID.CellCssStyle = ""
askScheduleReport.schPosID.CellCssClass = ""
' schTypID
askScheduleReport.schTypID.CellCssStyle = ""
askScheduleReport.schTypID.CellCssClass = ""
' schDepID
askScheduleReport.schDepID.CellCssStyle = ""
askScheduleReport.schDepID.CellCssClass = ""
' schNotes
askScheduleReport.schNotes.CellCssStyle = ""
askScheduleReport.schNotes.CellCssClass = ""
'
' View Row
'
If askScheduleReport.RowType = EW_ROWTYPE_VIEW Then ' View row
' schDate
askScheduleReport.schDate.ViewValue = askScheduleReport.schDate.CurrentValue
askScheduleReport.schDate.ViewValue = ew_FormatDateTime(askScheduleReport.schDate.ViewValue, 6)
askScheduleReport.schDate.CssStyle = ""
askScheduleReport.schDate.CssClass = ""
askScheduleReport.schDate.ViewCustomAttributes = ""
' schEvtID
If ew_NotEmpty(askScheduleReport.schEvtID.CurrentValue) Then
sSqlWrk = "SELECT [evtDescription] FROM [tblEvents] WHERE [evtID] = " & ew_AdjustSql(askScheduleReport.schEvtID.CurrentValue) & " AND [evtIsActive]=True"
sSqlWrk = sSqlWrk & " ORDER BY [evtDescription] "
RsWrk = Conn.GetTempDataReader(sSqlWrk)
If RsWrk.Read() Then
askScheduleReport.schEvtID.ViewValue = RsWrk("evtDescription")
Else
askScheduleReport.schEvtID.ViewValue = askScheduleReport.schEvtID.CurrentValue
End If
Conn.CloseTempDataReader()
Else
askScheduleReport.schEvtID.ViewValue = System.DBNull.Value
End If
askScheduleReport.schEvtID.CssStyle = ""
askScheduleReport.schEvtID.CssClass = ""
askScheduleReport.schEvtID.ViewCustomAttributes = ""
' schPartsID
If ew_NotEmpty(askScheduleReport.schPartsID.CurrentValue) Then
sSqlWrk = "SELECT [prtDescription] FROM [tblParts] WHERE [prtID] = " & ew_AdjustSql(askScheduleReport.schPartsID.CurrentValue) & " AND [prtIsActive]=True"
sSqlWrk = sSqlWrk & " ORDER BY [prtDescription] "
RsWrk = Conn.GetTempDataReader(sSqlWrk)
If RsWrk.Read() Then
askScheduleReport.schPartsID.ViewValue = RsWrk("prtDescription")
Else
askScheduleReport.schPartsID.ViewValue = askScheduleReport.schPartsID.CurrentValue
End If
Conn.CloseTempDataReader()
Else
askScheduleReport.schPartsID.ViewValue = System.DBNull.Value
End If
askScheduleReport.schPartsID.CssStyle = ""
askScheduleReport.schPartsID.CssClass = ""
askScheduleReport.schPartsID.ViewCustomAttributes = ""
' schLocID
If ew_NotEmpty(askScheduleReport.schLocID.CurrentValue) Then
sSqlWrk = "SELECT [locDescription] FROM [tblLocations] WHERE [locID] = " & ew_AdjustSql(askScheduleReport.schLocID.CurrentValue) & " AND [locIsActive]=True"
sSqlWrk = sSqlWrk & " ORDER BY [locDescription] "
RsWrk = Conn.GetTempDataReader(sSqlWrk)
If RsWrk.Read() Then
askScheduleReport.schLocID.ViewValue = RsWrk("locDescription")
Else
askScheduleReport.schLocID.ViewValue = askScheduleReport.schLocID.CurrentValue
End If
Conn.CloseTempDataReader()
Else
askScheduleReport.schLocID.ViewValue = System.DBNull.Value
End If
askScheduleReport.schLocID.CssStyle = ""
askScheduleReport.schLocID.CssClass = ""
askScheduleReport.schLocID.ViewCustomAttributes = ""
' schCallTime
askScheduleReport.schCallTime.ViewValue = askScheduleReport.schCallTime.CurrentValue
askScheduleReport.schCallTime.ViewValue = ew_FormatDateTime(askScheduleReport.schCallTime.ViewValue, 14)
askScheduleReport.schCallTime.CssStyle = ""
askScheduleReport.schCallTime.CssClass = ""
askScheduleReport.schCallTime.ViewCustomAttributes = ""
' schStartTime
askScheduleReport.schStartTime.ViewValue = askScheduleReport.schStartTime.CurrentValue
askScheduleReport.schStartTime.ViewValue = ew_FormatDateTime(askScheduleReport.schStartTime.ViewValue, 14)
askScheduleReport.schStartTime.CssStyle = ""
askScheduleReport.schStartTime.CssClass = ""
askScheduleReport.schStartTime.ViewCustomAttributes = ""
' schEndTime
askScheduleReport.schEndTime.ViewValue = askScheduleReport.schEndTime.CurrentValue
askScheduleReport.schEndTime.ViewValue = ew_FormatDateTime(askScheduleReport.schEndTime.ViewValue, 14)
askScheduleReport.schEndTime.CssStyle = ""
askScheduleReport.schEndTime.CssClass = ""
askScheduleReport.schEndTime.ViewCustomAttributes = ""
' schOutTime
askScheduleReport.schOutTime.ViewValue = askScheduleReport.schOutTime.CurrentValue
askScheduleReport.schOutTime.ViewValue = ew_FormatDateTime(askScheduleReport.schOutTime.ViewValue, 14)
askScheduleReport.schOutTime.CssStyle = ""
askScheduleReport.schOutTime.CssClass = ""
askScheduleReport.schOutTime.ViewCustomAttributes = ""
' schEmpID
If ew_NotEmpty(askScheduleReport.schEmpID.CurrentValue) Then
sSqlWrk = "SELECT [empName] FROM [tblEmployees] WHERE [empID] = " & ew_AdjustSql(askScheduleReport.schEmpID.CurrentValue) & " AND [empIsActive]=True"
sSqlWrk = sSqlWrk & " ORDER BY [empFirstName] "
RsWrk = Conn.GetTempDataReader(sSqlWrk)
If RsWrk.Read() Then
askScheduleReport.schEmpID.ViewValue = RsWrk("empName")
Else
askScheduleReport.schEmpID.ViewValue = askScheduleReport.schEmpID.CurrentValue
End If
Conn.CloseTempDataReader()
Else
askScheduleReport.schEmpID.ViewValue = System.DBNull.Value
End If
askScheduleReport.schEmpID.CssStyle = ""
askScheduleReport.schEmpID.CssClass = ""
askScheduleReport.schEmpID.ViewCustomAttributes = ""
' schPosID
If ew_NotEmpty(askScheduleReport.schPosID.CurrentValue) Then
sSqlWrk = "SELECT [posDescription] FROM [tblPositions] WHERE [posID] = " & ew_AdjustSql(askScheduleReport.schPosID.CurrentValue) & " AND [posIsActive]=True"
sSqlWrk = sSqlWrk & " ORDER BY [posDescription] "
RsWrk = Conn.GetTempDataReader(sSqlWrk)
If RsWrk.Read() Then
askScheduleReport.schPosID.ViewValue = RsWrk("posDescription")
Else
askScheduleReport.schPosID.ViewValue = askScheduleReport.schPosID.CurrentValue
End If
Conn.CloseTempDataReader()
Else
askScheduleReport.schPosID.ViewValue = System.DBNull.Value
End If
askScheduleReport.schPosID.CssStyle = ""
askScheduleReport.schPosID.CssClass = ""
askScheduleReport.schPosID.ViewCustomAttributes = ""
' schTypID
If ew_NotEmpty(askScheduleReport.schTypID.CurrentValue) Then
sSqlWrk = "SELECT [typDescription] FROM [tblTypes] WHERE [typID] = " & ew_AdjustSql(askScheduleReport.schTypID.CurrentValue) & " AND [typIsActive]=True"
sSqlWrk = sSqlWrk & " ORDER BY [typDescription] "
RsWrk = Conn.GetTempDataReader(sSqlWrk)
If RsWrk.Read() Then
askScheduleReport.schTypID.ViewValue = RsWrk("typDescription")
Else
askScheduleReport.schTypID.ViewValue = askScheduleReport.schTypID.CurrentValue
End If
Conn.CloseTempDataReader()
Else
askScheduleReport.schTypID.ViewValue = System.DBNull.Value
End If
askScheduleReport.schTypID.CssStyle = ""
askScheduleReport.schTypID.CssClass = ""
askScheduleReport.schTypID.ViewCustomAttributes = ""
' schDepID
If ew_NotEmpty(askScheduleReport.schDepID.CurrentValue) Then
sSqlWrk = "SELECT [depAcctCode], [depDescription] FROM [tblDepartments] WHERE [depID] = " & ew_AdjustSql(askScheduleReport.schDepID.CurrentValue) & " AND [depIsActive]=True"
sSqlWrk = sSqlWrk & " ORDER BY [depDescription] "
RsWrk = Conn.GetTempDataReader(sSqlWrk)
If RsWrk.Read() Then
askScheduleReport.schDepID.ViewValue = RsWrk("depAcctCode")
askScheduleReport.schDepID.ViewValue = askScheduleReport.schDepID.ViewValue & ew_ValueSeparator(0) & RsWrk("depDescription")
Else
askScheduleReport.schDepID.ViewValue = askScheduleReport.schDepID.CurrentValue
End If
Conn.CloseTempDataReader()
Else
askScheduleReport.schDepID.ViewValue = System.DBNull.Value
End If
askScheduleReport.schDepID.CssStyle = ""
askScheduleReport.schDepID.CssClass = ""
askScheduleReport.schDepID.ViewCustomAttributes = ""
' schNotes
askScheduleReport.schNotes.ViewValue = askScheduleReport.schNotes.CurrentValue
askScheduleReport.schNotes.CssStyle = ""
askScheduleReport.schNotes.CssClass = ""
askScheduleReport.schNotes.ViewCustomAttributes = ""
' View refer script
' schDate
askScheduleReport.schDate.HrefValue = ""
' schEvtID
askScheduleReport.schEvtID.HrefValue = ""
' schPartsID
askScheduleReport.schPartsID.HrefValue = ""
' schCallTime
askScheduleReport.schCallTime.HrefValue = ""
' schStartTime
askScheduleReport.schStartTime.HrefValue = ""
' schEndTime
askScheduleReport.schEndTime.HrefValue = ""
' schOutTime
askScheduleReport.schOutTime.HrefValue = ""
' schLocID
askScheduleReport.schLocID.HrefValue = ""
' schEmpID
askScheduleReport.schEmpID.HrefValue = ""
' schPosID
askScheduleReport.schPosID.HrefValue = ""
' schTypID
askScheduleReport.schTypID.HrefValue = ""
' schDepID
askScheduleReport.schDepID.HrefValue = ""
' schNotes
askScheduleReport.schNotes.HrefValue = ""
'
' Search Row
'
ElseIf askScheduleReport.RowType = EW_ROWTYPE_SEARCH Then ' Search row
' schDate
askScheduleReport.schDate.EditCustomAttributes = ""
askScheduleReport.schDate.EditValue = askScheduleReport.schDate.AdvancedSearch.SearchValue
askScheduleReport.schDate.EditCustomAttributes = ""
askScheduleReport.schDate.EditValue2 = askScheduleReport.schDate.AdvancedSearch.SearchValue2
' schEvtID
askScheduleReport.schEvtID.EditCustomAttributes = ""
sSqlWrk = "SELECT [evtID], [evtDescription], '' AS Disp2Fld, '' AS SelectFilterFld FROM [tblEvents]"
sWhereWrk = "[evtIsActive]=True"
If sWhereWrk <> "" Then sSqlWrk = sSqlWrk & " WHERE " & sWhereWrk
sSqlWrk = sSqlWrk & " ORDER BY [evtDescription] "
arwrk = Conn.GetRows(sSqlWrk)
arwrk.Insert(0, New Object() {"", "Please Select"})
askScheduleReport.schEvtID.EditValue = arwrk
' schPartsID
askScheduleReport.schPartsID.EditCustomAttributes = ""
sSqlWrk = "SELECT [prtID], [prtDescription], '' AS Disp2Fld, '' AS SelectFilterFld FROM [tblParts]"
sWhereWrk = "[prtIsActive]=True"
If sWhereWrk <> "" Then sSqlWrk = sSqlWrk & " WHERE " & sWhereWrk
sSqlWrk = sSqlWrk & " ORDER BY [prtDescription] "
arwrk = Conn.GetRows(sSqlWrk)
arwrk.Insert(0, New Object() {"", "Please Select"})
askScheduleReport.schPartsID.EditValue = arwrk
' schCallTime
askScheduleReport.schCallTime.EditCustomAttributes = ""
askScheduleReport.schCallTime.EditValue = ew_FormatDateTime(askScheduleReport.schCallTime.CurrentValue, 14)
' schStartTime
askScheduleReport.schStartTime.EditCustomAttributes = ""
askScheduleReport.schStartTime.EditValue = ew_FormatDateTime(askScheduleReport.schStartTime.CurrentValue, 14)
' schEndTime
askScheduleReport.schEndTime.EditCustomAttributes = ""
askScheduleReport.schEndTime.EditValue = ew_FormatDateTime(askScheduleReport.schEndTime.CurrentValue, 14)
' schOutTime
askScheduleReport.schOutTime.EditCustomAttributes = ""
askScheduleReport.schOutTime.EditValue = ew_FormatDateTime(askScheduleReport.schOutTime.CurrentValue, 14)
' schLocID
askScheduleReport.schLocID.EditCustomAttributes = ""
sSqlWrk = "SELECT [locID], [locDescription], '' AS Disp2Fld, '' AS SelectFilterFld FROM [tblLocations]"
sWhereWrk = "[locIsActive]=True"
If sWhereWrk <> "" Then sSqlWrk = sSqlWrk & " WHERE " & sWhereWrk
sSqlWrk = sSqlWrk & " ORDER BY [locDescription] "
arwrk = Conn.GetRows(sSqlWrk)
arwrk.Insert(0, New Object() {"", "Please Select"})
askScheduleReport.schLocID.EditValue = arwrk
' schEmpID
askScheduleReport.schEmpID.EditCustomAttributes = ""
sSqlWrk = "SELECT [empID], [empName], '' AS Disp2Fld, '' AS SelectFilterFld FROM [tblEmployees]"
sWhereWrk = "[empIsActive]=True"
sWhereWrk = tblEmployees.AddUserIDFilter(sWhereWrk)
If sWhereWrk <> "" Then sSqlWrk = sSqlWrk & " WHERE " & sWhereWrk
sSqlWrk = sSqlWrk & " ORDER BY [empFirstName] "
arwrk = Conn.GetRows(sSqlWrk)
arwrk.Insert(0, New Object() {"", "Please Select"})
askScheduleReport.schEmpID.EditValue = arwrk
' schPosID
askScheduleReport.schPosID.EditCustomAttributes = ""
sSqlWrk = "SELECT [posID], [posDescription], '' AS Disp2Fld, '' AS SelectFilterFld FROM [tblPositions]"
sWhereWrk = "[posIsActive]=True"
If sWhereWrk <> "" Then sSqlWrk = sSqlWrk & " WHERE " & sWhereWrk
sSqlWrk = sSqlWrk & " ORDER BY [posDescription] "
arwrk = Conn.GetRows(sSqlWrk)
arwrk.Insert(0, New Object() {"", "Please Select"})
askScheduleReport.schPosID.EditValue = arwrk
' schTypID
askScheduleReport.schTypID.EditCustomAttributes = ""
sSqlWrk = "SELECT [typID], [typDescription], '' AS Disp2Fld, '' AS SelectFilterFld FROM [tblTypes]"
sWhereWrk = "[typIsActive]=True"
If sWhereWrk <> "" Then sSqlWrk = sSqlWrk & " WHERE " & sWhereWrk
sSqlWrk = sSqlWrk & " ORDER BY [typDescription] "
arwrk = Conn.GetRows(sSqlWrk)
arwrk.Insert(0, New Object() {"", "Please Select"})
askScheduleReport.schTypID.EditValue = arwrk
' schDepID
askScheduleReport.schDepID.EditCustomAttributes = ""
sSqlWrk = "SELECT [depID], [depAcctCode], [depDescription], '' AS SelectFilterFld FROM [tblDepartments]"
sWhereWrk = "[depIsActive]=True"
If sWhereWrk <> "" Then sSqlWrk = sSqlWrk & " WHERE " & sWhereWrk
sSqlWrk = sSqlWrk & " ORDER BY [depDescription] "
arwrk = Conn.GetRows(sSqlWrk)
arwrk.Insert(0, New Object() {"", "Please Select", ""})
askScheduleReport.schDepID.EditValue = arwrk
' schNotes
askScheduleReport.schNotes.EditCustomAttributes = ""
askScheduleReport.schNotes.EditValue = askScheduleReport.schNotes
End If
' Row Rendered event
askScheduleReport.Row_Rendered()
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
Function ValidateTimes(ByRef tmpCallTime As String, ByRef tmpStartTime As String, ByRef tmpEndtime As String, ByRef tmpOutTime As String) As Boolean
' Initialize
ParentPage.gsFormError = ""
Dim tlc As New AspNetMaker7_tfpssnet
tlc.tlcCheckTime(tmpCallTime)
tlc.tlcCheckTime(tmpStartTime)
tlc.tlcCheckTime(tmpEndtime)
tlc.tlcCheckTime(tmpOutTime)
If Not ew_CheckTime(tmpCallTime) Then
If ParentPage.gsFormError <> "" Then ParentPage.gsFormError = ParentPage.gsFormError & "<br />"
ParentPage.gsFormError = ParentPage.gsFormError & "Incorrect time (hh:mm:ss) - Call Time"
End If
If Not ew_CheckTime(tmpStartTime) Then
If ParentPage.gsFormError <> "" Then ParentPage.gsFormError = ParentPage.gsFormError & "<br />"
ParentPage.gsFormError = ParentPage.gsFormError & "Incorrect time (hh:mm:ss) - Start Time"
End If
If Not ew_CheckTime(tmpEndtime) Then
If ParentPage.gsFormError <> "" Then ParentPage.gsFormError = ParentPage.gsFormError & "<br />"
ParentPage.gsFormError = ParentPage.gsFormError & "Incorrect time (hh:mm:ss) - End Time"
End If
If Not ew_CheckTime(tmpOutTime) Then
If ParentPage.gsFormError <> "" Then ParentPage.gsFormError = ParentPage.gsFormError & "<br />"
ParentPage.gsFormError = ParentPage.gsFormError & "Incorrect time (hh:mm:ss) - Out Time"
End If
' Return validate result
Dim Valid As Boolean = (ParentPage.gsFormError = "")
' Form_CustomValidate event
Dim sFormCustomError As String = ""
' Valid = Valid And Form_CustomValidate(sFormCustomError)
If sFormCustomError <> "" Then
If ParentPage.gsFormError <> "" Then ParentPage.gsFormError = ParentPage.gsFormError & "<br />"
ParentPage.gsFormError = ParentPage.gsFormError & sFormCustomError
End If
Return Valid
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
askScheduleRecurring_form = New caskScheduleRecurring_form(Me)
askScheduleRecurring_form.Page_Init()
' Page main processing
askScheduleRecurring_form.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 askScheduleRecurring_form IsNot Nothing Then askScheduleRecurring_form.Dispose()
End Sub
End Class