frmPsPhTotal.vb
上传用户:wj57717022
上传日期:2014-12-16
资源大小:4093k
文件大小:8k
- Public Class frmPsPhTotal
- 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 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
- Friend WithEvents btnPrint As System.Windows.Forms.Button
- Friend WithEvents btnQuery As System.Windows.Forms.Button
- <System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
- Me.dgview = New System.Windows.Forms.DataGrid
- Me.GroupBox1 = New System.Windows.Forms.GroupBox
- Me.btnPrint = New System.Windows.Forms.Button
- Me.btnQuery = New System.Windows.Forms.Button
- 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.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, 80)
- Me.dgview.Name = "dgview"
- Me.dgview.Size = New System.Drawing.Size(568, 260)
- Me.dgview.TabIndex = 8
- '
- 'GroupBox1
- '
- Me.GroupBox1.Controls.Add(Me.btnPrint)
- Me.GroupBox1.Controls.Add(Me.btnQuery)
- 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(568, 80)
- Me.GroupBox1.TabIndex = 6
- Me.GroupBox1.TabStop = False
- '
- 'btnPrint
- '
- Me.btnPrint.FlatStyle = System.Windows.Forms.FlatStyle.Popup
- Me.btnPrint.Location = New System.Drawing.Point(360, 48)
- Me.btnPrint.Name = "btnPrint"
- Me.btnPrint.TabIndex = 13
- Me.btnPrint.Text = "打印"
- '
- 'btnQuery
- '
- Me.btnQuery.FlatStyle = System.Windows.Forms.FlatStyle.Popup
- Me.btnQuery.Location = New System.Drawing.Point(360, 24)
- Me.btnQuery.Name = "btnQuery"
- Me.btnQuery.TabIndex = 12
- Me.btnQuery.Text = "统计"
- '
- 'rboSum
- '
- Me.rboSum.Location = New System.Drawing.Point(150, 50)
- Me.rboSum.Name = "rboSum"
- Me.rboSum.Size = New System.Drawing.Size(72, 24)
- Me.rboSum.TabIndex = 11
- Me.rboSum.Text = "配送数量"
- '
- 'rboMoney
- '
- Me.rboMoney.Location = New System.Drawing.Point(78, 50)
- Me.rboMoney.Name = "rboMoney"
- Me.rboMoney.Size = New System.Drawing.Size(72, 24)
- Me.rboMoney.TabIndex = 10
- Me.rboMoney.Text = "配送金额"
- '
- 'ckn
- '
- Me.ckn.Location = New System.Drawing.Point(88, 16)
- Me.ckn.Name = "ckn"
- Me.ckn.Size = New System.Drawing.Size(184, 24)
- Me.ckn.TabIndex = 9
- Me.ckn.Text = "选中为正数,不选中为倒数!"
- '
- 'Label3
- '
- Me.Label3.AutoSize = True
- Me.Label3.Location = New System.Drawing.Point(8, 56)
- Me.Label3.Name = "Label3"
- Me.Label3.Size = New System.Drawing.Size(66, 17)
- Me.Label3.TabIndex = 5
- Me.Label3.Text = "排行标准:"
- '
- 'Label2
- '
- Me.Label2.AutoSize = True
- Me.Label2.Location = New System.Drawing.Point(64, 24)
- Me.Label2.Name = "Label2"
- Me.Label2.Size = New System.Drawing.Size(17, 17)
- Me.Label2.TabIndex = 2
- Me.Label2.Text = "位"
- '
- 'NumUd
- '
- Me.NumUd.Location = New System.Drawing.Point(24, 16)
- Me.NumUd.Name = "NumUd"
- Me.NumUd.Size = New System.Drawing.Size(40, 21)
- 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(8, 24)
- Me.Label1.Name = "Label1"
- Me.Label1.Size = New System.Drawing.Size(17, 17)
- Me.Label1.TabIndex = 0
- Me.Label1.Text = "前"
- '
- 'frmPsPhTotal
- '
- Me.AutoScaleBaseSize = New System.Drawing.Size(6, 14)
- Me.ClientSize = New System.Drawing.Size(568, 340)
- Me.Controls.Add(Me.dgview)
- Me.Controls.Add(Me.GroupBox1)
- Me.Name = "frmPsPhTotal"
- Me.Text = "frmPsPhTotal"
- Me.WindowState = System.Windows.Forms.FormWindowState.Maximized
- CType(Me.dgview, System.ComponentModel.ISupportInitialize).EndInit()
- 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 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
- 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
- 'strorder = " order by " & strquery & " desc"
- Else
- If rboMoney.Checked Then
- strquery = " order by 配送金额"
- End If
- If rboSum.Checked Then
- strquery = " order by 配送金额"
- End If
- 'strorder = " order by " & strquery
- End If
- strqueryes = "select top " & NumUd.Value & " MedNumber as 药品编号,MedName as 药品名称,MedRule as 药品规格,Unit as 单位,Package as 包装,sum(isnull(PfCount,0)) as 配送数量,sum(isnull(money,0)) as 配送金额,Product as 产地 from pspsdjmx 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