frmBhPhTotal.vb
上传用户:wj57717022
上传日期:2014-12-16
资源大小:4093k
文件大小:9k
- Public Class frmBhPhTotal
- 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 dgview As System.Windows.Forms.DataGrid
- 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 GroupBox1 As System.Windows.Forms.GroupBox
- Friend WithEvents rboSum As System.Windows.Forms.RadioButton
- Friend WithEvents rboMoney As System.Windows.Forms.RadioButton
- Friend WithEvents ckn As System.Windows.Forms.CheckBox
- Friend WithEvents Label3 As System.Windows.Forms.Label
- Friend WithEvents Label2 As System.Windows.Forms.Label
- Friend WithEvents NumUd As System.Windows.Forms.NumericUpDown
- Friend WithEvents Label1 As System.Windows.Forms.Label
- <System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
- Me.dgview = New System.Windows.Forms.DataGrid
- Me.GroupBox2 = New System.Windows.Forms.GroupBox
- Me.btnPrint = New System.Windows.Forms.Button
- Me.btnQuery = New System.Windows.Forms.Button
- Me.GroupBox1 = New System.Windows.Forms.GroupBox
- Me.rboSum = New System.Windows.Forms.RadioButton
- Me.rboMoney = New System.Windows.Forms.RadioButton
- Me.ckn = New System.Windows.Forms.CheckBox
- Me.Label3 = New System.Windows.Forms.Label
- Me.Label2 = New System.Windows.Forms.Label
- Me.NumUd = New System.Windows.Forms.NumericUpDown
- Me.Label1 = New System.Windows.Forms.Label
- CType(Me.dgview, System.ComponentModel.ISupportInitialize).BeginInit()
- Me.GroupBox2.SuspendLayout()
- Me.GroupBox1.SuspendLayout()
- CType(Me.NumUd, System.ComponentModel.ISupportInitialize).BeginInit()
- Me.SuspendLayout()
- '
- '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, 103)
- Me.dgview.Name = "dgview"
- Me.dgview.Size = New System.Drawing.Size(534, 343)
- Me.dgview.TabIndex = 11
- '
- 'GroupBox2
- '
- Me.GroupBox2.Controls.Add(Me.btnPrint)
- Me.GroupBox2.Controls.Add(Me.btnQuery)
- Me.GroupBox2.Dock = System.Windows.Forms.DockStyle.Right
- Me.GroupBox2.Location = New System.Drawing.Point(534, 103)
- Me.GroupBox2.Name = "GroupBox2"
- Me.GroupBox2.Size = New System.Drawing.Size(104, 343)
- Me.GroupBox2.TabIndex = 10
- Me.GroupBox2.TabStop = False
- '
- 'btnPrint
- '
- Me.btnPrint.Dock = System.Windows.Forms.DockStyle.Top
- Me.btnPrint.FlatStyle = System.Windows.Forms.FlatStyle.Popup
- Me.btnPrint.Location = New System.Drawing.Point(3, 50)
- Me.btnPrint.Name = "btnPrint"
- Me.btnPrint.Size = New System.Drawing.Size(98, 29)
- Me.btnPrint.TabIndex = 1
- Me.btnPrint.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 = "统计"
- '
- 'GroupBox1
- '
- Me.GroupBox1.Controls.Add(Me.rboSum)
- Me.GroupBox1.Controls.Add(Me.rboMoney)
- Me.GroupBox1.Controls.Add(Me.ckn)
- Me.GroupBox1.Controls.Add(Me.Label3)
- Me.GroupBox1.Controls.Add(Me.Label2)
- Me.GroupBox1.Controls.Add(Me.NumUd)
- 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(638, 103)
- Me.GroupBox1.TabIndex = 9
- Me.GroupBox1.TabStop = False
- '
- 'rboSum
- '
- Me.rboSum.Location = New System.Drawing.Point(200, 64)
- Me.rboSum.Name = "rboSum"
- Me.rboSum.Size = New System.Drawing.Size(96, 31)
- Me.rboSum.TabIndex = 11
- Me.rboSum.Text = "补货数量"
- '
- 'rboMoney
- '
- Me.rboMoney.Location = New System.Drawing.Point(104, 64)
- Me.rboMoney.Name = "rboMoney"
- Me.rboMoney.Size = New System.Drawing.Size(96, 31)
- Me.rboMoney.TabIndex = 10
- Me.rboMoney.Text = "补货金额"
- '
- 'ckn
- '
- Me.ckn.Location = New System.Drawing.Point(117, 21)
- Me.ckn.Name = "ckn"
- Me.ckn.Size = New System.Drawing.Size(246, 30)
- Me.ckn.TabIndex = 9
- Me.ckn.Text = "选中为正数,不选中为倒数!"
- '
- 'Label3
- '
- Me.Label3.AutoSize = True
- Me.Label3.Location = New System.Drawing.Point(11, 72)
- Me.Label3.Name = "Label3"
- Me.Label3.Size = New System.Drawing.Size(83, 21)
- Me.Label3.TabIndex = 5
- Me.Label3.Text = "排行标准:"
- '
- 'Label2
- '
- Me.Label2.AutoSize = True
- Me.Label2.Location = New System.Drawing.Point(85, 31)
- Me.Label2.Name = "Label2"
- Me.Label2.Size = New System.Drawing.Size(21, 21)
- Me.Label2.TabIndex = 2
- Me.Label2.Text = "位"
- '
- 'NumUd
- '
- Me.NumUd.Location = New System.Drawing.Point(32, 21)
- Me.NumUd.Name = "NumUd"
- Me.NumUd.Size = New System.Drawing.Size(53, 25)
- Me.NumUd.TabIndex = 1
- Me.NumUd.Value = New Decimal(New Integer() {10, 0, 0, 0})
- '
- 'Label1
- '
- Me.Label1.AutoSize = True
- Me.Label1.Location = New System.Drawing.Point(11, 31)
- Me.Label1.Name = "Label1"
- Me.Label1.Size = New System.Drawing.Size(21, 21)
- Me.Label1.TabIndex = 0
- Me.Label1.Text = "前"
- '
- 'frmBhPhTotal
- '
- Me.AutoScaleBaseSize = New System.Drawing.Size(8, 18)
- Me.ClientSize = New System.Drawing.Size(638, 446)
- Me.Controls.Add(Me.dgview)
- Me.Controls.Add(Me.GroupBox2)
- Me.Controls.Add(Me.GroupBox1)
- Me.Name = "frmBhPhTotal"
- Me.Text = "门店补货排行"
- Me.WindowState = System.Windows.Forms.FormWindowState.Maximized
- CType(Me.dgview, System.ComponentModel.ISupportInitialize).EndInit()
- Me.GroupBox2.ResumeLayout(False)
- Me.GroupBox1.ResumeLayout(False)
- CType(Me.NumUd, System.ComponentModel.ISupportInitialize).EndInit()
- Me.ResumeLayout(False)
- End Sub
- #End Region
- Public lsweb As New jxcmanage
- Private Sub frmBhPhTotal_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) Handles btnQuery.Click
- Dim strorder As String
- Dim strquery As String
- Dim strqueryes As String
- If ckn.Checked Then
- If rboMoney.Checked Then
- strquery = " order by 补货金额 desc"
- End If
- If rboSum.Checked Then
- strquery = " order by 补货数量 desc"
- End If
- Else
- If rboMoney.Checked Then
- strquery = " order by 补货金额"
- End If
- If rboSum.Checked Then
- strquery = " order by 补货金额"
- End If
- End If
- strqueryes = "select top " & NumUd.Value & " MedNumber as 药品编号,MedName as 药品名称,MedRule as 药品规格,Unit as 单位,Package as 包装,sum(isnull(LCount,0)) as 补货数量,sum(isnull(money,0)) as 补货金额,Product as 产地 from mdbhmx group by MedNumber,MedName,MedRule,Unit,Package,Product" & strquery
- If rboMoney.Checked = False And rboSum.Checked = False Then
- MessageBox.Show("请设置查询条件!", "提示!", MessageBoxButtons.OK)
- Else
- Dim dv As DataView
- Dim dtOrder As DataTable = lsweb.runSql(strqueryes).Tables(0)
- dv = dtOrder.DefaultView
- dgview.DataSource = dv
- End If
- End Sub
- End Class