Partial Class wetsuitDetails
Inherits System.Web.UI.Page
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
Dim authenticated As Int16
If Request.IsAuthenticated = True Then
'authenticatedLbl.Text = "You are logged in"
authenticated = 1
Dim userID As Guid
Dim prodID As Int16
userID = Session("userID")
prodID = Request.QueryString("prodID")
' Initialize the connection
Dim conn = New SqlClient.SqlConnection(ConfigurationManager.ConnectionStrings("WetsuitConnectionString").ConnectionString)
conn.Open()
' Prepare the Sql command
Dim sqlQuery As String = "select live from t_review"
Dim sql = New SqlClient.SqlCommand(sqlQuery, conn)
' Get the first row and column from the query
Dim live As Object = sql.ExecuteScalar()
' Close the connection
conn.Close()
' Handle the result
If live.Equals(DBNull.Value) Then
'Label1.Text = "Write"
Response.Write("1")
reviewSuit.visible = True
ElseIf live = 0 Then
' LabelReview.Text = "Pending"
Response.Write("2")
ElseIf live = 1 Then
' LabelReview.Text = "Reviewed"
Response.Write("3")
End If
Else
'LabelReview.Text = "Review Link"
'show write review link
Response.Write("4")
End If
End Sub
End Class
|