frmMonthTotal.vb
上传用户:wj57717022
上传日期:2014-12-16
资源大小:4093k
文件大小:6k
- Public Class frmMonthTotal
- 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 GroupBox1 As System.Windows.Forms.GroupBox
- Friend WithEvents Label1 As System.Windows.Forms.Label
- Friend WithEvents Label2 As System.Windows.Forms.Label
- Friend WithEvents txtDate As System.Windows.Forms.TextBox
- Friend WithEvents dgview As System.Windows.Forms.DataGrid
- Friend WithEvents Button2 As System.Windows.Forms.Button
- Friend WithEvents Button1 As System.Windows.Forms.Button
- <System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
- Me.GroupBox1 = New System.Windows.Forms.GroupBox
- Me.Button2 = New System.Windows.Forms.Button
- Me.Button1 = New System.Windows.Forms.Button
- Me.Label2 = New System.Windows.Forms.Label
- Me.txtDate = New System.Windows.Forms.TextBox
- Me.Label1 = New System.Windows.Forms.Label
- Me.dgview = New System.Windows.Forms.DataGrid
- Me.GroupBox1.SuspendLayout()
- CType(Me.dgview, System.ComponentModel.ISupportInitialize).BeginInit()
- Me.SuspendLayout()
- '
- 'GroupBox1
- '
- Me.GroupBox1.Controls.Add(Me.Button2)
- Me.GroupBox1.Controls.Add(Me.Button1)
- Me.GroupBox1.Controls.Add(Me.Label2)
- Me.GroupBox1.Controls.Add(Me.txtDate)
- Me.GroupBox1.Controls.Add(Me.Label1)
- Me.GroupBox1.Dock = System.Windows.Forms.DockStyle.Top
- Me.GroupBox1.ForeColor = System.Drawing.Color.ForestGreen
- Me.GroupBox1.Location = New System.Drawing.Point(0, 0)
- Me.GroupBox1.Name = "GroupBox1"
- Me.GroupBox1.Size = New System.Drawing.Size(768, 56)
- Me.GroupBox1.TabIndex = 0
- Me.GroupBox1.TabStop = False
- '
- 'Button2
- '
- Me.Button2.FlatStyle = System.Windows.Forms.FlatStyle.Popup
- Me.Button2.Location = New System.Drawing.Point(664, 24)
- Me.Button2.Name = "Button2"
- Me.Button2.TabIndex = 6
- Me.Button2.Text = "打印"
- '
- 'Button1
- '
- Me.Button1.FlatStyle = System.Windows.Forms.FlatStyle.Popup
- Me.Button1.Location = New System.Drawing.Point(592, 24)
- Me.Button1.Name = "Button1"
- Me.Button1.TabIndex = 5
- Me.Button1.Text = "查询"
- '
- 'Label2
- '
- Me.Label2.AutoSize = True
- Me.Label2.FlatStyle = System.Windows.Forms.FlatStyle.Popup
- Me.Label2.Location = New System.Drawing.Point(104, 32)
- Me.Label2.Name = "Label2"
- Me.Label2.Size = New System.Drawing.Size(307, 17)
- Me.Label2.TabIndex = 4
- Me.Label2.Text = "注意:请按""200101""的格式在查询框按年月输入查询值!"
- '
- 'txtDate
- '
- Me.txtDate.Location = New System.Drawing.Point(456, 24)
- Me.txtDate.Name = "txtDate"
- Me.txtDate.TabIndex = 3
- Me.txtDate.Text = ""
- '
- 'Label1
- '
- Me.Label1.AutoSize = True
- Me.Label1.ForeColor = System.Drawing.Color.Black
- Me.Label1.Location = New System.Drawing.Point(416, 32)
- Me.Label1.Name = "Label1"
- Me.Label1.Size = New System.Drawing.Size(42, 17)
- Me.Label1.TabIndex = 2
- Me.Label1.Text = "月份:"
- '
- 'dgview
- '
- Me.dgview.DataMember = ""
- Me.dgview.Dock = System.Windows.Forms.DockStyle.Fill
- Me.dgview.HeaderForeColor = System.Drawing.SystemColors.ControlText
- Me.dgview.Location = New System.Drawing.Point(0, 56)
- Me.dgview.Name = "dgview"
- Me.dgview.Size = New System.Drawing.Size(768, 388)
- Me.dgview.TabIndex = 1
- '
- 'frmMonthTotal
- '
- Me.AutoScaleBaseSize = New System.Drawing.Size(6, 14)
- Me.ClientSize = New System.Drawing.Size(768, 444)
- Me.Controls.Add(Me.dgview)
- Me.Controls.Add(Me.GroupBox1)
- Me.Name = "frmMonthTotal"
- Me.Text = "每月进销存查询统计"
- Me.WindowState = System.Windows.Forms.FormWindowState.Maximized
- Me.GroupBox1.ResumeLayout(False)
- CType(Me.dgview, System.ComponentModel.ISupportInitialize).EndInit()
- Me.ResumeLayout(False)
- End Sub
- #End Region
- Public lsweb As New jxcmanage
- Private Sub frmMonthTotal_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
- End Sub
- Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
-
- End Sub
- Private Sub Button1_Click_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
- If txtDate.Text = String.Empty Then
- MessageBox.Show("请输入查询值!", "提示", MessageBoxButtons.OK)
- Else
- Try
- Dim dv As DataView
- Dim dtOrder As DataTable = lsweb.runSql("exec sp_total '" & txtDate.Text.Trim & "'").Tables(0)
- dv = dtOrder.DefaultView
- dgview.DataSource = dv
- Catch ex As Exception
- Throw New ExecutionEngineException
- End Try
- End If
- End Sub
- End Class