frmKhTotal.vb
上传用户:wj57717022
上传日期:2014-12-16
资源大小:4093k
文件大小:17k
- Public Class frmKhTotal
- 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 GroupBox2 As System.Windows.Forms.GroupBox
- Friend WithEvents btnPrint As System.Windows.Forms.Button
- Friend WithEvents btnQuery As System.Windows.Forms.Button
- Friend WithEvents btnQueryAll As System.Windows.Forms.Button
- Friend WithEvents GroupBox1 As System.Windows.Forms.GroupBox
- Friend WithEvents Label3 As System.Windows.Forms.Label
- Friend WithEvents txtEndTime As System.Windows.Forms.DateTimePicker
- Friend WithEvents Label2 As System.Windows.Forms.Label
- Friend WithEvents txtBeginTime As System.Windows.Forms.DateTimePicker
- Friend WithEvents Label1 As System.Windows.Forms.Label
- Friend WithEvents txtkhName As System.Windows.Forms.TextBox
- Friend WithEvents GroupBox3 As System.Windows.Forms.GroupBox
- Friend WithEvents tabtable As System.Windows.Forms.TabControl
- Friend WithEvents tbrk As System.Windows.Forms.TabPage
- Friend WithEvents tbrkt As System.Windows.Forms.TabPage
- Friend WithEvents tbck As System.Windows.Forms.TabPage
- Friend WithEvents tbckt As System.Windows.Forms.TabPage
- Friend WithEvents tbys As System.Windows.Forms.TabPage
- Friend WithEvents tbyf As System.Windows.Forms.TabPage
- Friend WithEvents tbps As System.Windows.Forms.TabPage
- Friend WithEvents tbpst As System.Windows.Forms.TabPage
- Friend WithEvents Panel1 As System.Windows.Forms.Panel
- Friend WithEvents dgview As System.Windows.Forms.DataGrid
- <System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
- Me.GroupBox2 = New System.Windows.Forms.GroupBox
- Me.btnPrint = New System.Windows.Forms.Button
- Me.btnQuery = New System.Windows.Forms.Button
- Me.btnQueryAll = New System.Windows.Forms.Button
- Me.GroupBox1 = New System.Windows.Forms.GroupBox
- Me.txtkhName = 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.GroupBox3 = New System.Windows.Forms.GroupBox
- Me.tabtable = New System.Windows.Forms.TabControl
- Me.tbrk = New System.Windows.Forms.TabPage
- Me.tbrkt = New System.Windows.Forms.TabPage
- Me.tbck = New System.Windows.Forms.TabPage
- Me.tbckt = New System.Windows.Forms.TabPage
- Me.tbys = New System.Windows.Forms.TabPage
- Me.tbyf = New System.Windows.Forms.TabPage
- Me.tbps = New System.Windows.Forms.TabPage
- Me.tbpst = New System.Windows.Forms.TabPage
- Me.Panel1 = New System.Windows.Forms.Panel
- Me.dgview = New System.Windows.Forms.DataGrid
- Me.GroupBox2.SuspendLayout()
- Me.GroupBox1.SuspendLayout()
- Me.GroupBox3.SuspendLayout()
- Me.tabtable.SuspendLayout()
- Me.Panel1.SuspendLayout()
- CType(Me.dgview, System.ComponentModel.ISupportInitialize).BeginInit()
- Me.SuspendLayout()
- '
- 'GroupBox2
- '
- Me.GroupBox2.Controls.Add(Me.btnPrint)
- Me.GroupBox2.Controls.Add(Me.btnQuery)
- Me.GroupBox2.Controls.Add(Me.btnQueryAll)
- Me.GroupBox2.Dock = System.Windows.Forms.DockStyle.Right
- Me.GroupBox2.Location = New System.Drawing.Point(576, 80)
- Me.GroupBox2.Name = "GroupBox2"
- Me.GroupBox2.Size = New System.Drawing.Size(96, 372)
- Me.GroupBox2.TabIndex = 3
- Me.GroupBox2.TabStop = False
- '
- 'btnPrint
- '
- Me.btnPrint.FlatStyle = System.Windows.Forms.FlatStyle.Popup
- Me.btnPrint.Location = New System.Drawing.Point(8, 56)
- Me.btnPrint.Name = "btnPrint"
- Me.btnPrint.TabIndex = 2
- Me.btnPrint.Text = "打印"
- '
- 'btnQuery
- '
- Me.btnQuery.FlatStyle = System.Windows.Forms.FlatStyle.Popup
- Me.btnQuery.Location = New System.Drawing.Point(8, 32)
- Me.btnQuery.Name = "btnQuery"
- Me.btnQuery.TabIndex = 1
- Me.btnQuery.Tag = ""
- Me.btnQuery.Text = "条件查询"
- '
- 'btnQueryAll
- '
- Me.btnQueryAll.FlatStyle = System.Windows.Forms.FlatStyle.Popup
- Me.btnQueryAll.Location = New System.Drawing.Point(8, 8)
- Me.btnQueryAll.Name = "btnQueryAll"
- Me.btnQueryAll.TabIndex = 0
- Me.btnQueryAll.Tag = ""
- Me.btnQueryAll.Text = "全部查询"
- '
- 'GroupBox1
- '
- Me.GroupBox1.Controls.Add(Me.txtkhName)
- 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(672, 80)
- Me.GroupBox1.TabIndex = 2
- Me.GroupBox1.TabStop = False
- '
- 'txtkhName
- '
- Me.txtkhName.Location = New System.Drawing.Point(72, 48)
- Me.txtkhName.Name = "txtkhName"
- Me.txtkhName.Size = New System.Drawing.Size(312, 21)
- Me.txtkhName.TabIndex = 5
- Me.txtkhName.Text = ""
- '
- 'Label3
- '
- Me.Label3.AutoSize = True
- Me.Label3.Location = New System.Drawing.Point(16, 56)
- Me.Label3.Name = "Label3"
- Me.Label3.Size = New System.Drawing.Size(60, 17)
- Me.Label3.TabIndex = 4
- Me.Label3.Text = "客户名称:"
- '
- 'txtEndTime
- '
- Me.txtEndTime.Location = New System.Drawing.Point(272, 16)
- Me.txtEndTime.Name = "txtEndTime"
- Me.txtEndTime.Size = New System.Drawing.Size(112, 21)
- Me.txtEndTime.TabIndex = 3
- Me.txtEndTime.Value = New Date(2006, 2, 22, 0, 0, 0, 0)
- '
- 'Label2
- '
- Me.Label2.AutoSize = True
- Me.Label2.Location = New System.Drawing.Point(216, 24)
- Me.Label2.Name = "Label2"
- Me.Label2.Size = New System.Drawing.Size(60, 17)
- Me.Label2.TabIndex = 2
- Me.Label2.Text = "结束日期:"
- '
- 'txtBeginTime
- '
- Me.txtBeginTime.Location = New System.Drawing.Point(72, 16)
- Me.txtBeginTime.Name = "txtBeginTime"
- Me.txtBeginTime.Size = New System.Drawing.Size(112, 21)
- Me.txtBeginTime.TabIndex = 1
- Me.txtBeginTime.Value = New Date(2006, 2, 22, 0, 0, 0, 0)
- '
- 'Label1
- '
- Me.Label1.AutoSize = True
- Me.Label1.Location = New System.Drawing.Point(16, 24)
- Me.Label1.Name = "Label1"
- Me.Label1.Size = New System.Drawing.Size(60, 17)
- Me.Label1.TabIndex = 0
- Me.Label1.Text = "开始日期:"
- '
- 'GroupBox3
- '
- Me.GroupBox3.Controls.Add(Me.tabtable)
- Me.GroupBox3.Dock = System.Windows.Forms.DockStyle.Top
- Me.GroupBox3.Location = New System.Drawing.Point(0, 80)
- Me.GroupBox3.Name = "GroupBox3"
- Me.GroupBox3.Size = New System.Drawing.Size(576, 48)
- Me.GroupBox3.TabIndex = 5
- Me.GroupBox3.TabStop = False
- '
- 'tabtable
- '
- Me.tabtable.Appearance = System.Windows.Forms.TabAppearance.FlatButtons
- Me.tabtable.Controls.Add(Me.tbrk)
- Me.tabtable.Controls.Add(Me.tbrkt)
- Me.tabtable.Controls.Add(Me.tbck)
- Me.tabtable.Controls.Add(Me.tbckt)
- Me.tabtable.Controls.Add(Me.tbys)
- Me.tabtable.Controls.Add(Me.tbyf)
- Me.tabtable.Controls.Add(Me.tbps)
- Me.tabtable.Controls.Add(Me.tbpst)
- Me.tabtable.Dock = System.Windows.Forms.DockStyle.Fill
- Me.tabtable.Location = New System.Drawing.Point(3, 17)
- Me.tabtable.Name = "tabtable"
- Me.tabtable.SelectedIndex = 0
- Me.tabtable.Size = New System.Drawing.Size(570, 28)
- Me.tabtable.TabIndex = 6
- '
- 'tbrk
- '
- Me.tbrk.Location = New System.Drawing.Point(4, 24)
- Me.tbrk.Name = "tbrk"
- Me.tbrk.Size = New System.Drawing.Size(562, 0)
- Me.tbrk.TabIndex = 0
- Me.tbrk.Text = "采购入库"
- '
- 'tbrkt
- '
- Me.tbrkt.Location = New System.Drawing.Point(4, 24)
- Me.tbrkt.Name = "tbrkt"
- Me.tbrkt.Size = New System.Drawing.Size(648, 0)
- Me.tbrkt.TabIndex = 1
- Me.tbrkt.Text = "采购退货"
- Me.tbrkt.Visible = False
- '
- 'tbck
- '
- Me.tbck.Location = New System.Drawing.Point(4, 24)
- Me.tbck.Name = "tbck"
- Me.tbck.Size = New System.Drawing.Size(648, 0)
- Me.tbck.TabIndex = 2
- Me.tbck.Text = "销售出库"
- Me.tbck.Visible = False
- '
- 'tbckt
- '
- Me.tbckt.Location = New System.Drawing.Point(4, 24)
- Me.tbckt.Name = "tbckt"
- Me.tbckt.Size = New System.Drawing.Size(648, 0)
- Me.tbckt.TabIndex = 3
- Me.tbckt.Text = "销售退货"
- Me.tbckt.Visible = False
- '
- 'tbys
- '
- Me.tbys.Location = New System.Drawing.Point(4, 24)
- Me.tbys.Name = "tbys"
- Me.tbys.Size = New System.Drawing.Size(648, 0)
- Me.tbys.TabIndex = 4
- Me.tbys.Text = "应收账款"
- Me.tbys.Visible = False
- '
- 'tbyf
- '
- Me.tbyf.Location = New System.Drawing.Point(4, 24)
- Me.tbyf.Name = "tbyf"
- Me.tbyf.Size = New System.Drawing.Size(648, 0)
- Me.tbyf.TabIndex = 5
- Me.tbyf.Text = "应付账款"
- Me.tbyf.Visible = False
- '
- 'tbps
- '
- Me.tbps.Location = New System.Drawing.Point(4, 24)
- Me.tbps.Name = "tbps"
- Me.tbps.Size = New System.Drawing.Size(648, 0)
- Me.tbps.TabIndex = 6
- Me.tbps.Text = "配送单"
- Me.tbps.Visible = False
- '
- 'tbpst
- '
- Me.tbpst.Location = New System.Drawing.Point(4, 24)
- Me.tbpst.Name = "tbpst"
- Me.tbpst.Size = New System.Drawing.Size(648, 0)
- Me.tbpst.TabIndex = 7
- Me.tbpst.Text = "配送退货单"
- Me.tbpst.Visible = False
- '
- 'Panel1
- '
- Me.Panel1.Controls.Add(Me.dgview)
- Me.Panel1.Dock = System.Windows.Forms.DockStyle.Fill
- Me.Panel1.Location = New System.Drawing.Point(0, 128)
- Me.Panel1.Name = "Panel1"
- Me.Panel1.Size = New System.Drawing.Size(576, 324)
- Me.Panel1.TabIndex = 6
- '
- '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(576, 324)
- Me.dgview.TabIndex = 5
- '
- 'frmKhTotal
- '
- Me.AutoScaleBaseSize = New System.Drawing.Size(6, 14)
- Me.ClientSize = New System.Drawing.Size(672, 452)
- Me.Controls.Add(Me.Panel1)
- Me.Controls.Add(Me.GroupBox3)
- Me.Controls.Add(Me.GroupBox2)
- Me.Controls.Add(Me.GroupBox1)
- Me.Name = "frmKhTotal"
- Me.Text = "frmKhTotal"
- Me.WindowState = System.Windows.Forms.FormWindowState.Maximized
- Me.GroupBox2.ResumeLayout(False)
- Me.GroupBox1.ResumeLayout(False)
- Me.GroupBox3.ResumeLayout(False)
- Me.tabtable.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
- Public strquery As String
- Public strqueryes As String
- Private Sub frmKhTotal_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
- txtBeginTime.Value = Today.ToString
- txtEndTime.Value = Today.ToString
- End Sub
- Private Sub btnQuery_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnQuery.Click
- Dim dslocal As DataSet
- If txtkhName.Text = String.Empty Then
- MessageBox.Show("不许为空!请输入查询值。", "", MessageBoxButtons.OK)
- Else
- Select Case tabtable.SelectedTab.Text
- Case "采购入库"
- strquery = "select * from wz_rk where 日期 between '" & txtBeginTime.Value & "' and '" & txtEndTime.Value & "' and 客户名称='" & txtkhName.Text.Trim & "' and substring(票号,1,2)='RK'"
- Case "采购退货"
- strquery = "select * from wz_rk where 日期 between '" & txtBeginTime.Value & "' and '" & txtEndTime.Value & "' and 客户名称='" & txtkhName.Text.Trim & "' and substring(票号,1,2)='TL'"
- Case "销售出库"
- strquery = "select * from wz_ck where 日期 between '" & txtBeginTime.Value & "' and '" & txtEndTime.Value & "' and 客户名称='" & txtkhName.Text.Trim & "' and substring(票号,1,2)='CK'"
- Case "销售退货"
- strquery = "select * from wz_ck where 日期 between '" & txtBeginTime.Value & "' and '" & txtEndTime.Value & "' and 客户名称='" & txtkhName.Text.Trim & "' and substring(票号,1,2)='TK'"
- Case "应收账款"
- strquery = "select * from wz_ck_sk where 日期 between '" & txtBeginTime.Value & "' and '" & txtEndTime.Value & "' and 客户名称='" & txtkhName.Text.Trim & "'"
- Case "应付账款"
- strquery = "select * from wz_rk_fk where 日期 between '" & txtBeginTime.Value & "' and '" & txtEndTime.Value & "' and 客户名称='" & txtkhName.Text.Trim & "'"
- Case "配送单"
- strquery = "select a.BhDate as 日期,a.PsMedName as 门店名称,PsCenter as 配送中心,MedNumber as 药品编号,MedName as 药品名称,MedRule as 药品规格,Unit as 单位,Package as 包装,pfcount as 数量,Price as 单价,b.Money as 金额,Batch as 批号,Product as 产地,Avaid as 有效期 from pspsdj a,pspsdjMx b where a.BillNumber=b.BillNumber and a.BhDate between '" & txtBeginTime.Value & "' and '" & txtEndTime.Value & "' and a.PsMedName='" & txtkhName.Text.Trim & "'"
- Case "配送退货单"
- strquery = "select a.ThTime as 日期,a.PsMedName as 门店名称,PsCenter as 配送中心,MedNumber as 药品编号,MedName as 药品名称,MedRule as 药品规格,Unit as 单位,Package as 包装,lcount as 数量,Price as 单价,b.Money as 金额,Batch as 批号,Product as 产地,Avaid as 有效期 from psth a,psthMx b where a.BillNumber=b.BillNumber and a.ThTime between '" & txtBeginTime.Value & "' and '" & txtEndTime.Value & "' and a.PsMedName='" & txtkhName.Text.Trim & "'"
- End Select
- dslocal = lsweb.runSql(strquery)
- dgview.DataSource = dslocal.Tables(0).DefaultView
- End If
- End Sub
- Private Sub btnQueryAll_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnQueryAll.Click
- Dim dslocal As DataSet
- Select Case tabtable.SelectedTab.Text
- Case "采购入库"
- strqueryes = "select * from wz_rk where substring(票号,1,2)='RK'"
- Case "采购退货"
- strqueryes = "select * from wz_rk where substring(票号,1,2)='TL'"
- Case "销售出库"
- strqueryes = "select * from wz_ck where substring(票号,1,2)='CK'"
- Case "销售退货"
- strqueryes = "select * from wz_ck where substring(票号,1,2)='TK'"
- Case "应收账款"
- strqueryes = "select * from wz_ck_sk"
- Case "应付账款"
- strqueryes = "select * from wz_rk_fk"
- Case "配送单"
- strqueryes = "select a.BhDate as 日期,a.PsMedName as 门店名称,PsCenter as 配送中心,MedNumber as 药品编号,MedName as 药品名称,MedRule as 药品规格,Unit as 单位,Package as 包装,pfcount as 数量,Price as 单价,b.Money as 金额,Batch as 批号,Product as 产地,Avaid as 有效期 from pspsdj a,pspsdjMx b where a.BillNumber=b.BillNumber"
- Case "配送退货单"
- strqueryes = "select a.ThTime as 日期,a.PsMedName as 门店名称,PsCenter as 配送中心,MedNumber as 药品编号,MedName as 药品名称,MedRule as 药品规格,Unit as 单位,Package as 包装,lcount as 数量,Price as 单价,b.Money as 金额,Batch as 批号,Product as 产地,Avaid as 有效期 from psth a,psthMx b where a.BillNumber=b.BillNumber"
- End Select
- dslocal = lsweb.runSql(strqueryes)
- dgview.DataSource = dslocal.Tables(0).DefaultView
- End Sub
- End Class