⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 frmadduser.vb

📁 Visual Basic 2005数据库通用模块开发与系统移植 物业管理信息系统
💻 VB
字号:
Public Class FrmAddUser
    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 TxtPassword As System.Windows.Forms.TextBox
    Friend WithEvents TxtName As System.Windows.Forms.TextBox
    Friend WithEvents Label2 As System.Windows.Forms.Label
    Friend WithEvents Label1 As System.Windows.Forms.Label
    Friend WithEvents BtCancel As System.Windows.Forms.Button
    Friend WithEvents Label3 As System.Windows.Forms.Label
    Friend WithEvents TxtRealName As System.Windows.Forms.TextBox
    Friend WithEvents TxtMemo As System.Windows.Forms.TextBox
    Friend WithEvents Label4 As System.Windows.Forms.Label
    Friend WithEvents GroupBox2 As System.Windows.Forms.GroupBox
    Friend WithEvents ComboModRepair As System.Windows.Forms.ComboBox
    Friend WithEvents Label7 As System.Windows.Forms.Label
    Friend WithEvents ComboModFee As System.Windows.Forms.ComboBox
    Friend WithEvents ComboModHouse As System.Windows.Forms.ComboBox
    Friend WithEvents Label6 As System.Windows.Forms.Label
    Friend WithEvents Label9 As System.Windows.Forms.Label
    Friend WithEvents BtOK As System.Windows.Forms.Button
    <System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
        Me.TxtPassword = New System.Windows.Forms.TextBox
        Me.TxtName = New System.Windows.Forms.TextBox
        Me.Label2 = New System.Windows.Forms.Label
        Me.Label1 = New System.Windows.Forms.Label
        Me.BtCancel = New System.Windows.Forms.Button
        Me.BtOK = New System.Windows.Forms.Button
        Me.Label3 = New System.Windows.Forms.Label
        Me.TxtRealName = New System.Windows.Forms.TextBox
        Me.TxtMemo = New System.Windows.Forms.TextBox
        Me.Label4 = New System.Windows.Forms.Label
        Me.GroupBox2 = New System.Windows.Forms.GroupBox
        Me.ComboModRepair = New System.Windows.Forms.ComboBox
        Me.Label7 = New System.Windows.Forms.Label
        Me.ComboModFee = New System.Windows.Forms.ComboBox
        Me.ComboModHouse = New System.Windows.Forms.ComboBox
        Me.Label6 = New System.Windows.Forms.Label
        Me.Label9 = New System.Windows.Forms.Label
        Me.GroupBox2.SuspendLayout()
        Me.SuspendLayout()
        '
        'TxtPassword
        '
        Me.TxtPassword.Location = New System.Drawing.Point(77, 53)
        Me.TxtPassword.MaxLength = 10
        Me.TxtPassword.Name = "TxtPassword"
        Me.TxtPassword.Size = New System.Drawing.Size(120, 21)
        Me.TxtPassword.TabIndex = 11
        '
        'TxtName
        '
        Me.TxtName.Location = New System.Drawing.Point(77, 15)
        Me.TxtName.MaxLength = 10
        Me.TxtName.Name = "TxtName"
        Me.TxtName.Size = New System.Drawing.Size(120, 21)
        Me.TxtName.TabIndex = 10
        '
        'Label2
        '
        Me.Label2.Location = New System.Drawing.Point(23, 57)
        Me.Label2.Name = "Label2"
        Me.Label2.Size = New System.Drawing.Size(48, 24)
        Me.Label2.TabIndex = 9
        Me.Label2.Text = "密码:"
        '
        'Label1
        '
        Me.Label1.Location = New System.Drawing.Point(15, 18)
        Me.Label1.Name = "Label1"
        Me.Label1.Size = New System.Drawing.Size(56, 24)
        Me.Label1.TabIndex = 8
        Me.Label1.Text = "用户名:"
        '
        'BtCancel
        '
        Me.BtCancel.Location = New System.Drawing.Point(235, 257)
        Me.BtCancel.Name = "BtCancel"
        Me.BtCancel.Size = New System.Drawing.Size(95, 24)
        Me.BtCancel.TabIndex = 7
        Me.BtCancel.Text = "取消"
        '
        'BtOK
        '
        Me.BtOK.Location = New System.Drawing.Point(77, 257)
        Me.BtOK.Name = "BtOK"
        Me.BtOK.Size = New System.Drawing.Size(92, 24)
        Me.BtOK.TabIndex = 6
        Me.BtOK.Text = "确定"
        '
        'Label3
        '
        Me.Label3.AutoSize = True
        Me.Label3.Location = New System.Drawing.Point(216, 21)
        Me.Label3.Name = "Label3"
        Me.Label3.Size = New System.Drawing.Size(65, 12)
        Me.Label3.TabIndex = 12
        Me.Label3.Text = "真实姓名:"
        '
        'TxtRealName
        '
        Me.TxtRealName.Location = New System.Drawing.Point(287, 15)
        Me.TxtRealName.Name = "TxtRealName"
        Me.TxtRealName.Size = New System.Drawing.Size(120, 21)
        Me.TxtRealName.TabIndex = 13
        '
        'TxtMemo
        '
        Me.TxtMemo.Location = New System.Drawing.Point(287, 56)
        Me.TxtMemo.MaxLength = 10
        Me.TxtMemo.Name = "TxtMemo"
        Me.TxtMemo.Size = New System.Drawing.Size(120, 21)
        Me.TxtMemo.TabIndex = 15
        '
        'Label4
        '
        Me.Label4.Location = New System.Drawing.Point(233, 62)
        Me.Label4.Name = "Label4"
        Me.Label4.Size = New System.Drawing.Size(48, 24)
        Me.Label4.TabIndex = 14
        Me.Label4.Text = "备注:"
        '
        'GroupBox2
        '
        Me.GroupBox2.Controls.Add(Me.ComboModRepair)
        Me.GroupBox2.Controls.Add(Me.Label7)
        Me.GroupBox2.Controls.Add(Me.ComboModFee)
        Me.GroupBox2.Controls.Add(Me.ComboModHouse)
        Me.GroupBox2.Controls.Add(Me.Label6)
        Me.GroupBox2.Controls.Add(Me.Label9)
        Me.GroupBox2.Location = New System.Drawing.Point(12, 89)
        Me.GroupBox2.Name = "GroupBox2"
        Me.GroupBox2.Size = New System.Drawing.Size(395, 148)
        Me.GroupBox2.TabIndex = 39
        Me.GroupBox2.TabStop = False
        Me.GroupBox2.Text = "权限设置"
        '
        'ComboModRepair
        '
        Me.ComboModRepair.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList
        Me.ComboModRepair.FormattingEnabled = True
        Me.ComboModRepair.Items.AddRange(New Object() {"无权限", "可读", "可读写"})
        Me.ComboModRepair.Location = New System.Drawing.Point(121, 103)
        Me.ComboModRepair.Name = "ComboModRepair"
        Me.ComboModRepair.Size = New System.Drawing.Size(254, 20)
        Me.ComboModRepair.TabIndex = 6
        '
        'Label7
        '
        Me.Label7.AutoSize = True
        Me.Label7.Location = New System.Drawing.Point(20, 108)
        Me.Label7.Name = "Label7"
        Me.Label7.Size = New System.Drawing.Size(89, 12)
        Me.Label7.TabIndex = 4
        Me.Label7.Text = "报修信息模块:"
        '
        'ComboModFee
        '
        Me.ComboModFee.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList
        Me.ComboModFee.FormattingEnabled = True
        Me.ComboModFee.Items.AddRange(New Object() {"无权限", "可读", "可读写"})
        Me.ComboModFee.Location = New System.Drawing.Point(123, 65)
        Me.ComboModFee.Name = "ComboModFee"
        Me.ComboModFee.Size = New System.Drawing.Size(252, 20)
        Me.ComboModFee.TabIndex = 3
        '
        'ComboModHouse
        '
        Me.ComboModHouse.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList
        Me.ComboModHouse.FormattingEnabled = True
        Me.ComboModHouse.Items.AddRange(New Object() {"无权限", "可读", "可读写"})
        Me.ComboModHouse.Location = New System.Drawing.Point(121, 28)
        Me.ComboModHouse.Name = "ComboModHouse"
        Me.ComboModHouse.Size = New System.Drawing.Size(254, 20)
        Me.ComboModHouse.TabIndex = 2
        '
        'Label6
        '
        Me.Label6.AutoSize = True
        Me.Label6.Location = New System.Drawing.Point(23, 69)
        Me.Label6.Name = "Label6"
        Me.Label6.Size = New System.Drawing.Size(89, 12)
        Me.Label6.TabIndex = 1
        Me.Label6.Text = "物业收费模块:"
        '
        'Label9
        '
        Me.Label9.AutoSize = True
        Me.Label9.Location = New System.Drawing.Point(22, 33)
        Me.Label9.Name = "Label9"
        Me.Label9.Size = New System.Drawing.Size(89, 12)
        Me.Label9.TabIndex = 0
        Me.Label9.Text = "业主信息模块:"
        '
        'FrmAddUser
        '
        Me.AutoScaleBaseSize = New System.Drawing.Size(6, 14)
        Me.ClientSize = New System.Drawing.Size(419, 301)
        Me.Controls.Add(Me.GroupBox2)
        Me.Controls.Add(Me.TxtMemo)
        Me.Controls.Add(Me.Label4)
        Me.Controls.Add(Me.TxtRealName)
        Me.Controls.Add(Me.Label3)
        Me.Controls.Add(Me.TxtPassword)
        Me.Controls.Add(Me.TxtName)
        Me.Controls.Add(Me.Label2)
        Me.Controls.Add(Me.Label1)
        Me.Controls.Add(Me.BtCancel)
        Me.Controls.Add(Me.BtOK)
        Me.MaximizeBox = False
        Me.MinimizeBox = False
        Me.Name = "FrmAddUser"
        Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent
        Me.Text = "添加用户"
        Me.TopMost = True
        Me.GroupBox2.ResumeLayout(False)
        Me.GroupBox2.PerformLayout()
        Me.ResumeLayout(False)
        Me.PerformLayout()

    End Sub

#End Region

    Private Sub BtCancel_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BtCancel.Click
        Me.Close()
    End Sub

    Private Sub BtOK_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BtOK.Click
        If Trim(TxtName.Text) = "" Then
            MsgBox("输入的用户名不能为空!", MsgBoxStyle.Exclamation, "信息框")
            Exit Sub
        End If
        If Trim(TxtRealName.Text) = "" Then
            MsgBox("输入的用户真实姓名不能为空!", MsgBoxStyle.Exclamation, "信息框")
            Exit Sub
        End If
        If Trim(TxtPassword.Text) = "" Then
            MsgBox("输入的密码不能为空!", MsgBoxStyle.Exclamation, "信息框")
            Exit Sub
        End If
        Dim TempUser As New DBUser(Trim(TxtName.Text), TxtPassword.Text)
        TempUser.RealName = Trim(TxtRealName.Text)
        TempUser.ModHouse = Trim(ComboModHouse.Text)
        TempUser.ModFee = Trim(ComboModFee.Text)
        TempUser.ModRepair = Trim(ComboModRepair.Text)
        TempUser.Memo = Trim(TxtMemo.Text)
        User.AddUser(TempUser)
    End Sub


    Private Sub FrmAddUser_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        ComboModHouse.SelectedIndex = 0
        ComboModFee.SelectedIndex = 0
        ComboModRepair.SelectedIndex = 0
    End Sub
End Class

⌨️ 快捷键说明

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