欢迎来到虫虫下载站 | 资源下载 资源专辑 关于我们
虫虫下载站

frmm.vb

需要在.net环境下运行需要安装框架
VB
字号:
Public Class FRMM
    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 Label9 As System.Windows.Forms.Label
    Friend WithEvents Label8 As System.Windows.Forms.Label
    Friend WithEvents Label7 As System.Windows.Forms.Label
    Friend WithEvents Label6 As System.Windows.Forms.Label
    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 nudHID As System.Windows.Forms.NumericUpDown
    Friend WithEvents tbMName As System.Windows.Forms.TextBox
    Friend WithEvents tbMReportDate As System.Windows.Forms.TextBox
    Friend WithEvents tbMDoDate As System.Windows.Forms.TextBox
    Friend WithEvents nudMStuffFee As System.Windows.Forms.NumericUpDown
    Friend WithEvents tbMContent As System.Windows.Forms.TextBox
    Friend WithEvents btnReport As System.Windows.Forms.Button
    Friend WithEvents btnDo As System.Windows.Forms.Button
    Friend WithEvents nudMServeFee As System.Windows.Forms.NumericUpDown
    Friend WithEvents nudMSumFee As System.Windows.Forms.NumericUpDown
    <System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
        Me.Label9 = New System.Windows.Forms.Label()
        Me.Label8 = New System.Windows.Forms.Label()
        Me.Label7 = New System.Windows.Forms.Label()
        Me.Label6 = New System.Windows.Forms.Label()
        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()
        Me.nudHID = New System.Windows.Forms.NumericUpDown()
        Me.tbMName = New System.Windows.Forms.TextBox()
        Me.tbMReportDate = New System.Windows.Forms.TextBox()
        Me.tbMDoDate = New System.Windows.Forms.TextBox()
        Me.nudMStuffFee = New System.Windows.Forms.NumericUpDown()
        Me.nudMServeFee = New System.Windows.Forms.NumericUpDown()
        Me.nudMSumFee = New System.Windows.Forms.NumericUpDown()
        Me.tbMContent = New System.Windows.Forms.TextBox()
        Me.btnReport = New System.Windows.Forms.Button()
        Me.btnDo = New System.Windows.Forms.Button()
        CType(Me.nudHID, System.ComponentModel.ISupportInitialize).BeginInit()
        CType(Me.nudMStuffFee, System.ComponentModel.ISupportInitialize).BeginInit()
        CType(Me.nudMServeFee, System.ComponentModel.ISupportInitialize).BeginInit()
        CType(Me.nudMSumFee, System.ComponentModel.ISupportInitialize).BeginInit()
        Me.SuspendLayout()
        '
        'Label9
        '
        Me.Label9.Location = New System.Drawing.Point(16, 152)
        Me.Label9.Name = "Label9"
        Me.Label9.Size = New System.Drawing.Size(56, 15)
        Me.Label9.TabIndex = 17
        Me.Label9.Text = "报修内容"
        '
        'Label8
        '
        Me.Label8.Location = New System.Drawing.Point(16, 118)
        Me.Label8.Name = "Label8"
        Me.Label8.Size = New System.Drawing.Size(56, 15)
        Me.Label8.TabIndex = 16
        Me.Label8.Text = "总费用"
        '
        'Label7
        '
        Me.Label7.Location = New System.Drawing.Point(216, 84)
        Me.Label7.Name = "Label7"
        Me.Label7.Size = New System.Drawing.Size(56, 15)
        Me.Label7.TabIndex = 15
        Me.Label7.Text = "服务费"
        '
        'Label6
        '
        Me.Label6.Location = New System.Drawing.Point(16, 84)
        Me.Label6.Name = "Label6"
        Me.Label6.Size = New System.Drawing.Size(56, 15)
        Me.Label6.TabIndex = 14
        Me.Label6.Text = "材料费"
        '
        'Label4
        '
        Me.Label4.Location = New System.Drawing.Point(216, 49)
        Me.Label4.Name = "Label4"
        Me.Label4.Size = New System.Drawing.Size(56, 16)
        Me.Label4.TabIndex = 12
        Me.Label4.Text = "修理日期"
        '
        'Label3
        '
        Me.Label3.Location = New System.Drawing.Point(16, 50)
        Me.Label3.Name = "Label3"
        Me.Label3.Size = New System.Drawing.Size(56, 15)
        Me.Label3.TabIndex = 11
        Me.Label3.Text = "报修日期"
        '
        'Label2
        '
        Me.Label2.Location = New System.Drawing.Point(216, 16)
        Me.Label2.Name = "Label2"
        Me.Label2.Size = New System.Drawing.Size(56, 15)
        Me.Label2.TabIndex = 10
        Me.Label2.Text = "报修人"
        '
        'Label1
        '
        Me.Label1.Location = New System.Drawing.Point(16, 16)
        Me.Label1.Name = "Label1"
        Me.Label1.Size = New System.Drawing.Size(56, 15)
        Me.Label1.TabIndex = 9
        Me.Label1.Text = "房号"
        '
        'nudHID
        '
        Me.nudHID.Location = New System.Drawing.Point(80, 10)
        Me.nudHID.Maximum = New Decimal(New Integer() {10000, 0, 0, 0})
        Me.nudHID.Name = "nudHID"
        Me.nudHID.TabIndex = 18
        '
        'tbMName
        '
        Me.tbMName.Location = New System.Drawing.Point(290, 10)
        Me.tbMName.Name = "tbMName"
        Me.tbMName.Size = New System.Drawing.Size(120, 21)
        Me.tbMName.TabIndex = 19
        Me.tbMName.Text = ""
        '
        'tbMReportDate
        '
        Me.tbMReportDate.Location = New System.Drawing.Point(80, 47)
        Me.tbMReportDate.Name = "tbMReportDate"
        Me.tbMReportDate.Size = New System.Drawing.Size(120, 21)
        Me.tbMReportDate.TabIndex = 20
        Me.tbMReportDate.Text = ""
        '
        'tbMDoDate
        '
        Me.tbMDoDate.Location = New System.Drawing.Point(290, 47)
        Me.tbMDoDate.Name = "tbMDoDate"
        Me.tbMDoDate.Size = New System.Drawing.Size(120, 21)
        Me.tbMDoDate.TabIndex = 21
        Me.tbMDoDate.Text = ""
        '
        'nudMStuffFee
        '
        Me.nudMStuffFee.Location = New System.Drawing.Point(80, 81)
        Me.nudMStuffFee.Name = "nudMStuffFee"
        Me.nudMStuffFee.TabIndex = 22
        '
        'nudMServeFee
        '
        Me.nudMServeFee.Location = New System.Drawing.Point(290, 81)
        Me.nudMServeFee.Name = "nudMServeFee"
        Me.nudMServeFee.TabIndex = 23
        '
        'nudMSumFee
        '
        Me.nudMSumFee.Location = New System.Drawing.Point(80, 115)
        Me.nudMSumFee.Name = "nudMSumFee"
        Me.nudMSumFee.TabIndex = 24
        '
        'tbMContent
        '
        Me.tbMContent.Location = New System.Drawing.Point(6, 176)
        Me.tbMContent.Multiline = True
        Me.tbMContent.Name = "tbMContent"
        Me.tbMContent.Size = New System.Drawing.Size(404, 104)
        Me.tbMContent.TabIndex = 26
        Me.tbMContent.Text = ""
        '
        'btnReport
        '
        Me.btnReport.Location = New System.Drawing.Point(216, 144)
        Me.btnReport.Name = "btnReport"
        Me.btnReport.TabIndex = 27
        Me.btnReport.Text = "报修"
        '
        'btnDo
        '
        Me.btnDo.Location = New System.Drawing.Point(336, 144)
        Me.btnDo.Name = "btnDo"
        Me.btnDo.TabIndex = 28
        Me.btnDo.Text = "处理"
        '
        'FRMM
        '
        Me.AutoScaleBaseSize = New System.Drawing.Size(6, 14)
        Me.ClientSize = New System.Drawing.Size(416, 285)
        Me.Controls.AddRange(New System.Windows.Forms.Control() {Me.btnDo, Me.btnReport, Me.tbMContent, Me.nudMSumFee, Me.nudMServeFee, Me.nudMStuffFee, Me.tbMDoDate, Me.tbMReportDate, Me.tbMName, Me.nudHID, Me.Label9, Me.Label8, Me.Label7, Me.Label6, Me.Label4, Me.Label3, Me.Label2, Me.Label1})
        Me.Name = "FRMM"
        Me.Text = "FRMM"
        CType(Me.nudHID, System.ComponentModel.ISupportInitialize).EndInit()
        CType(Me.nudMStuffFee, System.ComponentModel.ISupportInitialize).EndInit()
        CType(Me.nudMServeFee, System.ComponentModel.ISupportInitialize).EndInit()
        CType(Me.nudMSumFee, System.ComponentModel.ISupportInitialize).EndInit()
        Me.ResumeLayout(False)

    End Sub

#End Region
    Private strDate As String
    Private Sub btnReport_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnReport.Click
        If nudHID.Text = "" Or tbMName.Text = "" Or tbMContent.Text = "" Then
            MsgBox("报修必须提供房号,报修人姓名,报修内容!", MsgBoxStyle.Exclamation, "OK")
            Exit Sub
        End If
        Dim sqlStr As String = "insert into mend(hID,mName,mContent,mReportDate) values(" & nudHID.Text & ",'"
        sqlStr = sqlStr & tbMName.Text & "','"
        sqlStr = sqlStr & tbMContent.Text & "','"
        sqlStr = sqlStr & strDate & "')"
        Dim dbopera1 As DbOpera = New DbOpera(sqlStr)
        dbopera1.opera()
        MsgBox("成功!", MsgBoxStyle.Exclamation, "OK")
    End Sub

    Private Sub btnDo_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnDo.Click
        If nudHID.Text = "" Or tbMReportDate.Text = "" Or nudMServeFee.Text = "" Or nudMStuffFee.Text = "" Then
            MsgBox("必须提供完整的信息!", MsgBoxStyle.Exclamation, "OK")
            Exit Sub
        ElseIf nudMSumFee.Text = "" Then
            MsgBox("必须提供完整的信息!", MsgBoxStyle.Exclamation, "OK")
            Exit Sub
        End If
        Dim sqlStr As String = "update mend set mServeFee=" & nudMServeFee.Text & ","
        sqlStr = sqlStr & "mStuffFee=" & nudMStuffFee.Text & ","
        sqlStr = sqlStr & "mSumFee=" & nudMSumFee.Text & ","
        sqlStr = sqlStr & "mDoDate='" & strDate & "',"
        sqlStr = sqlStr & "mDo='是'"
        sqlStr = sqlStr & " where hID=" & nudHID.Text & " and mReportDate='"
        sqlStr = sqlStr & tbMReportDate.Text & "'"
        Dim dbopera1 As DbOpera = New DbOpera(sqlStr)
        dbopera1.opera()
        MsgBox("成功!", MsgBoxStyle.Exclamation, "OK")
    End Sub

    Private Sub FRMM_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() & "日"
        tbMReportDate.Text = strDate
        tbMDoDate.Text = strDate
    End Sub
End Class

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -