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

📄 tradereport.vb

📁 本文件为进销存管理系统的代码 在VB的环境下运行 用比较简单的结构完成的
💻 VB
字号:
Public Class TradeReport
    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 Label3 As System.Windows.Forms.Label
    Friend WithEvents cmdAdd As System.Windows.Forms.Button
    Friend WithEvents CmdDel As System.Windows.Forms.Button
    Friend WithEvents CmdMod As System.Windows.Forms.Button
    Friend WithEvents DataGrid1 As System.Windows.Forms.DataGrid
    Friend WithEvents GroupBox1 As System.Windows.Forms.GroupBox
    Friend WithEvents cmdBack As System.Windows.Forms.Button
    <System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
        Me.cmdAdd = New System.Windows.Forms.Button
        Me.CmdDel = New System.Windows.Forms.Button
        Me.CmdMod = New System.Windows.Forms.Button
        Me.Label3 = New System.Windows.Forms.Label
        Me.DataGrid1 = New System.Windows.Forms.DataGrid
        Me.GroupBox1 = New System.Windows.Forms.GroupBox
        Me.cmdBack = New System.Windows.Forms.Button
        CType(Me.DataGrid1, System.ComponentModel.ISupportInitialize).BeginInit()
        Me.GroupBox1.SuspendLayout()
        Me.SuspendLayout()
        '
        'cmdAdd
        '
        Me.cmdAdd.Anchor = System.Windows.Forms.AnchorStyles.Bottom
        Me.cmdAdd.Location = New System.Drawing.Point(24, 16)
        Me.cmdAdd.Name = "cmdAdd"
        Me.cmdAdd.TabIndex = 1
        Me.cmdAdd.Text = "添加"
        '
        'CmdDel
        '
        Me.CmdDel.Anchor = System.Windows.Forms.AnchorStyles.Bottom
        Me.CmdDel.Location = New System.Drawing.Point(240, 16)
        Me.CmdDel.Name = "CmdDel"
        Me.CmdDel.TabIndex = 2
        Me.CmdDel.Text = "删除"
        '
        'CmdMod
        '
        Me.CmdMod.Anchor = System.Windows.Forms.AnchorStyles.Bottom
        Me.CmdMod.Location = New System.Drawing.Point(128, 16)
        Me.CmdMod.Name = "CmdMod"
        Me.CmdMod.TabIndex = 3
        Me.CmdMod.Text = "修改"
        '
        'Label3
        '
        Me.Label3.Anchor = System.Windows.Forms.AnchorStyles.Top
        Me.Label3.Font = New System.Drawing.Font("宋体", 21.75!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(134, Byte))
        Me.Label3.ForeColor = System.Drawing.Color.Red
        Me.Label3.Location = New System.Drawing.Point(120, 16)
        Me.Label3.Name = "Label3"
        Me.Label3.Size = New System.Drawing.Size(240, 37)
        Me.Label3.TabIndex = 9
        Me.Label3.Text = "货单信息设置"
        '
        'DataGrid1
        '
        Me.DataGrid1.Anchor = CType((((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Bottom) _
                    Or System.Windows.Forms.AnchorStyles.Left) _
                    Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
        Me.DataGrid1.DataMember = ""
        Me.DataGrid1.HeaderForeColor = System.Drawing.SystemColors.ControlText
        Me.DataGrid1.Location = New System.Drawing.Point(0, 72)
        Me.DataGrid1.Name = "DataGrid1"
        Me.DataGrid1.ReadOnly = True
        Me.DataGrid1.Size = New System.Drawing.Size(464, 144)
        Me.DataGrid1.TabIndex = 10
        '
        'GroupBox1
        '
        Me.GroupBox1.Anchor = CType(((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Left) _
                    Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
        Me.GroupBox1.Controls.Add(Me.cmdBack)
        Me.GroupBox1.Controls.Add(Me.cmdAdd)
        Me.GroupBox1.Controls.Add(Me.CmdDel)
        Me.GroupBox1.Controls.Add(Me.CmdMod)
        Me.GroupBox1.Location = New System.Drawing.Point(8, 239)
        Me.GroupBox1.Name = "GroupBox1"
        Me.GroupBox1.Size = New System.Drawing.Size(448, 48)
        Me.GroupBox1.TabIndex = 11
        Me.GroupBox1.TabStop = False
        Me.GroupBox1.Text = "操作"
        '
        'cmdBack
        '
        Me.cmdBack.Anchor = System.Windows.Forms.AnchorStyles.Bottom
        Me.cmdBack.Location = New System.Drawing.Point(344, 17)
        Me.cmdBack.Name = "cmdBack"
        Me.cmdBack.TabIndex = 4
        Me.cmdBack.Text = "退 货"
        '
        'TradeReport
        '
        Me.AutoScaleBaseSize = New System.Drawing.Size(6, 14)
        Me.ClientSize = New System.Drawing.Size(464, 301)
        Me.Controls.Add(Me.GroupBox1)
        Me.Controls.Add(Me.DataGrid1)
        Me.Controls.Add(Me.Label3)
        Me.Name = "TradeReport"
        Me.ShowInTaskbar = False
        Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent
        Me.Text = "货单信息设置"
        CType(Me.DataGrid1, System.ComponentModel.ISupportInitialize).EndInit()
        Me.GroupBox1.ResumeLayout(False)
        Me.ResumeLayout(False)

    End Sub

#End Region

    Private Sub showagain()
        If ClickBuy = True Then
            storename = "ShowBuyReport"
            Users.ShowInfo(DataGrid1)
            Me.Text = "采购单信息设置"
            Me.Label3.Text = "采购单信息设置"
        Else
            storename = "ShowSellReport"
            Users.ShowInfo(DataGrid1)
            Me.Text = "销售单信息设置"
            Me.Label3.Text = "销售单信息设置"
        End If
    End Sub

    '根据点的菜单选择相应的数据显示
    Private Sub TradeReport_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        showagain()
    End Sub

    '添加报单
    Private Sub cmdAdd_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdAdd.Click
        ClickAdd = True
        Dim fm1 As New TradeAddMod
        fm1.ShowDialog()
        showagain()
    End Sub

    '修改报单
    Private Sub CmdMod_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CmdMod.Click
        Dim x As Integer = DataGrid1.CurrentRowIndex
        Temp = dtTemp.Rows(x).ItemArray
        ClickAdd = False
        Dim fm1 As New TradeAddMod
        fm1.ShowDialog()
        showagain()
    End Sub

    '删除报单
    Private Sub CmdDel_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CmdDel.Click
        Dim x As Integer = DataGrid1.CurrentRowIndex
        Dim i As String = Trim(dtTemp.Rows(x).Item(0))
        If ClickBuy = True Then
            storename = "delete_bssTable_BuyOrders_1"
            Reports.DelReport(i)
            MessageBox.Show("删除成功!", "进货单")
            storename = "ShowBuyReport"
        Else
            storename = "delete_bssTable_SellOrders_1"
            Reports.DelReport(i)
            MessageBox.Show("删除成功!", "销售单")
            storename = "ShowSellReport"
        End If
        showagain()
    End Sub

    '报单退货
    Private Sub cmdBack_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdBack.Click
        Dim x As Integer = DataGrid1.CurrentRowIndex
        Dim i As String = Trim(dtTemp.Rows(x).Item(0))
        If ClickBuy = True Then
            storename = "update_bssTable_BuyOrders_2"
            Reports.BackReport(i)
            MessageBox.Show("操作成功!", "进货单")
            storename = "ShowBuyReport"
        Else
            storename = "update_bssTable_SellOrders_2"
            Reports.BackReport(i)
            MessageBox.Show("操作成功!", "销售单")
            storename = "ShowSellReport"
        End If
        showagain()
    End Sub
End Class

⌨️ 快捷键说明

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