H
Harold
This is just me testing, however the two top sub's are
never called........why ?.
Where is the error of my ways?
Sub ProcessLogo(ByVal sender As Object, ByVal e As
CommandEventArgs)
Dim Test As Object = e.CommandArgument
End Sub
Sub ProcessLogo_Click(ByVal sender As Object, ByVal e As
System.EventArgs)
Dim Test As Object = CType(sender,
Button).CommandName
End Sub
Function BuildLogoTable()
'// Get logo definitions and put them in the table
Dim ThisPage As String = "AddCompany"
Dim Language As String = Session.Contents("LLC")
Try
Dim PreviewFilePointer As String = ""
Dim BuildLogoCommand As SqlCommand
Dim BuildLogoReader As SqlDataReader
Dim BuildLogoConnection As SqlConnection =
New SqlConnection(ConfigurationSettings.AppSettings
("Publimation_Authorisation"))
BuildLogoCommand = New SqlCommand
("GetImageDataByCatagory", BuildLogoConnection)
BuildLogoCommand.CommandType =
CommandType.StoredProcedure
BuildLogoCommand.Parameters.Add("@projectid",
SqlDbType.Int, 4).Value = Session.Contents("PID")
BuildLogoCommand.Parameters.Add
("@imagecatagory", SqlDbType.Int, 4).Value = 1
BuildLogoConnection.Open()
BuildLogoReader =
BuildLogoCommand.ExecuteReader
Dim LogoRow As New TableRow()
Dim LogoSelectRow As New TableRow()
While BuildLogoReader.Read
Dim LogoID As Integer =
BuildLogoReader.GetInt32(0)
Dim LogoImage As String =
BuildLogoReader.GetString(8) & BuildLogoReader.GetString
(4) & "." & BuildLogoReader.GetString(7)
Dim LogoLocation As String =
ConfigurationSettings.AppSettings("ProjectVirtualRoot")
& "/domains/" & Session.Contents("PSN") & Trim(Replace
(LogoImage, "\", "/"))
Dim LogoCell As New TableCell()
Dim LogoSelectCell As New TableCell()
Dim SelectButton As New LinkButton()
SelectButton.Text =
GetLanguageArray.GetText(ThisPage, Language,
LanguageArray, "Select")
SelectButton.CommandArgument = LogoID
AddHandler SelectButton.Command,
AddressOf ProcessLogo
AddHandler SelectButton.Click, AddressOf
ProcessLogo_Click
LogoCell.Text = "<img src=""" &
LogoLocation & """>"
LogoSelectCell.Controls.Add(SelectButton)
LogoRow.Cells.Add(LogoCell)
LogoSelectRow.Cells.Add(LogoSelectCell)
End While
TableLogo.Rows.Add(LogoRow)
TableLogo.Rows.Add(LogoSelectRow)
BuildLogoReader.Close()
BuildLogoConnection.Close()
Catch x As Exception
ErrorLogger.ErrorManager
("BuildCompanyLogoTableError", x)
End Try
End Function
never called........why ?.
Where is the error of my ways?
Sub ProcessLogo(ByVal sender As Object, ByVal e As
CommandEventArgs)
Dim Test As Object = e.CommandArgument
End Sub
Sub ProcessLogo_Click(ByVal sender As Object, ByVal e As
System.EventArgs)
Dim Test As Object = CType(sender,
Button).CommandName
End Sub
Function BuildLogoTable()
'// Get logo definitions and put them in the table
Dim ThisPage As String = "AddCompany"
Dim Language As String = Session.Contents("LLC")
Try
Dim PreviewFilePointer As String = ""
Dim BuildLogoCommand As SqlCommand
Dim BuildLogoReader As SqlDataReader
Dim BuildLogoConnection As SqlConnection =
New SqlConnection(ConfigurationSettings.AppSettings
("Publimation_Authorisation"))
BuildLogoCommand = New SqlCommand
("GetImageDataByCatagory", BuildLogoConnection)
BuildLogoCommand.CommandType =
CommandType.StoredProcedure
BuildLogoCommand.Parameters.Add("@projectid",
SqlDbType.Int, 4).Value = Session.Contents("PID")
BuildLogoCommand.Parameters.Add
("@imagecatagory", SqlDbType.Int, 4).Value = 1
BuildLogoConnection.Open()
BuildLogoReader =
BuildLogoCommand.ExecuteReader
Dim LogoRow As New TableRow()
Dim LogoSelectRow As New TableRow()
While BuildLogoReader.Read
Dim LogoID As Integer =
BuildLogoReader.GetInt32(0)
Dim LogoImage As String =
BuildLogoReader.GetString(8) & BuildLogoReader.GetString
(4) & "." & BuildLogoReader.GetString(7)
Dim LogoLocation As String =
ConfigurationSettings.AppSettings("ProjectVirtualRoot")
& "/domains/" & Session.Contents("PSN") & Trim(Replace
(LogoImage, "\", "/"))
Dim LogoCell As New TableCell()
Dim LogoSelectCell As New TableCell()
Dim SelectButton As New LinkButton()
SelectButton.Text =
GetLanguageArray.GetText(ThisPage, Language,
LanguageArray, "Select")
SelectButton.CommandArgument = LogoID
AddHandler SelectButton.Command,
AddressOf ProcessLogo
AddHandler SelectButton.Click, AddressOf
ProcessLogo_Click
LogoCell.Text = "<img src=""" &
LogoLocation & """>"
LogoSelectCell.Controls.Add(SelectButton)
LogoRow.Cells.Add(LogoCell)
LogoSelectRow.Cells.Add(LogoSelectCell)
End While
TableLogo.Rows.Add(LogoRow)
TableLogo.Rows.Add(LogoSelectRow)
BuildLogoReader.Close()
BuildLogoConnection.Close()
Catch x As Exception
ErrorLogger.ErrorManager
("BuildCompanyLogoTableError", x)
End Try
End Function