frmMedBatchTotal.vb
上传用户:wj57717022
上传日期:2014-12-16
资源大小:4093k
文件大小:9k
源码类别:

医药行业

开发平台:

Visual Basic

  1. Public Class frmMedBatchTotal
  2.     Inherits System.Windows.Forms.Form
  3. #Region " Windows 窗体设计器生成的代码 "
  4.     Public Sub New()
  5.         MyBase.New()
  6.         '该调用是 Windows 窗体设计器所必需的。
  7.         InitializeComponent()
  8.         '在 InitializeComponent() 调用之后添加任何初始化
  9.     End Sub
  10.     '窗体重写 dispose 以清理组件列表。
  11.     Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
  12.         If disposing Then
  13.             If Not (components Is Nothing) Then
  14.                 components.Dispose()
  15.             End If
  16.         End If
  17.         MyBase.Dispose(disposing)
  18.     End Sub
  19.     'Windows 窗体设计器所必需的
  20.     Private components As System.ComponentModel.IContainer
  21.     '注意: 以下过程是 Windows 窗体设计器所必需的
  22.     '可以使用 Windows 窗体设计器修改此过程。
  23.     '不要使用代码编辑器修改它。
  24.     Friend WithEvents GroupBox1 As System.Windows.Forms.GroupBox
  25.     Friend WithEvents GroupBox2 As System.Windows.Forms.GroupBox
  26.     Friend WithEvents Label1 As System.Windows.Forms.Label
  27.     Friend WithEvents txtbegintime As System.Windows.Forms.DateTimePicker
  28.     Friend WithEvents Label2 As System.Windows.Forms.Label
  29.     Friend WithEvents txtendtime As System.Windows.Forms.DateTimePicker
  30.     Friend WithEvents Label3 As System.Windows.Forms.Label
  31.     Friend WithEvents txtmedname As System.Windows.Forms.TextBox
  32.     Friend WithEvents Label4 As System.Windows.Forms.Label
  33.     Friend WithEvents txtbatch As System.Windows.Forms.TextBox
  34.     Friend WithEvents btnQuery As System.Windows.Forms.Button
  35.     Friend WithEvents tbnPrint As System.Windows.Forms.Button
  36.     Friend WithEvents Panel1 As System.Windows.Forms.Panel
  37.     Friend WithEvents dgview As System.Windows.Forms.DataGrid
  38.     <System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
  39.         Me.GroupBox1 = New System.Windows.Forms.GroupBox
  40.         Me.txtbatch = New System.Windows.Forms.TextBox
  41.         Me.Label4 = New System.Windows.Forms.Label
  42.         Me.txtmedname = New System.Windows.Forms.TextBox
  43.         Me.Label3 = New System.Windows.Forms.Label
  44.         Me.txtendtime = New System.Windows.Forms.DateTimePicker
  45.         Me.Label2 = New System.Windows.Forms.Label
  46.         Me.txtbegintime = New System.Windows.Forms.DateTimePicker
  47.         Me.Label1 = New System.Windows.Forms.Label
  48.         Me.GroupBox2 = New System.Windows.Forms.GroupBox
  49.         Me.tbnPrint = New System.Windows.Forms.Button
  50.         Me.btnQuery = New System.Windows.Forms.Button
  51.         Me.Panel1 = New System.Windows.Forms.Panel
  52.         Me.dgview = New System.Windows.Forms.DataGrid
  53.         Me.GroupBox1.SuspendLayout()
  54.         Me.GroupBox2.SuspendLayout()
  55.         Me.Panel1.SuspendLayout()
  56.         CType(Me.dgview, System.ComponentModel.ISupportInitialize).BeginInit()
  57.         Me.SuspendLayout()
  58.         '
  59.         'GroupBox1
  60.         '
  61.         Me.GroupBox1.Controls.Add(Me.txtbatch)
  62.         Me.GroupBox1.Controls.Add(Me.Label4)
  63.         Me.GroupBox1.Controls.Add(Me.txtmedname)
  64.         Me.GroupBox1.Controls.Add(Me.Label3)
  65.         Me.GroupBox1.Controls.Add(Me.txtendtime)
  66.         Me.GroupBox1.Controls.Add(Me.Label2)
  67.         Me.GroupBox1.Controls.Add(Me.txtbegintime)
  68.         Me.GroupBox1.Controls.Add(Me.Label1)
  69.         Me.GroupBox1.Dock = System.Windows.Forms.DockStyle.Top
  70.         Me.GroupBox1.Location = New System.Drawing.Point(0, 0)
  71.         Me.GroupBox1.Name = "GroupBox1"
  72.         Me.GroupBox1.Size = New System.Drawing.Size(949, 103)
  73.         Me.GroupBox1.TabIndex = 0
  74.         Me.GroupBox1.TabStop = False
  75.         '
  76.         'txtbatch
  77.         '
  78.         Me.txtbatch.Location = New System.Drawing.Point(363, 62)
  79.         Me.txtbatch.Name = "txtbatch"
  80.         Me.txtbatch.Size = New System.Drawing.Size(149, 25)
  81.         Me.txtbatch.TabIndex = 7
  82.         Me.txtbatch.Text = ""
  83.         '
  84.         'Label4
  85.         '
  86.         Me.Label4.AutoSize = True
  87.         Me.Label4.Location = New System.Drawing.Point(309, 72)
  88.         Me.Label4.Name = "Label4"
  89.         Me.Label4.Size = New System.Drawing.Size(52, 21)
  90.         Me.Label4.TabIndex = 6
  91.         Me.Label4.Text = "批号:"
  92.         '
  93.         'txtmedname
  94.         '
  95.         Me.txtmedname.Location = New System.Drawing.Point(107, 62)
  96.         Me.txtmedname.Name = "txtmedname"
  97.         Me.txtmedname.Size = New System.Drawing.Size(149, 25)
  98.         Me.txtmedname.TabIndex = 5
  99.         Me.txtmedname.Text = ""
  100.         '
  101.         'Label3
  102.         '
  103.         Me.Label3.AutoSize = True
  104.         Me.Label3.Location = New System.Drawing.Point(21, 72)
  105.         Me.Label3.Name = "Label3"
  106.         Me.Label3.Size = New System.Drawing.Size(83, 21)
  107.         Me.Label3.TabIndex = 4
  108.         Me.Label3.Text = "药品名称:"
  109.         '
  110.         'txtendtime
  111.         '
  112.         Me.txtendtime.Location = New System.Drawing.Point(363, 21)
  113.         Me.txtendtime.Name = "txtendtime"
  114.         Me.txtendtime.Size = New System.Drawing.Size(149, 25)
  115.         Me.txtendtime.TabIndex = 3
  116.         '
  117.         'Label2
  118.         '
  119.         Me.Label2.AutoSize = True
  120.         Me.Label2.Location = New System.Drawing.Point(277, 31)
  121.         Me.Label2.Name = "Label2"
  122.         Me.Label2.Size = New System.Drawing.Size(83, 21)
  123.         Me.Label2.TabIndex = 2
  124.         Me.Label2.Text = "结束日期:"
  125.         '
  126.         'txtbegintime
  127.         '
  128.         Me.txtbegintime.Location = New System.Drawing.Point(107, 21)
  129.         Me.txtbegintime.Name = "txtbegintime"
  130.         Me.txtbegintime.Size = New System.Drawing.Size(149, 25)
  131.         Me.txtbegintime.TabIndex = 1
  132.         '
  133.         'Label1
  134.         '
  135.         Me.Label1.AutoSize = True
  136.         Me.Label1.Location = New System.Drawing.Point(21, 31)
  137.         Me.Label1.Name = "Label1"
  138.         Me.Label1.Size = New System.Drawing.Size(83, 21)
  139.         Me.Label1.TabIndex = 0
  140.         Me.Label1.Text = "开始日期:"
  141.         '
  142.         'GroupBox2
  143.         '
  144.         Me.GroupBox2.Controls.Add(Me.tbnPrint)
  145.         Me.GroupBox2.Controls.Add(Me.btnQuery)
  146.         Me.GroupBox2.Dock = System.Windows.Forms.DockStyle.Right
  147.         Me.GroupBox2.Location = New System.Drawing.Point(845, 103)
  148.         Me.GroupBox2.Name = "GroupBox2"
  149.         Me.GroupBox2.Size = New System.Drawing.Size(104, 427)
  150.         Me.GroupBox2.TabIndex = 1
  151.         Me.GroupBox2.TabStop = False
  152.         '
  153.         'tbnPrint
  154.         '
  155.         Me.tbnPrint.Dock = System.Windows.Forms.DockStyle.Top
  156.         Me.tbnPrint.FlatStyle = System.Windows.Forms.FlatStyle.Popup
  157.         Me.tbnPrint.Location = New System.Drawing.Point(3, 50)
  158.         Me.tbnPrint.Name = "tbnPrint"
  159.         Me.tbnPrint.Size = New System.Drawing.Size(98, 29)
  160.         Me.tbnPrint.TabIndex = 1
  161.         Me.tbnPrint.Text = "打印"
  162.         '
  163.         'btnQuery
  164.         '
  165.         Me.btnQuery.Dock = System.Windows.Forms.DockStyle.Top
  166.         Me.btnQuery.FlatStyle = System.Windows.Forms.FlatStyle.Popup
  167.         Me.btnQuery.Location = New System.Drawing.Point(3, 21)
  168.         Me.btnQuery.Name = "btnQuery"
  169.         Me.btnQuery.Size = New System.Drawing.Size(98, 29)
  170.         Me.btnQuery.TabIndex = 0
  171.         Me.btnQuery.Text = "统计"
  172.         '
  173.         'Panel1
  174.         '
  175.         Me.Panel1.Controls.Add(Me.dgview)
  176.         Me.Panel1.Dock = System.Windows.Forms.DockStyle.Fill
  177.         Me.Panel1.Location = New System.Drawing.Point(0, 103)
  178.         Me.Panel1.Name = "Panel1"
  179.         Me.Panel1.Size = New System.Drawing.Size(845, 427)
  180.         Me.Panel1.TabIndex = 2
  181.         '
  182.         'dgview
  183.         '
  184.         Me.dgview.DataMember = ""
  185.         Me.dgview.Dock = System.Windows.Forms.DockStyle.Fill
  186.         Me.dgview.HeaderForeColor = System.Drawing.SystemColors.ControlText
  187.         Me.dgview.Location = New System.Drawing.Point(0, 0)
  188.         Me.dgview.Name = "dgview"
  189.         Me.dgview.Size = New System.Drawing.Size(845, 427)
  190.         Me.dgview.TabIndex = 3
  191.         '
  192.         'frmMedBatchTotal
  193.         '
  194.         Me.AutoScaleBaseSize = New System.Drawing.Size(8, 18)
  195.         Me.ClientSize = New System.Drawing.Size(949, 530)
  196.         Me.Controls.Add(Me.Panel1)
  197.         Me.Controls.Add(Me.GroupBox2)
  198.         Me.Controls.Add(Me.GroupBox1)
  199.         Me.Name = "frmMedBatchTotal"
  200.         Me.Text = "药品批次进销存统计"
  201.         Me.GroupBox1.ResumeLayout(False)
  202.         Me.GroupBox2.ResumeLayout(False)
  203.         Me.Panel1.ResumeLayout(False)
  204.         CType(Me.dgview, System.ComponentModel.ISupportInitialize).EndInit()
  205.         Me.ResumeLayout(False)
  206.     End Sub
  207. #End Region
  208.     Public lsweb As New jxcmanage
  209.     Private Sub btnQuery_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnQuery.Click
  210.         If txtendtime.Value < txtbegintime.Value Then
  211.             MessageBox.Show("结束日期不能小于开始日期!", "提示", MessageBoxButtons.OK)
  212.         End If
  213.         If txtmedname.Text = String.Empty Or txtbatch.Text = String.Empty Then
  214.             MessageBox.Show("查询值不能为空,请输入查询值!", "提示", MessageBoxButtons.OK)
  215.         Else
  216.             Dim dv As DataView
  217.             Dim dtOrder As DataTable = lsweb.runSql("exec sp_medbegintoendtime '" & txtbegintime.Value & "','" & txtendtime.Value & "','" & txtmedname.Text.Trim & "','" & txtbatch.Text.Trim & "'").Tables(0)
  218.             dv = dtOrder.DefaultView
  219.             dgview.DataSource = dv
  220.            
  221.         End If
  222.     End Sub
  223.     Private Sub frmMedBatchTotal_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
  224.         txtbegintime.Value = Today.ToString
  225.         txtendtime.Value = Today.ToString
  226.     End Sub
  227. End Class