frmMedBatchTotal.vb
上传用户:wj57717022
上传日期:2014-12-16
资源大小:4093k
文件大小:9k
- Public Class frmMedBatchTotal
- 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 GroupBox2 As System.Windows.Forms.GroupBox
- Friend WithEvents Label1 As System.Windows.Forms.Label
- Friend WithEvents txtbegintime As System.Windows.Forms.DateTimePicker
- Friend WithEvents Label2 As System.Windows.Forms.Label
- Friend WithEvents txtendtime As System.Windows.Forms.DateTimePicker
- Friend WithEvents Label3 As System.Windows.Forms.Label
- Friend WithEvents txtmedname As System.Windows.Forms.TextBox
- Friend WithEvents Label4 As System.Windows.Forms.Label
- Friend WithEvents txtbatch As System.Windows.Forms.TextBox
- Friend WithEvents btnQuery As System.Windows.Forms.Button
- Friend WithEvents tbnPrint As System.Windows.Forms.Button
- Friend WithEvents Panel1 As System.Windows.Forms.Panel
- Friend WithEvents dgview As System.Windows.Forms.DataGrid
- <System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
- Me.GroupBox1 = New System.Windows.Forms.GroupBox
- Me.txtbatch = New System.Windows.Forms.TextBox
- Me.Label4 = New System.Windows.Forms.Label
- Me.txtmedname = New System.Windows.Forms.TextBox
- Me.Label3 = New System.Windows.Forms.Label
- Me.txtendtime = New System.Windows.Forms.DateTimePicker
- Me.Label2 = New System.Windows.Forms.Label
- Me.txtbegintime = New System.Windows.Forms.DateTimePicker
- Me.Label1 = New System.Windows.Forms.Label
- Me.GroupBox2 = New System.Windows.Forms.GroupBox
- Me.tbnPrint = New System.Windows.Forms.Button
- Me.btnQuery = New System.Windows.Forms.Button
- Me.Panel1 = New System.Windows.Forms.Panel
- Me.dgview = New System.Windows.Forms.DataGrid
- Me.GroupBox1.SuspendLayout()
- Me.GroupBox2.SuspendLayout()
- Me.Panel1.SuspendLayout()
- CType(Me.dgview, System.ComponentModel.ISupportInitialize).BeginInit()
- Me.SuspendLayout()
- '
- 'GroupBox1
- '
- Me.GroupBox1.Controls.Add(Me.txtbatch)
- Me.GroupBox1.Controls.Add(Me.Label4)
- Me.GroupBox1.Controls.Add(Me.txtmedname)
- Me.GroupBox1.Controls.Add(Me.Label3)
- Me.GroupBox1.Controls.Add(Me.txtendtime)
- Me.GroupBox1.Controls.Add(Me.Label2)
- Me.GroupBox1.Controls.Add(Me.txtbegintime)
- Me.GroupBox1.Controls.Add(Me.Label1)
- Me.GroupBox1.Dock = System.Windows.Forms.DockStyle.Top
- Me.GroupBox1.Location = New System.Drawing.Point(0, 0)
- Me.GroupBox1.Name = "GroupBox1"
- Me.GroupBox1.Size = New System.Drawing.Size(949, 103)
- Me.GroupBox1.TabIndex = 0
- Me.GroupBox1.TabStop = False
- '
- 'txtbatch
- '
- Me.txtbatch.Location = New System.Drawing.Point(363, 62)
- Me.txtbatch.Name = "txtbatch"
- Me.txtbatch.Size = New System.Drawing.Size(149, 25)
- Me.txtbatch.TabIndex = 7
- Me.txtbatch.Text = ""
- '
- 'Label4
- '
- Me.Label4.AutoSize = True
- Me.Label4.Location = New System.Drawing.Point(309, 72)
- Me.Label4.Name = "Label4"
- Me.Label4.Size = New System.Drawing.Size(52, 21)
- Me.Label4.TabIndex = 6
- Me.Label4.Text = "批号:"
- '
- 'txtmedname
- '
- Me.txtmedname.Location = New System.Drawing.Point(107, 62)
- Me.txtmedname.Name = "txtmedname"
- Me.txtmedname.Size = New System.Drawing.Size(149, 25)
- Me.txtmedname.TabIndex = 5
- Me.txtmedname.Text = ""
- '
- 'Label3
- '
- Me.Label3.AutoSize = True
- Me.Label3.Location = New System.Drawing.Point(21, 72)
- Me.Label3.Name = "Label3"
- Me.Label3.Size = New System.Drawing.Size(83, 21)
- Me.Label3.TabIndex = 4
- Me.Label3.Text = "药品名称:"
- '
- 'txtendtime
- '
- Me.txtendtime.Location = New System.Drawing.Point(363, 21)
- Me.txtendtime.Name = "txtendtime"
- Me.txtendtime.Size = New System.Drawing.Size(149, 25)
- Me.txtendtime.TabIndex = 3
- '
- 'Label2
- '
- Me.Label2.AutoSize = True
- Me.Label2.Location = New System.Drawing.Point(277, 31)
- Me.Label2.Name = "Label2"
- Me.Label2.Size = New System.Drawing.Size(83, 21)
- Me.Label2.TabIndex = 2
- Me.Label2.Text = "结束日期:"
- '
- 'txtbegintime
- '
- Me.txtbegintime.Location = New System.Drawing.Point(107, 21)
- Me.txtbegintime.Name = "txtbegintime"
- Me.txtbegintime.Size = New System.Drawing.Size(149, 25)
- Me.txtbegintime.TabIndex = 1
- '
- 'Label1
- '
- Me.Label1.AutoSize = True
- Me.Label1.Location = New System.Drawing.Point(21, 31)
- Me.Label1.Name = "Label1"
- Me.Label1.Size = New System.Drawing.Size(83, 21)
- Me.Label1.TabIndex = 0
- Me.Label1.Text = "开始日期:"
- '
- 'GroupBox2
- '
- Me.GroupBox2.Controls.Add(Me.tbnPrint)
- Me.GroupBox2.Controls.Add(Me.btnQuery)
- Me.GroupBox2.Dock = System.Windows.Forms.DockStyle.Right
- Me.GroupBox2.Location = New System.Drawing.Point(845, 103)
- Me.GroupBox2.Name = "GroupBox2"
- Me.GroupBox2.Size = New System.Drawing.Size(104, 427)
- Me.GroupBox2.TabIndex = 1
- Me.GroupBox2.TabStop = False
- '
- 'tbnPrint
- '
- Me.tbnPrint.Dock = System.Windows.Forms.DockStyle.Top
- Me.tbnPrint.FlatStyle = System.Windows.Forms.FlatStyle.Popup
- Me.tbnPrint.Location = New System.Drawing.Point(3, 50)
- Me.tbnPrint.Name = "tbnPrint"
- Me.tbnPrint.Size = New System.Drawing.Size(98, 29)
- Me.tbnPrint.TabIndex = 1
- Me.tbnPrint.Text = "打印"
- '
- 'btnQuery
- '
- Me.btnQuery.Dock = System.Windows.Forms.DockStyle.Top
- Me.btnQuery.FlatStyle = System.Windows.Forms.FlatStyle.Popup
- Me.btnQuery.Location = New System.Drawing.Point(3, 21)
- Me.btnQuery.Name = "btnQuery"
- Me.btnQuery.Size = New System.Drawing.Size(98, 29)
- Me.btnQuery.TabIndex = 0
- Me.btnQuery.Text = "统计"
- '
- 'Panel1
- '
- Me.Panel1.Controls.Add(Me.dgview)
- Me.Panel1.Dock = System.Windows.Forms.DockStyle.Fill
- Me.Panel1.Location = New System.Drawing.Point(0, 103)
- Me.Panel1.Name = "Panel1"
- Me.Panel1.Size = New System.Drawing.Size(845, 427)
- Me.Panel1.TabIndex = 2
- '
- '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, 0)
- Me.dgview.Name = "dgview"
- Me.dgview.Size = New System.Drawing.Size(845, 427)
- Me.dgview.TabIndex = 3
- '
- 'frmMedBatchTotal
- '
- Me.AutoScaleBaseSize = New System.Drawing.Size(8, 18)
- Me.ClientSize = New System.Drawing.Size(949, 530)
- Me.Controls.Add(Me.Panel1)
- Me.Controls.Add(Me.GroupBox2)
- Me.Controls.Add(Me.GroupBox1)
- Me.Name = "frmMedBatchTotal"
- Me.Text = "药品批次进销存统计"
- Me.GroupBox1.ResumeLayout(False)
- Me.GroupBox2.ResumeLayout(False)
- Me.Panel1.ResumeLayout(False)
- CType(Me.dgview, System.ComponentModel.ISupportInitialize).EndInit()
- Me.ResumeLayout(False)
- End Sub
- #End Region
- Public lsweb As New jxcmanage
- Private Sub btnQuery_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnQuery.Click
- If txtendtime.Value < txtbegintime.Value Then
- MessageBox.Show("结束日期不能小于开始日期!", "提示", MessageBoxButtons.OK)
- End If
- If txtmedname.Text = String.Empty Or txtbatch.Text = String.Empty Then
- MessageBox.Show("查询值不能为空,请输入查询值!", "提示", MessageBoxButtons.OK)
- Else
- Dim dv As DataView
- Dim dtOrder As DataTable = lsweb.runSql("exec sp_medbegintoendtime '" & txtbegintime.Value & "','" & txtendtime.Value & "','" & txtmedname.Text.Trim & "','" & txtbatch.Text.Trim & "'").Tables(0)
- dv = dtOrder.DefaultView
- dgview.DataSource = dv
-
- End If
- End Sub
- Private Sub frmMedBatchTotal_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
- txtbegintime.Value = Today.ToString
- txtendtime.Value = Today.ToString
- End Sub
- End Class