frml.vb
字号:
Public Class FRML
Inherits System.Windows.Forms.Form
#Region " Windows 窗体设计器生成的代码 "
Public Sub New()
MyBase.New()
'该调用是 Windows 窗体设计器所必需的。
InitializeComponent()
'在 InitializeComponent() 调用之后添加任何初始化
End Sub
'窗体重写处置以清理组件列表。
Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
If disposing Then
If Not (components Is Nothing) Then
components.Dispose()
End If
End If
MyBase.Dispose(disposing)
End Sub
'Windows 窗体设计器所必需的
Private components As System.ComponentModel.IContainer
'注意:以下过程是 Windows 窗体设计器所必需的
'可以使用 Windows 窗体设计器修改此过程。
'不要使用代码编辑器修改它。
Friend WithEvents nudHID As System.Windows.Forms.NumericUpDown
Friend WithEvents Label1 As System.Windows.Forms.Label
Friend WithEvents tbLName As System.Windows.Forms.TextBox
Friend WithEvents Label2 As System.Windows.Forms.Label
Friend WithEvents tbLAnswerDate As System.Windows.Forms.TextBox
Friend WithEvents tbLDate As System.Windows.Forms.TextBox
Friend WithEvents Label4 As System.Windows.Forms.Label
Friend WithEvents Label3 As System.Windows.Forms.Label
Friend WithEvents tbLContent As System.Windows.Forms.TextBox
Friend WithEvents Label9 As System.Windows.Forms.Label
Friend WithEvents btnLodge As System.Windows.Forms.Button
Friend WithEvents btnAnswer As System.Windows.Forms.Button
<System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
Me.nudHID = New System.Windows.Forms.NumericUpDown()
Me.Label1 = New System.Windows.Forms.Label()
Me.tbLName = New System.Windows.Forms.TextBox()
Me.Label2 = New System.Windows.Forms.Label()
Me.tbLAnswerDate = New System.Windows.Forms.TextBox()
Me.tbLDate = New System.Windows.Forms.TextBox()
Me.Label4 = New System.Windows.Forms.Label()
Me.Label3 = New System.Windows.Forms.Label()
Me.tbLContent = New System.Windows.Forms.TextBox()
Me.Label9 = New System.Windows.Forms.Label()
Me.btnLodge = New System.Windows.Forms.Button()
Me.btnAnswer = New System.Windows.Forms.Button()
CType(Me.nudHID, System.ComponentModel.ISupportInitialize).BeginInit()
Me.SuspendLayout()
'
'nudHID
'
Me.nudHID.Location = New System.Drawing.Point(72, 13)
Me.nudHID.Maximum = New Decimal(New Integer() {10000, 0, 0, 0})
Me.nudHID.Name = "nudHID"
Me.nudHID.TabIndex = 20
'
'Label1
'
Me.Label1.Location = New System.Drawing.Point(6, 16)
Me.Label1.Name = "Label1"
Me.Label1.Size = New System.Drawing.Size(56, 15)
Me.Label1.TabIndex = 19
Me.Label1.Text = "房号"
'
'tbLName
'
Me.tbLName.Location = New System.Drawing.Point(290, 13)
Me.tbLName.Name = "tbLName"
Me.tbLName.Size = New System.Drawing.Size(120, 21)
Me.tbLName.TabIndex = 22
Me.tbLName.Text = ""
'
'Label2
'
Me.Label2.Location = New System.Drawing.Point(208, 16)
Me.Label2.Name = "Label2"
Me.Label2.Size = New System.Drawing.Size(56, 15)
Me.Label2.TabIndex = 21
Me.Label2.Text = "投诉人"
'
'tbLAnswerDate
'
Me.tbLAnswerDate.Location = New System.Drawing.Point(290, 53)
Me.tbLAnswerDate.Name = "tbLAnswerDate"
Me.tbLAnswerDate.Size = New System.Drawing.Size(120, 21)
Me.tbLAnswerDate.TabIndex = 26
Me.tbLAnswerDate.Text = ""
'
'tbLDate
'
Me.tbLDate.Location = New System.Drawing.Point(72, 53)
Me.tbLDate.Name = "tbLDate"
Me.tbLDate.Size = New System.Drawing.Size(120, 21)
Me.tbLDate.TabIndex = 25
Me.tbLDate.Text = ""
'
'Label4
'
Me.Label4.Location = New System.Drawing.Point(208, 55)
Me.Label4.Name = "Label4"
Me.Label4.Size = New System.Drawing.Size(56, 16)
Me.Label4.TabIndex = 24
Me.Label4.Text = "答复日期"
'
'Label3
'
Me.Label3.Location = New System.Drawing.Point(6, 56)
Me.Label3.Name = "Label3"
Me.Label3.Size = New System.Drawing.Size(56, 15)
Me.Label3.TabIndex = 23
Me.Label3.Text = "投诉日期"
'
'tbLContent
'
Me.tbLContent.Location = New System.Drawing.Point(6, 112)
Me.tbLContent.Multiline = True
Me.tbLContent.Name = "tbLContent"
Me.tbLContent.Size = New System.Drawing.Size(404, 104)
Me.tbLContent.TabIndex = 28
Me.tbLContent.Text = ""
'
'Label9
'
Me.Label9.Location = New System.Drawing.Point(6, 88)
Me.Label9.Name = "Label9"
Me.Label9.Size = New System.Drawing.Size(56, 15)
Me.Label9.TabIndex = 27
Me.Label9.Text = "投诉内容"
'
'btnLodge
'
Me.btnLodge.Location = New System.Drawing.Point(208, 84)
Me.btnLodge.Name = "btnLodge"
Me.btnLodge.TabIndex = 29
Me.btnLodge.Text = "投诉"
'
'btnAnswer
'
Me.btnAnswer.Location = New System.Drawing.Point(335, 84)
Me.btnAnswer.Name = "btnAnswer"
Me.btnAnswer.TabIndex = 30
Me.btnAnswer.Text = "答复"
'
'FRML
'
Me.AutoScaleBaseSize = New System.Drawing.Size(6, 14)
Me.ClientSize = New System.Drawing.Size(416, 221)
Me.Controls.AddRange(New System.Windows.Forms.Control() {Me.btnAnswer, Me.btnLodge, Me.tbLContent, Me.Label9, Me.tbLAnswerDate, Me.tbLDate, Me.Label4, Me.Label3, Me.tbLName, Me.Label2, Me.nudHID, Me.Label1})
Me.Name = "FRML"
Me.Text = "FRML"
CType(Me.nudHID, System.ComponentModel.ISupportInitialize).EndInit()
Me.ResumeLayout(False)
End Sub
#End Region
Private strDate As String
Private Sub FRML_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
strDate = Date.Today.Year.ToString() & "年" & Date.Today.Month.ToString() & "月" & Date.Today.Day.ToString() & "日"
tbLDate.Text = strDate
tbLAnswerDate.Text = strDate
End Sub
Private Sub btnLodge_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnLodge.Click
If nudHID.Text = "" Or tbLName.Text = "" Or tbLDate.Text = "" Or tbLContent.Text = "" Then
MsgBox("请填入必要的信息!", MsgBoxStyle.Exclamation, "OK")
Exit Sub
End If
Dim sqlStr As String
sqlStr = "insert into lodge(hID,lName,lDate,lContent) values(" & nudHID.Text & ",'"
sqlStr = sqlStr & tbLName.Text & "','"
sqlStr = sqlStr & strDate & "','"
sqlStr = sqlStr & tbLContent.Text & "')"
Dim dbopera1 As DbOpera = New DbOpera(sqlStr)
dbopera1.opera()
MsgBox("成功!", MsgBoxStyle.Exclamation, "OK")
End Sub
Private Sub btnAnswer_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnAnswer.Click
If nudHID.Text = "" Or tbLDate.Text = "" Then
MsgBox("请填入必要的信息!", MsgBoxStyle.Exclamation, "OK")
Exit Sub
End If
Dim sqlStr As String
sqlStr = "update lodge set lAnswerDate='" & strDate & "',lUse='是'"
sqlStr = sqlStr & " where hID=" & nudHID.Text & " and lDate='" & tbLDate.Text & "'"
Dim dbopera1 As DbOpera = New DbOpera(sqlStr)
dbopera1.opera()
MsgBox("成功!", MsgBoxStyle.Exclamation, "OK")
End Sub
End Class
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -