frmMedNameTotals.vb
上传用户:wj57717022
上传日期:2014-12-16
资源大小:4093k
文件大小:6k
- Public Class frmMedNameTotals
- 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 txtMedname As System.Windows.Forms.TextBox
- Friend WithEvents dgview As System.Windows.Forms.DataGrid
- Friend WithEvents btnQuery As System.Windows.Forms.Button
- Friend WithEvents btnPrint As System.Windows.Forms.Button
- <System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
- Me.GroupBox1 = New System.Windows.Forms.GroupBox
- Me.btnQuery = New System.Windows.Forms.Button
- Me.btnPrint = New System.Windows.Forms.Button
- Me.txtMedname = New System.Windows.Forms.TextBox
- 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.btnQuery)
- Me.GroupBox1.Controls.Add(Me.btnPrint)
- Me.GroupBox1.Controls.Add(Me.txtMedname)
- 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.Location = New System.Drawing.Point(0, 0)
- Me.GroupBox1.Name = "GroupBox1"
- Me.GroupBox1.Size = New System.Drawing.Size(663, 48)
- Me.GroupBox1.TabIndex = 0
- Me.GroupBox1.TabStop = False
- Me.GroupBox1.Text = "注意:请按""200101""的格式在查询框按年月输入查询值!"
- '
- 'btnQuery
- '
- Me.btnQuery.FlatStyle = System.Windows.Forms.FlatStyle.Popup
- Me.btnQuery.Location = New System.Drawing.Point(488, 16)
- Me.btnQuery.Name = "btnQuery"
- Me.btnQuery.TabIndex = 5
- Me.btnQuery.Text = "查询"
- '
- 'btnPrint
- '
- Me.btnPrint.FlatStyle = System.Windows.Forms.FlatStyle.Popup
- Me.btnPrint.Location = New System.Drawing.Point(560, 16)
- Me.btnPrint.Name = "btnPrint"
- Me.btnPrint.TabIndex = 4
- Me.btnPrint.Text = "打印"
- '
- 'txtMedname
- '
- Me.txtMedname.Location = New System.Drawing.Point(360, 16)
- Me.txtMedname.Name = "txtMedname"
- Me.txtMedname.TabIndex = 3
- Me.txtMedname.Text = ""
- '
- 'Label2
- '
- Me.Label2.AutoSize = True
- Me.Label2.Location = New System.Drawing.Point(296, 24)
- Me.Label2.Name = "Label2"
- Me.Label2.Size = New System.Drawing.Size(66, 17)
- Me.Label2.TabIndex = 2
- Me.Label2.Text = "药品名称:"
- '
- 'txtDate
- '
- Me.txtDate.Location = New System.Drawing.Point(208, 16)
- Me.txtDate.Name = "txtDate"
- Me.txtDate.Size = New System.Drawing.Size(72, 21)
- Me.txtDate.TabIndex = 1
- Me.txtDate.Text = ""
- '
- 'Label1
- '
- Me.Label1.AutoSize = True
- Me.Label1.Location = New System.Drawing.Point(168, 24)
- Me.Label1.Name = "Label1"
- Me.Label1.Size = New System.Drawing.Size(42, 17)
- Me.Label1.TabIndex = 0
- 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, 48)
- Me.dgview.Name = "dgview"
- Me.dgview.Size = New System.Drawing.Size(663, 396)
- Me.dgview.TabIndex = 2
- '
- 'frmMedNameTotals
- '
- Me.AutoScaleBaseSize = New System.Drawing.Size(6, 14)
- Me.ClientSize = New System.Drawing.Size(663, 444)
- Me.Controls.Add(Me.dgview)
- Me.Controls.Add(Me.GroupBox1)
- Me.Name = "frmMedNameTotals"
- 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 frmMedNameTotals_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
- End Sub
- Private Sub btnQuery_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
-
- End Sub
- Private Sub btnQuery_Click_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnQuery.Click
- If txtDate.Text = String.Empty And txtMedname.Text = String.Empty Then
- MessageBox.Show("请输入查询值!", "提示", MessageBoxButtons.OK)
- Else
- Try
- Dim dv As DataView
- Dim dtOrder As DataTable = lsweb.runSql("exec sp_stotal '" & txtDate.Text.Trim & "', '" & txtMedname.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