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

📄 clientaddmod.vb

📁 本文件为进销存管理系统的代码 在VB的环境下运行 用比较简单的结构完成的
💻 VB
字号:
Public Class ClientAddMod
    Inherits System.Windows.Forms.Form

#Region " Windows 窗体设计器生成的代码 "

    Public Sub New()
        MyBase.New()

        '该调用是 Windows 窗体设计器所必需的。
        InitializeComponent()

        '在 InitializeComponent() 调用之后添加任何初始化

    End Sub

    '窗体重写 dispose 以清理组件列表。
    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 Label3 As System.Windows.Forms.Label
    Friend WithEvents Label4 As System.Windows.Forms.Label
    Friend WithEvents Label5 As System.Windows.Forms.Label
    Friend WithEvents Label7 As System.Windows.Forms.Label
    Friend WithEvents txtClientName As System.Windows.Forms.TextBox
    Friend WithEvents txtClientCom As System.Windows.Forms.TextBox
    Friend WithEvents txtClientAdd As System.Windows.Forms.TextBox
    Friend WithEvents txtClientTEL As System.Windows.Forms.TextBox
    Friend WithEvents txtClientEmail As System.Windows.Forms.TextBox
    Friend WithEvents cmdOk As System.Windows.Forms.Button
    Friend WithEvents cmdCancel As System.Windows.Forms.Button
    Friend WithEvents txtClientRemark As System.Windows.Forms.TextBox
    <System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
        Me.Label1 = New System.Windows.Forms.Label
        Me.Label2 = New System.Windows.Forms.Label
        Me.Label3 = New System.Windows.Forms.Label
        Me.Label4 = New System.Windows.Forms.Label
        Me.Label5 = New System.Windows.Forms.Label
        Me.txtClientName = New System.Windows.Forms.TextBox
        Me.txtClientCom = New System.Windows.Forms.TextBox
        Me.txtClientAdd = New System.Windows.Forms.TextBox
        Me.txtClientTEL = New System.Windows.Forms.TextBox
        Me.txtClientEmail = New System.Windows.Forms.TextBox
        Me.txtClientRemark = New System.Windows.Forms.TextBox
        Me.Label7 = New System.Windows.Forms.Label
        Me.cmdOk = New System.Windows.Forms.Button
        Me.cmdCancel = New System.Windows.Forms.Button
        Me.SuspendLayout()
        '
        'Label1
        '
        Me.Label1.Location = New System.Drawing.Point(48, 24)
        Me.Label1.Name = "Label1"
        Me.Label1.Size = New System.Drawing.Size(56, 16)
        Me.Label1.TabIndex = 0
        Me.Label1.Text = "客户名:"
        '
        'Label2
        '
        Me.Label2.Location = New System.Drawing.Point(48, 64)
        Me.Label2.Name = "Label2"
        Me.Label2.Size = New System.Drawing.Size(72, 16)
        Me.Label2.TabIndex = 1
        Me.Label2.Text = "公司名称:"
        '
        'Label3
        '
        Me.Label3.Location = New System.Drawing.Point(48, 104)
        Me.Label3.Name = "Label3"
        Me.Label3.Size = New System.Drawing.Size(48, 16)
        Me.Label3.TabIndex = 2
        Me.Label3.Text = "地址:"
        '
        'Label4
        '
        Me.Label4.Location = New System.Drawing.Point(48, 184)
        Me.Label4.Name = "Label4"
        Me.Label4.Size = New System.Drawing.Size(72, 16)
        Me.Label4.TabIndex = 3
        Me.Label4.Text = "联系电话:"
        '
        'Label5
        '
        Me.Label5.Location = New System.Drawing.Point(48, 144)
        Me.Label5.Name = "Label5"
        Me.Label5.Size = New System.Drawing.Size(48, 16)
        Me.Label5.TabIndex = 4
        Me.Label5.Text = "Email:"
        '
        'txtClientName
        '
        Me.txtClientName.Location = New System.Drawing.Point(128, 16)
        Me.txtClientName.MaxLength = 10
        Me.txtClientName.Name = "txtClientName"
        Me.txtClientName.Size = New System.Drawing.Size(184, 21)
        Me.txtClientName.TabIndex = 5
        Me.txtClientName.Text = ""
        '
        'txtClientCom
        '
        Me.txtClientCom.Location = New System.Drawing.Point(128, 56)
        Me.txtClientCom.MaxLength = 50
        Me.txtClientCom.Name = "txtClientCom"
        Me.txtClientCom.Size = New System.Drawing.Size(184, 21)
        Me.txtClientCom.TabIndex = 6
        Me.txtClientCom.Text = ""
        '
        'txtClientAdd
        '
        Me.txtClientAdd.Location = New System.Drawing.Point(128, 96)
        Me.txtClientAdd.MaxLength = 50
        Me.txtClientAdd.Name = "txtClientAdd"
        Me.txtClientAdd.Size = New System.Drawing.Size(184, 21)
        Me.txtClientAdd.TabIndex = 7
        Me.txtClientAdd.Text = ""
        '
        'txtClientTEL
        '
        Me.txtClientTEL.Location = New System.Drawing.Point(128, 176)
        Me.txtClientTEL.MaxLength = 16
        Me.txtClientTEL.Name = "txtClientTEL"
        Me.txtClientTEL.Size = New System.Drawing.Size(184, 21)
        Me.txtClientTEL.TabIndex = 8
        Me.txtClientTEL.Text = ""
        '
        'txtClientEmail
        '
        Me.txtClientEmail.Location = New System.Drawing.Point(128, 136)
        Me.txtClientEmail.MaxLength = 20
        Me.txtClientEmail.Name = "txtClientEmail"
        Me.txtClientEmail.Size = New System.Drawing.Size(184, 21)
        Me.txtClientEmail.TabIndex = 9
        Me.txtClientEmail.Text = ""
        '
        'txtClientRemark
        '
        Me.txtClientRemark.Location = New System.Drawing.Point(128, 208)
        Me.txtClientRemark.MaxLength = 50
        Me.txtClientRemark.Multiline = True
        Me.txtClientRemark.Name = "txtClientRemark"
        Me.txtClientRemark.Size = New System.Drawing.Size(184, 72)
        Me.txtClientRemark.TabIndex = 12
        Me.txtClientRemark.Text = ""
        '
        'Label7
        '
        Me.Label7.Location = New System.Drawing.Point(48, 224)
        Me.Label7.Name = "Label7"
        Me.Label7.Size = New System.Drawing.Size(64, 16)
        Me.Label7.TabIndex = 13
        Me.Label7.Text = "备注:"
        '
        'cmdOk
        '
        Me.cmdOk.Location = New System.Drawing.Point(64, 304)
        Me.cmdOk.Name = "cmdOk"
        Me.cmdOk.TabIndex = 14
        Me.cmdOk.Text = "确 定"
        '
        'cmdCancel
        '
        Me.cmdCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel
        Me.cmdCancel.Location = New System.Drawing.Point(208, 304)
        Me.cmdCancel.Name = "cmdCancel"
        Me.cmdCancel.TabIndex = 15
        Me.cmdCancel.Text = "取 消"
        '
        'ClientAddMod
        '
        Me.AcceptButton = Me.cmdOk
        Me.AutoScaleBaseSize = New System.Drawing.Size(6, 14)
        Me.CancelButton = Me.cmdCancel
        Me.ClientSize = New System.Drawing.Size(384, 350)
        Me.Controls.Add(Me.cmdCancel)
        Me.Controls.Add(Me.cmdOk)
        Me.Controls.Add(Me.Label7)
        Me.Controls.Add(Me.txtClientRemark)
        Me.Controls.Add(Me.txtClientEmail)
        Me.Controls.Add(Me.txtClientTEL)
        Me.Controls.Add(Me.txtClientAdd)
        Me.Controls.Add(Me.txtClientCom)
        Me.Controls.Add(Me.txtClientName)
        Me.Controls.Add(Me.Label5)
        Me.Controls.Add(Me.Label4)
        Me.Controls.Add(Me.Label3)
        Me.Controls.Add(Me.Label2)
        Me.Controls.Add(Me.Label1)
        Me.MaximizeBox = False
        Me.MinimizeBox = False
        Me.Name = "ClientAddMod"
        Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent
        Me.Text = "用户信息"
        Me.ResumeLayout(False)

    End Sub

#End Region

    Private Sub ClientAddMod_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        If ClickAdd = True Then
            If buy = True Then
                Me.Text = "添加供应商信息"
                storename = "insert_bssTable_Clients_1"
            Else
                Me.Text = "添加购货商信息"
                storename = "insert_bssTable_Customer_1"
            End If
        Else
            txtClientName.Text = Trim(Temp(1))
            txtClientAdd.Text = Trim(Temp(2))
            txtClientCom.Text = Trim(Temp(3))
            txtClientEmail.Text = Trim(Temp(4))
            txtClientTEL.Text = Trim(Temp(5))
            txtClientRemark.Text = Trim(Temp(6))
            If buy = True Then
                Me.Text = "修改供应商信息"
                storename = "update_bssTable_Clients_1"
            Else
                Me.Text = "修改购货商信息"
                storename = "update_bssTable_Customer_1"
            End If
        End If
    End Sub

    Private Sub cmdOk_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdOk.Click
        If ClickAdd = True Then
            If txtClientName.Text.Trim <> "" Then
                Dim Info(6) As String
                Info(0) = txtClientName.Text.Trim
                Info(1) = txtClientCom.Text.Trim
                Info(2) = txtClientAdd.Text.Trim
                Info(3) = txtClientTEL.Text.Trim
                Info(4) = txtClientEmail.Text.Trim
                Info(5) = txtClientRemark.Text.Trim
                Client.AddClients(Info)
                MessageBox.Show("添加成功!", "添加")
                Me.Close()
            Else
                MessageBox.Show("用户名不能为空", "错误")
                Exit Sub
            End If
        Else
            If txtClientName.Text.Trim <> "" Then
                Dim Info(7) As String
                Info(0) = Trim(Temp(0))
                Info(1) = txtClientName.Text.Trim
                Info(2) = txtClientAdd.Text.Trim
                Info(3) = txtClientCom.Text.Trim
                Info(4) = txtClientEmail.Text.Trim
                Info(5) = txtClientTEL.Text.Trim
                Info(6) = txtClientRemark.Text.Trim
                Client.ModClients(Info)
                MessageBox.Show("修改成功!", "添加")
                Me.Close()
            Else
                MessageBox.Show("用户名不能为空", "错误")
                Exit Sub
            End If

        End If
    End Sub

    Private Sub cmdCancel_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdCancel.Click
        Me.Close()
    End Sub
End Class

⌨️ 快捷键说明

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