📄 chequestatus.aspx.vb
字号:
Imports System.Data.SqlClient
Public Class chequestatus
Inherits System.Web.UI.Page
Protected WithEvents Form1 As System.Web.UI.HtmlControls.HtmlForm
Protected WithEvents btnGetStatus As System.Web.UI.WebControls.Button
Protected WithEvents btnHome As System.Web.UI.WebControls.Button
Protected WithEvents txtcno As System.Web.UI.WebControls.TextBox
Protected WithEvents lblmsg As System.Web.UI.WebControls.Label
#Region " Web Form Designer Generated Code "
'This call is required by the Web Form Designer.
<System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
End Sub
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()
End Sub
#End Region
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
'Put user code to initialize the page here
End Sub
Private Sub btnGetStatus_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnGetStatus.Click
' find whether it is paid
Dim con As New SqlConnection(Application("cs"))
Try
con.Open()
Dim cmd As New SqlCommand("select count(*) from transactions where acno = @acno and cno = @cno and status = 'p'", con)
cmd.Parameters.Add("@acno", SqlDbType.VarChar, 10).Value = Session("acno")
cmd.Parameters.Add("@cno", SqlDbType.VarChar, 10).Value = txtcno.text
Dim cnt As Integer
cnt = cmd.ExecuteScalar()
If cnt = 1 Then
lblmsg.Text = "Cheque was paid!"
Exit Sub
End If
' check whether it was stopped
cnt = 0
cmd.CommandText = "select count(*) from requests where acno = @acno and cno = @cno and request = 's' "
cnt = cmd.ExecuteScalar()
If cnt = 1 Then
lblmsg.Text = "Cheque Stopped!"
Exit Sub
End If
lblmsg.Text = "Cheque Not Yet Presented!"
Catch ex As Exception
lblmsg.Text = "Error --> " & ex.Message
Finally
con.Close()
End Try
End Sub
End Class
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -