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

医药行业

开发平台:

Visual Basic

  1. Public Class frmRkQuery
  2.     Inherits System.Windows.Forms.Form
  3.     Public lsweb As New jxcmanage
  4.     Public dslocals As New DataSet
  5. #Region " Windows 窗体设计器生成的代码 "
  6.     Public Sub New()
  7.         MyBase.New()
  8.         '该调用是 Windows 窗体设计器所必需的。
  9.         InitializeComponent()
  10.         '在 InitializeComponent() 调用之后添加任何初始化
  11.     End Sub
  12.     '窗体重写 dispose 以清理组件列表。
  13.     Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
  14.         If disposing Then
  15.             If Not (components Is Nothing) Then
  16.                 components.Dispose()
  17.             End If
  18.         End If
  19.         MyBase.Dispose(disposing)
  20.     End Sub
  21.     'Windows 窗体设计器所必需的
  22.     Private components As System.ComponentModel.IContainer
  23.     '注意: 以下过程是 Windows 窗体设计器所必需的
  24.     '可以使用 Windows 窗体设计器修改此过程。
  25.     '不要使用代码编辑器修改它。
  26.     Friend WithEvents GroupBox1 As System.Windows.Forms.GroupBox
  27.     Friend WithEvents dtStart As System.Windows.Forms.DateTimePicker
  28.     Friend WithEvents dtEnd As System.Windows.Forms.DateTimePicker
  29.     Friend WithEvents Label1 As System.Windows.Forms.Label
  30.     Friend WithEvents Label2 As System.Windows.Forms.Label
  31.     Friend WithEvents btnQueryTime As System.Windows.Forms.Button
  32.     Friend WithEvents GroupBox2 As System.Windows.Forms.GroupBox
  33.     Friend WithEvents txtQueryPym As System.Windows.Forms.TextBox
  34.     Friend WithEvents btnQueryPym As System.Windows.Forms.Button
  35.     Friend WithEvents GroupBox3 As System.Windows.Forms.GroupBox
  36.     Friend WithEvents txtCustom As System.Windows.Forms.TextBox
  37.     Friend WithEvents btnQueryCustom As System.Windows.Forms.Button
  38.     Friend WithEvents yy As System.Windows.Forms.GroupBox
  39.     Friend WithEvents btnQueryProduct As System.Windows.Forms.Button
  40.     Friend WithEvents txtProduct As System.Windows.Forms.TextBox
  41.     Friend WithEvents GroupBox4 As System.Windows.Forms.GroupBox
  42.     Friend WithEvents btnPrint As System.Windows.Forms.Button
  43.     Friend WithEvents btnExit As System.Windows.Forms.Button
  44.     Friend WithEvents StatusBar1 As System.Windows.Forms.StatusBar
  45.     Friend WithEvents dgRk As System.Windows.Forms.DataGrid
  46.     <System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
  47.         Me.GroupBox1 = New System.Windows.Forms.GroupBox
  48.         Me.btnQueryTime = New System.Windows.Forms.Button
  49.         Me.Label2 = New System.Windows.Forms.Label
  50.         Me.Label1 = New System.Windows.Forms.Label
  51.         Me.dtEnd = New System.Windows.Forms.DateTimePicker
  52.         Me.dtStart = New System.Windows.Forms.DateTimePicker
  53.         Me.GroupBox2 = New System.Windows.Forms.GroupBox
  54.         Me.btnQueryPym = New System.Windows.Forms.Button
  55.         Me.txtQueryPym = New System.Windows.Forms.TextBox
  56.         Me.GroupBox3 = New System.Windows.Forms.GroupBox
  57.         Me.btnQueryCustom = New System.Windows.Forms.Button
  58.         Me.txtCustom = New System.Windows.Forms.TextBox
  59.         Me.yy = New System.Windows.Forms.GroupBox
  60.         Me.btnQueryProduct = New System.Windows.Forms.Button
  61.         Me.txtProduct = New System.Windows.Forms.TextBox
  62.         Me.GroupBox4 = New System.Windows.Forms.GroupBox
  63.         Me.btnExit = New System.Windows.Forms.Button
  64.         Me.btnPrint = New System.Windows.Forms.Button
  65.         Me.dgRk = New System.Windows.Forms.DataGrid
  66.         Me.StatusBar1 = New System.Windows.Forms.StatusBar
  67.         Me.GroupBox1.SuspendLayout()
  68.         Me.GroupBox2.SuspendLayout()
  69.         Me.GroupBox3.SuspendLayout()
  70.         Me.yy.SuspendLayout()
  71.         Me.GroupBox4.SuspendLayout()
  72.         CType(Me.dgRk, System.ComponentModel.ISupportInitialize).BeginInit()
  73.         Me.SuspendLayout()
  74.         '
  75.         'GroupBox1
  76.         '
  77.         Me.GroupBox1.Controls.Add(Me.btnQueryTime)
  78.         Me.GroupBox1.Controls.Add(Me.Label2)
  79.         Me.GroupBox1.Controls.Add(Me.Label1)
  80.         Me.GroupBox1.Controls.Add(Me.dtEnd)
  81.         Me.GroupBox1.Controls.Add(Me.dtStart)
  82.         Me.GroupBox1.Location = New System.Drawing.Point(12, 12)
  83.         Me.GroupBox1.Name = "GroupBox1"
  84.         Me.GroupBox1.Size = New System.Drawing.Size(144, 100)
  85.         Me.GroupBox1.TabIndex = 0
  86.         Me.GroupBox1.TabStop = False
  87.         Me.GroupBox1.Text = "按时间区段"
  88.         '
  89.         'btnQueryTime
  90.         '
  91.         Me.btnQueryTime.FlatStyle = System.Windows.Forms.FlatStyle.Flat
  92.         Me.btnQueryTime.Location = New System.Drawing.Point(72, 68)
  93.         Me.btnQueryTime.Name = "btnQueryTime"
  94.         Me.btnQueryTime.Size = New System.Drawing.Size(60, 25)
  95.         Me.btnQueryTime.TabIndex = 4
  96.         Me.btnQueryTime.Text = "查询(&Q)"
  97.         Me.btnQueryTime.TextAlign = System.Drawing.ContentAlignment.BottomCenter
  98.         '
  99.         'Label2
  100.         '
  101.         Me.Label2.AutoSize = True
  102.         Me.Label2.Location = New System.Drawing.Point(12, 50)
  103.         Me.Label2.Name = "Label2"
  104.         Me.Label2.Size = New System.Drawing.Size(17, 17)
  105.         Me.Label2.TabIndex = 3
  106.         Me.Label2.Text = "到"
  107.         '
  108.         'Label1
  109.         '
  110.         Me.Label1.AutoSize = True
  111.         Me.Label1.Location = New System.Drawing.Point(12, 25)
  112.         Me.Label1.Name = "Label1"
  113.         Me.Label1.Size = New System.Drawing.Size(17, 17)
  114.         Me.Label1.TabIndex = 2
  115.         Me.Label1.Text = "从"
  116.         '
  117.         'dtEnd
  118.         '
  119.         Me.dtEnd.Location = New System.Drawing.Point(30, 44)
  120.         Me.dtEnd.Name = "dtEnd"
  121.         Me.dtEnd.Size = New System.Drawing.Size(102, 21)
  122.         Me.dtEnd.TabIndex = 1
  123.         '
  124.         'dtStart
  125.         '
  126.         Me.dtStart.Location = New System.Drawing.Point(30, 19)
  127.         Me.dtStart.Name = "dtStart"
  128.         Me.dtStart.Size = New System.Drawing.Size(102, 21)
  129.         Me.dtStart.TabIndex = 0
  130.         '
  131.         'GroupBox2
  132.         '
  133.         Me.GroupBox2.Controls.Add(Me.btnQueryPym)
  134.         Me.GroupBox2.Controls.Add(Me.txtQueryPym)
  135.         Me.GroupBox2.Location = New System.Drawing.Point(162, 12)
  136.         Me.GroupBox2.Name = "GroupBox2"
  137.         Me.GroupBox2.Size = New System.Drawing.Size(84, 100)
  138.         Me.GroupBox2.TabIndex = 1
  139.         Me.GroupBox2.TabStop = False
  140.         Me.GroupBox2.Text = "按拼音码"
  141.         '
  142.         'btnQueryPym
  143.         '
  144.         Me.btnQueryPym.FlatStyle = System.Windows.Forms.FlatStyle.Flat
  145.         Me.btnQueryPym.Location = New System.Drawing.Point(12, 68)
  146.         Me.btnQueryPym.Name = "btnQueryPym"
  147.         Me.btnQueryPym.Size = New System.Drawing.Size(60, 25)
  148.         Me.btnQueryPym.TabIndex = 5
  149.         Me.btnQueryPym.Text = "查询(&Q)"
  150.         Me.btnQueryPym.TextAlign = System.Drawing.ContentAlignment.BottomCenter
  151.         '
  152.         'txtQueryPym
  153.         '
  154.         Me.txtQueryPym.Location = New System.Drawing.Point(12, 44)
  155.         Me.txtQueryPym.Name = "txtQueryPym"
  156.         Me.txtQueryPym.Size = New System.Drawing.Size(60, 21)
  157.         Me.txtQueryPym.TabIndex = 0
  158.         Me.txtQueryPym.Text = ""
  159.         '
  160.         'GroupBox3
  161.         '
  162.         Me.GroupBox3.Controls.Add(Me.btnQueryCustom)
  163.         Me.GroupBox3.Controls.Add(Me.txtCustom)
  164.         Me.GroupBox3.Location = New System.Drawing.Point(252, 12)
  165.         Me.GroupBox3.Name = "GroupBox3"
  166.         Me.GroupBox3.Size = New System.Drawing.Size(84, 100)
  167.         Me.GroupBox3.TabIndex = 2
  168.         Me.GroupBox3.TabStop = False
  169.         Me.GroupBox3.Text = "按客户编号"
  170.         '
  171.         'btnQueryCustom
  172.         '
  173.         Me.btnQueryCustom.FlatStyle = System.Windows.Forms.FlatStyle.Flat
  174.         Me.btnQueryCustom.Location = New System.Drawing.Point(12, 68)
  175.         Me.btnQueryCustom.Name = "btnQueryCustom"
  176.         Me.btnQueryCustom.Size = New System.Drawing.Size(60, 25)
  177.         Me.btnQueryCustom.TabIndex = 6
  178.         Me.btnQueryCustom.Text = "查询(&Q)"
  179.         Me.btnQueryCustom.TextAlign = System.Drawing.ContentAlignment.BottomCenter
  180.         '
  181.         'txtCustom
  182.         '
  183.         Me.txtCustom.Location = New System.Drawing.Point(12, 44)
  184.         Me.txtCustom.Name = "txtCustom"
  185.         Me.txtCustom.Size = New System.Drawing.Size(60, 21)
  186.         Me.txtCustom.TabIndex = 0
  187.         Me.txtCustom.Text = ""
  188.         '
  189.         'yy
  190.         '
  191.         Me.yy.Controls.Add(Me.btnQueryProduct)
  192.         Me.yy.Controls.Add(Me.txtProduct)
  193.         Me.yy.Location = New System.Drawing.Point(342, 12)
  194.         Me.yy.Name = "yy"
  195.         Me.yy.Size = New System.Drawing.Size(84, 100)
  196.         Me.yy.TabIndex = 3
  197.         Me.yy.TabStop = False
  198.         Me.yy.Text = "按产地"
  199.         '
  200.         'btnQueryProduct
  201.         '
  202.         Me.btnQueryProduct.FlatStyle = System.Windows.Forms.FlatStyle.Flat
  203.         Me.btnQueryProduct.Location = New System.Drawing.Point(12, 68)
  204.         Me.btnQueryProduct.Name = "btnQueryProduct"
  205.         Me.btnQueryProduct.Size = New System.Drawing.Size(60, 25)
  206.         Me.btnQueryProduct.TabIndex = 8
  207.         Me.btnQueryProduct.Text = "查询(&Q)"
  208.         Me.btnQueryProduct.TextAlign = System.Drawing.ContentAlignment.BottomCenter
  209.         '
  210.         'txtProduct
  211.         '
  212.         Me.txtProduct.Location = New System.Drawing.Point(12, 44)
  213.         Me.txtProduct.Name = "txtProduct"
  214.         Me.txtProduct.Size = New System.Drawing.Size(60, 21)
  215.         Me.txtProduct.TabIndex = 7
  216.         Me.txtProduct.Text = ""
  217.         '
  218.         'GroupBox4
  219.         '
  220.         Me.GroupBox4.Controls.Add(Me.btnExit)
  221.         Me.GroupBox4.Controls.Add(Me.btnPrint)
  222.         Me.GroupBox4.Location = New System.Drawing.Point(432, 12)
  223.         Me.GroupBox4.Name = "GroupBox4"
  224.         Me.GroupBox4.Size = New System.Drawing.Size(84, 100)
  225.         Me.GroupBox4.TabIndex = 4
  226.         Me.GroupBox4.TabStop = False
  227.         Me.GroupBox4.Text = "命令"
  228.         '
  229.         'btnExit
  230.         '
  231.         Me.btnExit.FlatStyle = System.Windows.Forms.FlatStyle.Flat
  232.         Me.btnExit.Location = New System.Drawing.Point(12, 68)
  233.         Me.btnExit.Name = "btnExit"
  234.         Me.btnExit.Size = New System.Drawing.Size(60, 25)
  235.         Me.btnExit.TabIndex = 10
  236.         Me.btnExit.Text = "退出(&E)"
  237.         Me.btnExit.TextAlign = System.Drawing.ContentAlignment.BottomCenter
  238.         '
  239.         'btnPrint
  240.         '
  241.         Me.btnPrint.FlatStyle = System.Windows.Forms.FlatStyle.Flat
  242.         Me.btnPrint.Location = New System.Drawing.Point(12, 37)
  243.         Me.btnPrint.Name = "btnPrint"
  244.         Me.btnPrint.Size = New System.Drawing.Size(60, 25)
  245.         Me.btnPrint.TabIndex = 9
  246.         Me.btnPrint.Text = "打印(&P)"
  247.         Me.btnPrint.TextAlign = System.Drawing.ContentAlignment.BottomCenter
  248.         '
  249.         'dgRk
  250.         '
  251.         Me.dgRk.DataMember = ""
  252.         Me.dgRk.HeaderForeColor = System.Drawing.SystemColors.ControlText
  253.         Me.dgRk.Location = New System.Drawing.Point(12, 124)
  254.         Me.dgRk.Name = "dgRk"
  255.         Me.dgRk.Size = New System.Drawing.Size(504, 212)
  256.         Me.dgRk.TabIndex = 5
  257.         '
  258.         'StatusBar1
  259.         '
  260.         Me.StatusBar1.Location = New System.Drawing.Point(0, 347)
  261.         Me.StatusBar1.Name = "StatusBar1"
  262.         Me.StatusBar1.Size = New System.Drawing.Size(526, 18)
  263.         Me.StatusBar1.TabIndex = 6
  264.         '
  265.         'frmRkQuery
  266.         '
  267.         Me.AutoScaleBaseSize = New System.Drawing.Size(6, 14)
  268.         Me.ClientSize = New System.Drawing.Size(526, 365)
  269.         Me.ControlBox = False
  270.         Me.Controls.Add(Me.StatusBar1)
  271.         Me.Controls.Add(Me.dgRk)
  272.         Me.Controls.Add(Me.GroupBox4)
  273.         Me.Controls.Add(Me.yy)
  274.         Me.Controls.Add(Me.GroupBox3)
  275.         Me.Controls.Add(Me.GroupBox2)
  276.         Me.Controls.Add(Me.GroupBox1)
  277.         Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.Fixed3D
  278.         Me.Name = "frmRkQuery"
  279.         Me.Text = "采购查询管理"
  280.         Me.GroupBox1.ResumeLayout(False)
  281.         Me.GroupBox2.ResumeLayout(False)
  282.         Me.GroupBox3.ResumeLayout(False)
  283.         Me.yy.ResumeLayout(False)
  284.         Me.GroupBox4.ResumeLayout(False)
  285.         CType(Me.dgRk, System.ComponentModel.ISupportInitialize).EndInit()
  286.         Me.ResumeLayout(False)
  287.     End Sub
  288. #End Region
  289.     Private Sub btnQueryPym_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnQueryPym.Click
  290.         If txtQueryPym.Text = "" Then
  291.             dslocals = lsweb.returndataset("select * from wz_rk", "wz_rk")
  292.             dgRk.DataSource = dslocals.Tables("wz_rk").DefaultView
  293.         Else
  294.             dslocals = lsweb.returndataset("select * from wz_rk where 药品编号='" & txtQueryPym.Text.Trim & "'", "wz_rk")
  295.             dgRk.DataSource = dslocals.Tables("wz_rk").DefaultView
  296.         End If
  297.     End Sub
  298.     Private Sub btnQueryTime_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnQueryTime.Click
  299.         dslocals = lsweb.returndataset("select * from wz_rk where 日期 BETWEEN '" & dtStart.Text & "' and '" & dtEnd.Text & "'", "wz_rk")
  300.         dgRk.DataSource = dslocals.Tables("wz_rk").DefaultView
  301.     End Sub
  302.     Private Sub btnQueryCustom_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnQueryCustom.Click
  303.         If txtCustom.Text = "" Then
  304.             dslocals = lsweb.returndataset("select * from wz_rk", "wz_rk")
  305.             dgRk.DataSource = dslocals.Tables("wz_rk").DefaultView
  306.         Else
  307.             dslocals = lsweb.returndataset("select * from wz_rk where 客户编号='" & txtCustom.Text.Trim & "'", "wz_rk")
  308.             dgRk.DataSource = dslocals.Tables("wz_rk").DefaultView
  309.         End If
  310.     End Sub
  311.     Private Sub btnQueryProduct_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnQueryProduct.Click
  312.         If txtProduct.Text = "" Then
  313.             dslocals = lsweb.returndataset("select * from wz_rk", "wz_rk")
  314.             dgRk.DataSource = dslocals.Tables("wz_rk").DefaultView
  315.         Else
  316.             dslocals = lsweb.returndataset("select * from wz_rk where 产地 like '%" & txtProduct.Text.Trim & "%'", "wz_rk")
  317.             dgRk.DataSource = dslocals.Tables("wz_rk").DefaultView
  318.         End If
  319.     End Sub
  320.     
  321.     Private Sub frmRkQuery_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
  322.     End Sub
  323.     Private Sub btnExit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnExit.Click
  324.         Me.Close()
  325.     End Sub
  326.     Private Sub btnPrint_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnPrint.Click
  327.     End Sub
  328. End Class