📄 items.aspx.vb
字号:
Public Class Items
Inherits System.Web.UI.Page
Protected WithEvents lblHeader As System.Web.UI.WebControls.Label
Protected WithEvents Table1 As System.Web.UI.WebControls.Table
Protected WithEvents Table2 As System.Web.UI.WebControls.Table
Protected WithEvents txtItemName As System.Web.UI.WebControls.TextBox
Protected WithEvents txtItemDesc As System.Web.UI.WebControls.TextBox
Protected WithEvents txtAskPrice As System.Web.UI.WebControls.TextBox
Protected WithEvents txtNotifyPrice As System.Web.UI.WebControls.TextBox
Protected WithEvents txtExpDate As System.Web.UI.WebControls.TextBox
Protected WithEvents btnSubmit As System.Web.UI.WebControls.Button
Protected WithEvents lblMsg As System.Web.UI.WebControls.Label
Protected WithEvents btnReset As System.Web.UI.HtmlControls.HtmlInputButton
Protected WithEvents lblUserName 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
Dim utl As Tools
utl = New Tools
If utl.IsLoggedIn = False Then
System.Web.HttpContext.Current.Response.Redirect("default.aspx")
End If
lblUserName.Text = "欢迎您 <b>" & Request.Cookies("email").Value & "</b><br><br>"
End Sub
Private Sub btnSubmit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSubmit.Click
Dim obj As C2CSystem.Item = New C2CSystem.Item
Dim strStatus As String
strStatus = obj.AddItem(txtItemName.Text, _
txtItemDesc.Text, _
txtAskPrice.Text, _
txtNotifyPrice.Text, _
Request.Cookies("personid").Value, _
txtExpDate.Text)
If IsNumeric(strStatus) Then
Response.Redirect("MenuForRegisteredUsers.aspx")
ElseIf Len(strStatus) > 1 Then
lblMsg.Text = "写入数据库时发生错误:" & strStatus
End If
End Sub
End Class
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -