Public Class InvestigationDetailGeneral
Inherits System.Web.UI.Page
#Region " Web Form Designer Generated Code "
'This call is required by the Web Form Designer.
<System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
End Sub
Protected WithEvents ddlProgressReviewDue As System.Web.UI.WebControls.DropDownList
Protected WithEvents ddlSelfInspectionReviewDue As System.Web.UI.WebControls.DropDownList
Protected WithEvents txtMIRExtNo As System.Web.UI.WebControls.TextBox
Protected WithEvents ddlMIRLocation As System.Web.UI.WebControls.DropDownList
Protected WithEvents pnlManagement As System.Web.UI.WebControls.Panel
Protected WithEvents txtDetailsOfIncident As System.Web.UI.WebControls.TextBox
Protected WithEvents txtIncidentLocation As System.Web.UI.WebControls.TextBox
Protected WithEvents ddlHostDistrict As System.Web.UI.WebControls.DropDownList
Protected WithEvents txtDateInvestigationCommenced As System.Web.UI.WebControls.TextBox
Protected WithEvents txtIncidentPrecis As System.Web.UI.WebControls.TextBox
Protected WithEvents pnlIncident As System.Web.UI.WebControls.Panel
Protected WithEvents btnIncidentDetails As System.Web.UI.WebControls.Button
Protected WithEvents btnManagementDetails As System.Web.UI.WebControls.Button
Protected WithEvents txtOperationName As System.Web.UI.WebControls.TextBox
Protected WithEvents txtRHURNNo As System.Web.UI.WebControls.TextBox
Protected WithEvents txtRHURNYear As System.Web.UI.WebControls.TextBox
Protected WithEvents txtRHURNCategory As System.Web.UI.WebControls.TextBox
Protected WithEvents txtRHURNForce As System.Web.UI.WebControls.TextBox
Protected WithEvents vs1 As System.Web.UI.WebControls.ValidationSummary
Protected WithEvents btnSave As System.Web.UI.WebControls.Button
Protected WithEvents hlPickDateInvestigationCommenced As System.Web.UI.WebControls.HyperLink
Protected WithEvents hlPickHeadOfCIDNotifiedDate As System.Web.UI.WebControls.HyperLink
Protected WithEvents hlPickNominatedACCNotifiedDate As System.Web.UI.WebControls.HyperLink
Protected WithEvents txtHeadOfCIDNotifiedDate As System.Web.UI.WebControls.TextBox
Protected WithEvents txtNominatedACCNotifiedDate As System.Web.UI.WebControls.TextBox
Protected WithEvents wucHeadOfCIDNotifiedTime As MCAS.wucTime
Protected WithEvents wucNominatedACCNotifiedTime As MCAS.wucTime
Protected WithEvents btnHeadOfCIDNotifiedNow As System.Web.UI.WebControls.Button
Protected WithEvents btnNominatedACCNotifiedNow As System.Web.UI.WebControls.Button
Protected WithEvents btnDateInvestigationCommencedToday As System.Web.UI.WebControls.Button
Protected WithEvents hlNewMCIUOfficerName As System.Web.UI.WebControls.HyperLink
Protected WithEvents txtMCIUOfficerNotifiedNo As System.Web.UI.WebControls.TextBox
Protected WithEvents txtHeadOfCIDNotifiedNo As System.Web.UI.WebControls.TextBox
Protected WithEvents HyperLink1 As System.Web.UI.WebControls.HyperLink
Protected WithEvents HyperLink2 As System.Web.UI.WebControls.HyperLink
Protected WithEvents lblDateInvestigationCommenced As System.Web.UI.WebControls.Label
Protected WithEvents lblHeadOfCIDNotifiedName As System.Web.UI.WebControls.Label
Protected WithEvents lblNominatedACCNotifiedName As System.Web.UI.WebControls.Label
Protected WithEvents txtNominatedACCNotifiedNo As System.Web.UI.WebControls.TextBox
Protected WithEvents hlNewHeadOfCIDName As System.Web.UI.WebControls.HyperLink
Protected WithEvents hlNewACCName As System.Web.UI.WebControls.HyperLink
Protected WithEvents txtHeadOfCIDID As System.Web.UI.WebControls.TextBox
Protected WithEvents txtNominatedACCID As System.Web.UI.WebControls.TextBox
Protected WithEvents btnMCIUOfficerNotifiedEnter As System.Web.UI.WebControls.ImageButton
Protected WithEvents btnHeadOfCIDNotifiedEnter As System.Web.UI.WebControls.ImageButton
Protected WithEvents btnNominatedACCNotifiedEnter As System.Web.UI.WebControls.ImageButton
Protected WithEvents hlNewMIRLocation As System.Web.UI.WebControls.HyperLink
Protected WithEvents lblTitle As System.Web.UI.WebControls.Label
Protected WithEvents Label1 As System.Web.UI.WebControls.Label
Protected WithEvents wucInvestigationHeader As MCAS.wucInvestigationHeader
'NOTE: The following placeholder declaration is required by the Web Form Designer.
'Do not delete or move it.
Private designerPlaceholderDeclaration As System.Object
Protected arrListDistricts As New ArrayList 'TODO: Can be pushed into the cache and removed on page_Unload
Protected arrMirLocations As New ArrayList
Protected WithEvents WucDateTime_InvestigationStart As MCAS.wucDateTime
Protected WithEvents lblMCIUOfficerNotifiedName As System.Web.UI.WebControls.Label
Protected WithEvents txtMCIUOfficerID As System.Web.UI.WebControls.TextBox
Protected WithEvents WucDateTimeMCIU As MCAS.wucDateTime
Private Sub Page_Init(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Init
'CODEGEN: This method call is required by the Web Form Designer
'Do not modify it using the code editor.
InitializeComponent()
'Retrieve info from the session about the current investigation
Me._objInvestigation = Session("CurrentInvestigation")
'Code that builds the arrays (if needed)
BuildDropDowns()
End Sub
#End Region
#Region " Page-level declarations "
''' -----------------------------------------------------------------------------
''' <summary>
''' Possible values for the improvised tab control
''' </summary>
''' <remarks>
''' </remarks>
''' <history>
''' [7649] 22/05/2006 Created
''' </history>
''' -----------------------------------------------------------------------------
Private Enum eMode 'values for the page mode
Incident = 0 'Showing incident details
Management = 1 'Showing management details
End Enum
Protected _objInvestigation As MCAS.Investigation
Dim objXMs As New ExceptionMethods
Dim objData As New MCAS.DataHelper
#End Region
''' -----------------------------------------------------------------------------
''' <summary>
''' Initialise the page
''' </summary>
''' <param name="sender"></param>
''' <param name="e"></param>
''' <remarks>
''' </remarks>
''' <history>
''' [7649] 22/05/2006 Created
''' [70483] 22/11/2006 Moved the PopulateDDL method to within IsPostBack
''' Removed Category DropDown List - This is already set and part of RHURn, so
''' should not be changed!
''' </history>
''' -----------------------------------------------------------------------------
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Try
Dim objWH As New WebHelper
With objWH
.DoStaffBuilderCallingScript(Me.txtMCIUOfficerID, Me.lblMCIUOfficerNotifiedName, _
Me.txtMCIUOfficerNotifiedNo, Me.hlNewMCIUOfficerName, , , 5)
.DoStaffBuilderCallingScript(Me.txtHeadOfCIDID, Me.lblHeadOfCIDNotifiedName, _
Me.txtHeadOfCIDNotifiedNo, Me.hlNewHeadOfCIDName, , , 6)
.DoStaffBuilderCallingScript(Me.txtNominatedACCID, Me.lblNominatedACCNotifiedName, _
Me.txtNominatedACCNotifiedNo, Me.hlNewACCName, , , 7)
'And some javascript to work the MIR Location popup
.DoNewItemCallingScript(Me.ddlMIRLocation, Me.hlNewMIRLocation, , , 8)
End With
If Not IsPostBack Then
wucInvestigationHeader.URN = _objInvestigation.RHURN
wucInvestigationHeader.OperationName = _objInvestigation.OperationName
'Show incident information first
SwitchTabs(eMode.Incident)
ddlHostDistrict.DataSource = arrListDistricts
ddlHostDistrict.DataTextField = "DistrictName"
ddlHostDistrict.DataValueField = "ID"
ddlHostDistrict.DataBind()
ddlHostDistrict.Items.FindByText("Yeovil").Selected = True
End If
'Initialise the Date/Time User Controls
WucDateTime_InvestigationStart.theDate = _objInvestigation.DateInvestigationCommenced
WucDateTime_InvestigationStart.DateEnabled = True
WucDateTimeMCIU.theDate = _objInvestigation.MCIUOfficerNotifiedDateAndTime
WucDateTimeMCIU.DateEnabled = True
WucDateTimeMCIU.TimeEnabled = True
WucDateTimeMCIU.ShowTime = True
Catch ex As Exception
objXMs.PublishException(ex)
Throw ex
End Try
End Sub
''' -----------------------------------------------------------------------------
''' <summary>
''' Setup all the Arrays needed for drop down lists
'''
''' these arrays will be stored in the session for future use
''' </summary>
''' <remarks>
''' </remarks>
''' <history>
''' [7649] 20/06/2006 Created
''' </history>
''' -----------------------------------------------------------------------------
Private Sub BuildDropDowns()
'Get the Arrays for the DropDown lists from the session
arrListDistricts = Session("DistrictList")
arrMirLocations = Session("MIRLocationsList")
If arrListDistricts Is Nothing Then
Dim reader As SqlClient.SqlDataReader
arrListDistricts = New ArrayList
Try
'Create the 0 Record
Dim districtTop As New District(0, "", "[Please Select]")
arrListDistricts.Add(districtTop)
'Read in the Data for the DropDownList
reader = objData.ListLookup(DataHelper.LookupType.Districts)
While reader.Read
Dim d = New District(reader.Item("ID"), reader.Item("DistrictCode"), reader.Item("DistrictName"))
arrListDistricts.Add(d)
End While
'Save into the Session to remove need for future DB access
Session.Add("DistrictList", arrListDistricts)
Catch ex As Exception
objXMs.PublishException(New Exception("District List", ex))
Throw ex
Exit Try
'Tidy Up Code
Finally
If Not reader Is Nothing Then
reader.Close()
End If
End Try
End If
If arrMirLocations Is Nothing Then
Dim reader As SqlClient.SqlDataReader
arrMirLocations = New ArrayList
Try
'Create the 0 Record
Dim mirTop As New MIRLocation("[Please Select]")
arrMirLocations.Add(mirTop)
'Read in the Data for the DropDownList
reader = objData.ListLookup(DataHelper.LookupType.MIRLocations)
While reader.Read
Dim d = New MIRLocation(CShort(reader.Item("ID")))
arrMirLocations.Add(d)
End While
'Save into teh Session to remove need for future DB access
Session.Add("MIRLocationsList", arrMirLocations)
Catch ex As Exception
objXMs.PublishException(New Exception("MIR Locations List", ex))
Throw ex
Exit Try
'Tidy Up Code
Finally
If Not reader Is Nothing Then
reader.Close()
End If
End Try
End If
End Sub
''' -----------------------------------------------------------------------------
''' <summary>
''' Switch to a specified tab
''' </summary>
''' <param name="Mode"></param>
''' <returns></returns>
''' <remarks>
''' </remarks>
''' <history>
''' [7649] 22/05/2006 Created
''' </history>
''' -----------------------------------------------------------------------------
Private Function SwitchTabs(ByVal Mode As eMode) As Boolean
Try
Dim objWH As New WebHelper
'Hide all tabs except the one whose mode has been selected
Me.pnlIncident.Visible = (Mode = eMode.Incident)
Me.pnlManagement.Visible = (Mode = eMode.Management)
'Deselect all buttons except the one that's been pressed
With objWH
.SelectButton(Me.btnIncidentDetails, (Mode = eMode.Incident))
.SelectButton(Me.btnManagementDetails, (Mode = eMode.Management))
End With
Catch ex As Exception
objXMs.PublishException(ex)
Throw ex
End Try
End Function
End Class