Public Sub Connect_server()
If nDBCON.DB_Connect(s_Server, s_User, s_Pass, s_BASEDB) <> "PASS" Then
MsgBox("Don't Connect to Data Base", MsgBoxStyle.OkOnly, "Connection Error")
Exit Sub
End If
End Sub
Protected Sub Page_load(ByVal sander As Object, ByVal e As System.EventArgs) Handles Me.Load
TPID = Request.QueryString("TPID")
If (Not (IsPostBack)) Then
BindData()
End If
End Sub
Sub BindData()
Try
Connect_server()
v_sql = " EXEC WBI1000_Q "
v_sql += "@ITYPE = 'I4',@TPID ='" & TPID & "'"
SqlCmd = New SqlCommand(v_sql, nDBCON.sys_SqlConnection)
SqlCmd.CommandTimeout = 90
SqlDataR = SqlCmd.ExecuteReader
With SqlDataR
While .Read
Intranet.WebTitle = SqlDataR.Item(0)
Intranet.Webdetail = SqlDataR.Item(1)
Intranet.Webpost = SqlDataR.Item(2)
Intranet.Webimg = SqlDataR.Item(3)
End While
End With
Label2.Text = Intranet.WebTitle
Label3.Text = Intranet.Webdetail
Label4.Text = Intranet.Webpost
Image1.ImageUrl = Intranet.Webimg
Label5.Text = Intranet.Webtime
Connect_server()
v_sql = "EXEC WBI1000_Q"
v_sql += " @ITYPE = 'I7' "
v_sql += " ,@TPID ='" & Request.QueryString("TPID") & "'"
SqlCmd = New SqlCommand(v_sql, nDBCON.sys_SqlConnection)
SqlDataW = SqlCmd.ExecuteReader()
GridView1.DataSource = SqlDataW
GridView1.DataBind()
Catch ex As Exception
MsgBox(ex.Message, MsgBoxStyle.Critical)
End Try
End Sub
Protected Sub GridView1_RowDataBound(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GridView1.RowDataBound
Dim comment As Label = DirectCast(e.Row.FindControl("comment "), Label)
If (Not IsNothing(comment)) Then
comment.Text = e.Row.DataItem("COMDETAIL")
End If
Dim compost As Label = DirectCast(e.Row.FindControl("compost "), Label)
If (Not IsNothing(compost)) Then
compost.Text = e.Row.DataItem("COMPOST")
End If
End Sub
Protected Sub COMMENT_click(ByVal sender As Object, ByVal e As System.EventArgs) Handles COMMENT.Click
TPID = Request.QueryString("TPID")
Try
Connect_server()
v_sql = "EXEC WBI1000_Q"
v_sql += " @ITYPE = 'I6'"
v_sql += ", @TPID = '" & TPID & "'"
v_sql += ", @DETAIL = '" & COMMENTPOST.Text & "'"
v_sql += ", @NAMES = '" & Session("name") & "'"
'v_sql +=", @PIC ='""'"
v_sql += ", @UID = '" & Session("UserId") & "'"
SqlCmd = New SqlCommand(v_sql, nDBCON.sys_SqlConnection)
SqlCmd.CommandTimeout = 180
SqlDataR = SqlCmd.ExecuteReader
Catch ex As Exception
MsgBox(ex.Message, MsgBoxStyle.Critical)
End Try
nDBCON.sys_SqlConnection.Close()
Response.Redirect("COMMENT.aspx?TPID=" & TPID)
End Sub
Protected Sub GridView1_RowDataBound(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GridView1.RowDataBound
Dim comment As Label = DirectCast(e.Row.FindControl("comment "), Label)
If (Not IsNothing(comment)) Then
comment.Text = e.Row.DataItem("COMDETAIL")
End If
Dim compost As Label = DirectCast(e.Row.FindControl("compost "), Label)
If (Not IsNothing(compost)) Then
compost.Text = e.Row.DataItem("COMPOST")
End If
End Sub