frmc.vb
字号:
Public Class FRMC
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 Label1 As System.Windows.Forms.Label
Friend WithEvents Label2 As System.Windows.Forms.Label
Friend WithEvents nudHID As System.Windows.Forms.NumericUpDown
Friend WithEvents nudMoney As System.Windows.Forms.NumericUpDown
Friend WithEvents btnCancle As System.Windows.Forms.Button
Friend WithEvents btnSure As System.Windows.Forms.Button
<System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
Me.Label1 = New System.Windows.Forms.Label()
Me.Label2 = New System.Windows.Forms.Label()
Me.nudHID = New System.Windows.Forms.NumericUpDown()
Me.nudMoney = New System.Windows.Forms.NumericUpDown()
Me.btnCancle = New System.Windows.Forms.Button()
Me.btnSure = New System.Windows.Forms.Button()
CType(Me.nudHID, System.ComponentModel.ISupportInitialize).BeginInit()
CType(Me.nudMoney, System.ComponentModel.ISupportInitialize).BeginInit()
Me.SuspendLayout()
'
'Label1
'
Me.Label1.Location = New System.Drawing.Point(16, 16)
Me.Label1.Name = "Label1"
Me.Label1.Size = New System.Drawing.Size(32, 16)
Me.Label1.TabIndex = 0
Me.Label1.Text = "房号"
'
'Label2
'
Me.Label2.Location = New System.Drawing.Point(16, 50)
Me.Label2.Name = "Label2"
Me.Label2.Size = New System.Drawing.Size(32, 16)
Me.Label2.TabIndex = 2
Me.Label2.Text = "金额"
'
'nudHID
'
Me.nudHID.Location = New System.Drawing.Point(64, 14)
Me.nudHID.Maximum = New Decimal(New Integer() {10000, 0, 0, 0})
Me.nudHID.Name = "nudHID"
Me.nudHID.TabIndex = 3
'
'nudMoney
'
Me.nudMoney.Location = New System.Drawing.Point(64, 48)
Me.nudMoney.Maximum = New Decimal(New Integer() {100000, 0, 0, 0})
Me.nudMoney.Name = "nudMoney"
Me.nudMoney.TabIndex = 4
'
'btnCancle
'
Me.btnCancle.Location = New System.Drawing.Point(16, 96)
Me.btnCancle.Name = "btnCancle"
Me.btnCancle.TabIndex = 5
Me.btnCancle.Text = "取消"
'
'btnSure
'
Me.btnSure.Location = New System.Drawing.Point(109, 96)
Me.btnSure.Name = "btnSure"
Me.btnSure.TabIndex = 6
Me.btnSure.Text = "确定"
'
'FRMC
'
Me.AutoScaleBaseSize = New System.Drawing.Size(6, 14)
Me.ClientSize = New System.Drawing.Size(200, 125)
Me.Controls.AddRange(New System.Windows.Forms.Control() {Me.btnSure, Me.btnCancle, Me.nudMoney, Me.nudHID, Me.Label2, Me.Label1})
Me.Name = "FRMC"
Me.Text = "FRMC"
CType(Me.nudHID, System.ComponentModel.ISupportInitialize).EndInit()
CType(Me.nudMoney, System.ComponentModel.ISupportInitialize).EndInit()
Me.ResumeLayout(False)
End Sub
#End Region
Private strDate As String
Private Sub btnCancle_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnCancle.Click
nudHID.Text = "0"
nudMoney.Text = "0"
End Sub
Private Sub btnSure_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSure.Click
If nudHID.Text = "" Or nudMoney.Text = "" Then
MsgBox("请输入必要的信息!", MsgBoxStyle.Exclamation, "OK")
Exit Sub
End If
Dim sqlStr As String = "select hoMoney from houseOwner where hID=" & nudHID.Text
Dim dbopera1 As DbOpera = New DbOpera(sqlStr)
Dim sum As Integer = dbopera1.getSum()
sum = sum - Val(nudMoney.Text)
sqlStr = "update houseOwner set hoMoney=" & sum.ToString()
sqlStr = sqlStr & ",hoCostDate='" & strDate & "'"
sqlStr = sqlStr & " where hID=" & nudHID.Text
Dim dbopera2 As DbOpera = New DbOpera(sqlStr)
dbopera2.opera()
MsgBox("成功!", MsgBoxStyle.Exclamation, "OK")
End Sub
Private Sub FRMC_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() & "日"
End Sub
End Class
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -