Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
sSubPage = clAct.Decrypt(clAct.DeNull(Request.QueryString("pg")))
sMS_No = clAct.Decrypt(clAct.DeNull(Request.QueryString("ms_no")))
sMtg_No = clAct.DeNull(Request.QueryString("Meeting_No"))
sDoc_Type = clAct.DeNull(Request.QueryString("dt"))
Call clAct.WriteToFile("Connection String: " & ConfigurationManager.ConnectionStrings("Sirius").ConnectionString & vbNewLine)
Call clAct.WriteToFile("Connection State: " & myCon.State.ToString & vbNewLine)
Using myCon
If myCon.State = ConnectionState.Closed Then myCon.Open()
Call clAct.WriteToFile("In using block: Connection State: " & myCon.State.ToString & vbNewLine)
End Using
Call clAct.WriteToFile("Out Using block Connection State: " & myCon.State.ToString & vbNewLine)
If Page.IsPostBack = False Then
clAct.LoginCheck() ' Ensure that the user is logged in.
' Get the menu
litMenu.Text = menu.GetMenu(sSubPage.ToString).ToString
Call clAct.WriteToFile("before GetLabelsAndDefaults" & vbNewLine)
GetLabelsAndDefaults()
Call clAct.WriteToFile("after GetLabelsAndDefaults" & vbNewLine)
Call clAct.WriteToFile("before LoadAuthors" & vbNewLine)
LoadAuthors() ' binds and loads the authors Datagrid
Call clAct.WriteToFile("after LoadAuthors" & vbNewLine)
End If
End Sub
Private Sub LoadAuthors()
Call clAct.WriteToFile("In LoadAuthors" & vbNewLine)
Try
Using myCon
Call clAct.WriteToFile("In Using block" & vbNewLine)
Call clAct.WriteToFile("Connection state: " & myCon.State.ToString & vbNewLine)
If myCon.State = ConnectionState.Closed Then
Call clAct.WriteToFile("Connection String: " & ConfigurationManager.ConnectionStrings("Sirius").ConnectionString & vbNewLine)
myCon.InitializeLifetimeService()
myCon.Open()
End If
Call clAct.WriteToFile("after connection state check" & vbNewLine)
Call clAct.WriteToFile("before CreateDataTable" & vbNewLine)
Dim dt As DataTable = CreateDataTable()
Call clAct.WriteToFile("after CreateDataTable" & vbNewLine)
Dim dr As DataRow
Dim myReader As SqlDataReader
Dim myCmd As New SqlCommand
With myCmd
.CommandType = CommandType.StoredProcedure
.CommandText = "up_gGetMS_Authors"
.Connection = myCon
.Parameters.AddWithValue("@MS_No", sMS_No.ToString)
.Parameters.AddWithValue("@Version_No", Convert.ToInt16(1))
myReader = .ExecuteReader() ' Open the DataReader
End With
If myReader.HasRows = True Then
Do While myReader.Read()
dr = dt.NewRow()
dr(0) = Convert.ToString(clAct.DeNull(myReader("Author_ID")))
dr(1) = Convert.ToString(clAct.DeNull(myReader("User_ID")))
dr(2) = Convert.ToString(clAct.DeNull(myReader("First_Name")))
dr(3) = Convert.ToString(clAct.DeNull(myReader("Middle_Name")))
dr(4) = Convert.ToString(clAct.DeNull(myReader("Last_Name")))
dr(5) = Convert.ToString(clAct.DeNull(myReader("Affiliation")))
dr(6) = Convert.ToBoolean(clAct.DeNull(myReader("Presenting_Auth")))
dt.Rows.Add(dr)
Loop
myReader.Close()
myReader = Nothing
Else
' This page has not been saved before; add the submitting authors details into the Author datagrid by default
Dim bUCaseLName As Boolean = clAct.GetJnl_MS_Authors_UCase_Last_Name()
myReader = clAct.Find_Author(clAct.GetCookie("UserDetails", "Email").ToString)
If myReader.Read() Then
dr = dt.NewRow()
dr(0) = ""
dr(1) = Convert.ToString(clAct.DeNull(myReader("User_ID")))
dr(2) = Convert.ToString(clAct.DeNull(myReader("First_Name")))
dr(3) = Convert.ToString(clAct.DeNull(myReader("Middle_Name")))
dr(4) = IIf(bUCaseLName = True, Convert.ToString(clAct.DeNull(myReader("Last_Name"))).ToUpper, Convert.ToString(clAct.DeNull(myReader("Last_Name"))).ToString)
dr(5) = Convert.ToString(clAct.DeNull(myReader("Affiliation")))
dr(6) = Convert.ToBoolean(True)
dt.Rows.Add(dr)
End If
myReader.Close()
myReader = Nothing
End If
dgAuthors.DataSource = dt
dgAuthors.DataBind()
End Using
Catch ex As Exception
Throw ex
End Try
End Sub