frme.vb
字号:
Public Class FRME
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 btnSure As System.Windows.Forms.Button
Friend WithEvents btnCancle As System.Windows.Forms.Button
Friend WithEvents nudHID As System.Windows.Forms.NumericUpDown
Friend WithEvents Label4 As System.Windows.Forms.Label
Friend WithEvents Label3 As System.Windows.Forms.Label
Friend WithEvents Label2 As System.Windows.Forms.Label
Friend WithEvents Label1 As System.Windows.Forms.Label
Friend WithEvents tbEUse As System.Windows.Forms.TextBox
Friend WithEvents tbEEnd As System.Windows.Forms.TextBox
Friend WithEvents tbEStart As System.Windows.Forms.TextBox
<System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
Me.btnSure = New System.Windows.Forms.Button()
Me.btnCancle = New System.Windows.Forms.Button()
Me.nudHID = New System.Windows.Forms.NumericUpDown()
Me.tbEUse = New System.Windows.Forms.TextBox()
Me.tbEEnd = New System.Windows.Forms.TextBox()
Me.tbEStart = New System.Windows.Forms.TextBox()
Me.Label4 = New System.Windows.Forms.Label()
Me.Label3 = New System.Windows.Forms.Label()
Me.Label2 = New System.Windows.Forms.Label()
Me.Label1 = New System.Windows.Forms.Label()
CType(Me.nudHID, System.ComponentModel.ISupportInitialize).BeginInit()
Me.SuspendLayout()
'
'btnSure
'
Me.btnSure.Location = New System.Drawing.Point(187, 205)
Me.btnSure.Name = "btnSure"
Me.btnSure.TabIndex = 20
Me.btnSure.Text = "确定"
'
'btnCancle
'
Me.btnCancle.Location = New System.Drawing.Point(30, 205)
Me.btnCancle.Name = "btnCancle"
Me.btnCancle.TabIndex = 19
Me.btnCancle.Text = "取消"
'
'nudHID
'
Me.nudHID.Location = New System.Drawing.Point(150, 45)
Me.nudHID.Maximum = New Decimal(New Integer() {10000, 0, 0, 0})
Me.nudHID.Name = "nudHID"
Me.nudHID.Size = New System.Drawing.Size(112, 21)
Me.nudHID.TabIndex = 18
'
'tbEUse
'
Me.tbEUse.Location = New System.Drawing.Point(150, 156)
Me.tbEUse.Name = "tbEUse"
Me.tbEUse.Size = New System.Drawing.Size(112, 21)
Me.tbEUse.TabIndex = 17
Me.tbEUse.Text = ""
'
'tbEEnd
'
Me.tbEEnd.Location = New System.Drawing.Point(150, 119)
Me.tbEEnd.Name = "tbEEnd"
Me.tbEEnd.Size = New System.Drawing.Size(112, 21)
Me.tbEEnd.TabIndex = 16
Me.tbEEnd.Text = ""
'
'tbEStart
'
Me.tbEStart.Location = New System.Drawing.Point(150, 82)
Me.tbEStart.Name = "tbEStart"
Me.tbEStart.Size = New System.Drawing.Size(112, 21)
Me.tbEStart.TabIndex = 15
Me.tbEStart.Text = ""
'
'Label4
'
Me.Label4.Location = New System.Drawing.Point(30, 161)
Me.Label4.Name = "Label4"
Me.Label4.Size = New System.Drawing.Size(56, 16)
Me.Label4.TabIndex = 14
Me.Label4.Text = "本月用电"
'
'Label3
'
Me.Label3.Location = New System.Drawing.Point(30, 124)
Me.Label3.Name = "Label3"
Me.Label3.Size = New System.Drawing.Size(56, 16)
Me.Label3.TabIndex = 13
Me.Label3.Text = "月末截止"
'
'Label2
'
Me.Label2.Location = New System.Drawing.Point(30, 87)
Me.Label2.Name = "Label2"
Me.Label2.Size = New System.Drawing.Size(56, 16)
Me.Label2.TabIndex = 12
Me.Label2.Text = "月初起始"
'
'Label1
'
Me.Label1.Location = New System.Drawing.Point(30, 50)
Me.Label1.Name = "Label1"
Me.Label1.Size = New System.Drawing.Size(56, 16)
Me.Label1.TabIndex = 11
Me.Label1.Text = "房号"
'
'FRME
'
Me.AutoScaleBaseSize = New System.Drawing.Size(6, 14)
Me.ClientSize = New System.Drawing.Size(292, 273)
Me.Controls.AddRange(New System.Windows.Forms.Control() {Me.btnSure, Me.btnCancle, Me.nudHID, Me.tbEUse, Me.tbEEnd, Me.tbEStart, Me.Label4, Me.Label3, Me.Label2, Me.Label1})
Me.Name = "FRME"
Me.Text = "FRME"
CType(Me.nudHID, System.ComponentModel.ISupportInitialize).EndInit()
Me.ResumeLayout(False)
End Sub
#End Region
Private Sub FRME_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
End Sub
Private Sub btnCancle_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnCancle.Click
nudHID.Text = "0"
tbEStart.Text = ""
tbEEnd.Text = ""
tbEUse.Text = ""
End Sub
Private Sub btnSure_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSure.Click
If Not check() Then
Exit Sub
End If
Dim eCost As Integer
Dim sqlStr As String = "select iEletrity from information "
Dim dbopera1 As DbOpera = New DbOpera(sqlStr)
Dim iEletrity As Integer = dbopera1.getSum() '水费单价
Dim eUse As Integer = Val(tbEUse.Text)
eCost = Int(eUse * iEletrity / 100) '计算水费
sqlStr = "update eletrityCost set eStart=" & tbEStart.Text & ",eEnd=" & tbEEnd.Text & ",eUse="
sqlStr = sqlStr & tbEUse.Text & ",eCost=" & eCost.ToString()
sqlStr = sqlStr & " where hID=" & nudHID.Text
Dim dbopera2 As DbOpera = New DbOpera(sqlStr)
dbopera2.opera()
End Sub
Private Function check() As Boolean
If nudHID.Text = "" Or tbEStart.Text = "" Or tbEEnd.Text = "" Or tbEUse.Text = "" Then
check = False
MsgBox("请输入必要的信息!", MsgBoxStyle.Exclamation, "OK")
Else
check = True
End If
End Function
End Class
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -