📄 frmstadam.vb
字号:
Imports SCMAPP.Print
Public Class frmStaDam
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 Label3 As System.Windows.Forms.Label
Friend WithEvents Label2 As System.Windows.Forms.Label
Friend WithEvents Label1 As System.Windows.Forms.Label
Friend WithEvents btnFnd As System.Windows.Forms.Button
Friend WithEvents btnPrt As System.Windows.Forms.Button
Friend WithEvents btnExt As System.Windows.Forms.Button
Friend WithEvents grbCon As System.Windows.Forms.GroupBox
Friend WithEvents Label4 As System.Windows.Forms.Label
Friend WithEvents dtpDamDatEnd As System.Windows.Forms.DateTimePicker
Friend WithEvents dtpDamDatFrom As System.Windows.Forms.DateTimePicker
Friend WithEvents cmbPrdNam As System.Windows.Forms.ComboBox
Friend WithEvents dgdDamList As System.Windows.Forms.DataGrid
Friend WithEvents txtDamEmp As System.Windows.Forms.TextBox
Friend WithEvents chkDamDate As System.Windows.Forms.CheckBox
Friend WithEvents chkPrdDam As System.Windows.Forms.CheckBox
Friend WithEvents chkDamEmp As System.Windows.Forms.CheckBox
<System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
Me.grbCon = New System.Windows.Forms.GroupBox
Me.txtDamEmp = New System.Windows.Forms.TextBox
Me.dtpDamDatEnd = New System.Windows.Forms.DateTimePicker
Me.dtpDamDatFrom = New System.Windows.Forms.DateTimePicker
Me.Label4 = New System.Windows.Forms.Label
Me.cmbPrdNam = New System.Windows.Forms.ComboBox
Me.Label3 = New System.Windows.Forms.Label
Me.Label2 = New System.Windows.Forms.Label
Me.Label1 = New System.Windows.Forms.Label
Me.btnFnd = New System.Windows.Forms.Button
Me.dgdDamList = New System.Windows.Forms.DataGrid
Me.btnPrt = New System.Windows.Forms.Button
Me.btnExt = New System.Windows.Forms.Button
Me.chkDamDate = New System.Windows.Forms.CheckBox
Me.chkPrdDam = New System.Windows.Forms.CheckBox
Me.chkDamEmp = New System.Windows.Forms.CheckBox
Me.grbCon.SuspendLayout()
CType(Me.dgdDamList, System.ComponentModel.ISupportInitialize).BeginInit()
Me.SuspendLayout()
'
'grbCon
'
Me.grbCon.Controls.Add(Me.chkDamEmp)
Me.grbCon.Controls.Add(Me.chkPrdDam)
Me.grbCon.Controls.Add(Me.chkDamDate)
Me.grbCon.Controls.Add(Me.txtDamEmp)
Me.grbCon.Controls.Add(Me.dtpDamDatEnd)
Me.grbCon.Controls.Add(Me.dtpDamDatFrom)
Me.grbCon.Controls.Add(Me.Label4)
Me.grbCon.Controls.Add(Me.cmbPrdNam)
Me.grbCon.Controls.Add(Me.Label3)
Me.grbCon.Controls.Add(Me.Label2)
Me.grbCon.Controls.Add(Me.Label1)
Me.grbCon.Font = New System.Drawing.Font("宋体", 12.0!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(134, Byte))
Me.grbCon.ForeColor = System.Drawing.Color.Blue
Me.grbCon.Location = New System.Drawing.Point(20, 166)
Me.grbCon.Name = "grbCon"
Me.grbCon.Size = New System.Drawing.Size(745, 170)
Me.grbCon.TabIndex = 29
Me.grbCon.TabStop = False
Me.grbCon.Text = "统计范围(勾选后条件才生效)"
'
'txtDamEmp
'
Me.txtDamEmp.Location = New System.Drawing.Point(160, 128)
Me.txtDamEmp.Name = "txtDamEmp"
Me.txtDamEmp.Size = New System.Drawing.Size(152, 26)
Me.txtDamEmp.TabIndex = 15
Me.txtDamEmp.Text = ""
'
'dtpDamDatEnd
'
Me.dtpDamDatEnd.Location = New System.Drawing.Point(360, 32)
Me.dtpDamDatEnd.Name = "dtpDamDatEnd"
Me.dtpDamDatEnd.Size = New System.Drawing.Size(152, 26)
Me.dtpDamDatEnd.TabIndex = 14
'
'dtpDamDatFrom
'
Me.dtpDamDatFrom.Location = New System.Drawing.Point(160, 32)
Me.dtpDamDatFrom.Name = "dtpDamDatFrom"
Me.dtpDamDatFrom.Size = New System.Drawing.Size(152, 26)
Me.dtpDamDatFrom.TabIndex = 13
'
'Label4
'
Me.Label4.Font = New System.Drawing.Font("宋体", 12.0!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(134, Byte))
Me.Label4.ForeColor = System.Drawing.Color.Black
Me.Label4.Location = New System.Drawing.Point(320, 32)
Me.Label4.Name = "Label4"
Me.Label4.Size = New System.Drawing.Size(32, 24)
Me.Label4.TabIndex = 12
Me.Label4.Text = "至"
'
'cmbPrdNam
'
Me.cmbPrdNam.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList
Me.cmbPrdNam.Location = New System.Drawing.Point(160, 80)
Me.cmbPrdNam.Name = "cmbPrdNam"
Me.cmbPrdNam.Size = New System.Drawing.Size(154, 24)
Me.cmbPrdNam.TabIndex = 5
'
'Label3
'
Me.Label3.Font = New System.Drawing.Font("宋体", 12.0!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(134, Byte))
Me.Label3.ForeColor = System.Drawing.Color.Black
Me.Label3.Location = New System.Drawing.Point(56, 80)
Me.Label3.Name = "Label3"
Me.Label3.Size = New System.Drawing.Size(97, 24)
Me.Label3.TabIndex = 11
Me.Label3.Text = "报损商品:"
'
'Label2
'
Me.Label2.Font = New System.Drawing.Font("宋体", 12.0!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(134, Byte))
Me.Label2.ForeColor = System.Drawing.Color.Black
Me.Label2.Location = New System.Drawing.Point(56, 128)
Me.Label2.Name = "Label2"
Me.Label2.Size = New System.Drawing.Size(97, 24)
Me.Label2.TabIndex = 10
Me.Label2.Text = "经 手 人:"
'
'Label1
'
Me.Label1.Font = New System.Drawing.Font("宋体", 12.0!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(134, Byte))
Me.Label1.ForeColor = System.Drawing.Color.Black
Me.Label1.Location = New System.Drawing.Point(56, 32)
Me.Label1.Name = "Label1"
Me.Label1.Size = New System.Drawing.Size(97, 24)
Me.Label1.TabIndex = 2
Me.Label1.Text = "报损时间:"
'
'btnFnd
'
Me.btnFnd.Font = New System.Drawing.Font("宋体", 15.0!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(134, Byte))
Me.btnFnd.ForeColor = System.Drawing.Color.Teal
Me.btnFnd.Location = New System.Drawing.Point(120, 368)
Me.btnFnd.Name = "btnFnd"
Me.btnFnd.Size = New System.Drawing.Size(88, 40)
Me.btnFnd.TabIndex = 32
Me.btnFnd.Text = "统 计"
'
'dgdDamList
'
Me.dgdDamList.AlternatingBackColor = System.Drawing.Color.GhostWhite
Me.dgdDamList.BackColor = System.Drawing.Color.GhostWhite
Me.dgdDamList.BackgroundColor = System.Drawing.Color.Lavender
Me.dgdDamList.BorderStyle = System.Windows.Forms.BorderStyle.None
Me.dgdDamList.CaptionBackColor = System.Drawing.Color.RoyalBlue
Me.dgdDamList.CaptionForeColor = System.Drawing.Color.White
Me.dgdDamList.CaptionVisible = False
Me.dgdDamList.DataMember = ""
Me.dgdDamList.FlatMode = True
Me.dgdDamList.Font = New System.Drawing.Font("Tahoma", 8.0!)
Me.dgdDamList.ForeColor = System.Drawing.Color.MidnightBlue
Me.dgdDamList.GridLineColor = System.Drawing.Color.RoyalBlue
Me.dgdDamList.HeaderBackColor = System.Drawing.Color.MidnightBlue
Me.dgdDamList.HeaderFont = New System.Drawing.Font("Tahoma", 8.0!, System.Drawing.FontStyle.Bold)
Me.dgdDamList.HeaderForeColor = System.Drawing.Color.Lavender
Me.dgdDamList.LinkColor = System.Drawing.Color.Teal
Me.dgdDamList.Location = New System.Drawing.Point(44, -2)
Me.dgdDamList.Name = "dgdDamList"
Me.dgdDamList.ParentRowsBackColor = System.Drawing.Color.Lavender
Me.dgdDamList.ParentRowsForeColor = System.Drawing.Color.MidnightBlue
Me.dgdDamList.ReadOnly = True
Me.dgdDamList.SelectionBackColor = System.Drawing.Color.Teal
Me.dgdDamList.SelectionForeColor = System.Drawing.Color.PaleGreen
Me.dgdDamList.Size = New System.Drawing.Size(605, 157)
Me.dgdDamList.TabIndex = 30
'
'btnPrt
'
Me.btnPrt.Font = New System.Drawing.Font("宋体", 15.0!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(134, Byte))
Me.btnPrt.ForeColor = System.Drawing.Color.Teal
Me.btnPrt.Location = New System.Drawing.Point(324, 368)
Me.btnPrt.Name = "btnPrt"
Me.btnPrt.Size = New System.Drawing.Size(88, 40)
Me.btnPrt.TabIndex = 33
Me.btnPrt.Text = "打 印"
'
'btnExt
'
Me.btnExt.Font = New System.Drawing.Font("宋体", 15.0!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(134, Byte))
Me.btnExt.ForeColor = System.Drawing.Color.Teal
Me.btnExt.Location = New System.Drawing.Point(528, 368)
Me.btnExt.Name = "btnExt"
Me.btnExt.Size = New System.Drawing.Size(88, 40)
Me.btnExt.TabIndex = 31
Me.btnExt.Text = "退 出"
'
'chkDamDate
'
Me.chkDamDate.Location = New System.Drawing.Point(24, 32)
Me.chkDamDate.Name = "chkDamDate"
Me.chkDamDate.Size = New System.Drawing.Size(16, 16)
Me.chkDamDate.TabIndex = 16
'
'chkPrdDam
'
Me.chkPrdDam.Location = New System.Drawing.Point(24, 80)
Me.chkPrdDam.Name = "chkPrdDam"
Me.chkPrdDam.Size = New System.Drawing.Size(16, 16)
Me.chkPrdDam.TabIndex = 17
'
'chkDamEmp
'
Me.chkDamEmp.Location = New System.Drawing.Point(24, 128)
Me.chkDamEmp.Name = "chkDamEmp"
Me.chkDamEmp.Size = New System.Drawing.Size(16, 16)
Me.chkDamEmp.TabIndex = 18
'
'frmStaDam
'
Me.AutoScaleBaseSize = New System.Drawing.Size(6, 14)
Me.ClientSize = New System.Drawing.Size(794, 647)
Me.Controls.Add(Me.grbCon)
Me.Controls.Add(Me.btnFnd)
Me.Controls.Add(Me.dgdDamList)
Me.Controls.Add(Me.btnPrt)
Me.Controls.Add(Me.btnExt)
Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None
Me.MaximizeBox = False
Me.MinimizeBox = False
Me.Name = "frmStaDam"
Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen
Me.Text = "统计报损信息"
Me.grbCon.ResumeLayout(False)
CType(Me.dgdDamList, System.ComponentModel.ISupportInitialize).EndInit()
Me.ResumeLayout(False)
End Sub
#End Region
Dim dbObj As New SCMDB.SCMDB
Dim stadamObj As New SCMAPP.StaDam
' Dim fndCmd As String
' Dim selectCmd As String = "Select Damlistid as 报损单编号,prdid as 商品编号,Damdat as 报损日期,Damemp as 经手人, Damqua as 报损数量,Dammemo as 报损说明 from DamList"
Private Sub frmStaSup_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
If Me.Width > 200 Then
dgdDamList.Left = 5
dgdDamList.Top = 0
dgdDamList.Width = Me.Width - 5
dgdDamList.Height = 3 * Me.Height / 4 - 90
dgdDamList.RowHeaderWidth = 5
dgdDamList.PreferredColumnWidth = (dgdDamList.Width - 10) / 6
grbCon.Left = 15
grbCon.Top = dgdDamList.Height + 15
grbCon.Width = Me.Width - 30
grbCon.Height = Me.Height / 4
btnFnd.Top = dgdDamList.Height + grbCon.Height + 25
btnPrt.Top = dgdDamList.Height + grbCon.Height + 25
btnExt.Top = dgdDamList.Height + grbCon.Height + 25
End If
dgdDamList.DataSource = stadamObj.Refresh
cmbPrdNam.DataSource = dbObj.CreateDataTableByKey("prdname", "productlist")
cmbPrdNam.DisplayMember = "prdname"
dtpDamDatFrom.Value = Today.AddDays(-30)
dtpDamDatEnd.Value = Today
End Sub
Private Sub btnFnd_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnFnd.Click
Dim datFrom, datTo As DateTime
Dim szProId As String
Dim szEmp As String
'日期
If chkDamDate.Checked = False Then
datFrom = Date.Today
datTo = datFrom '注意不要写成datto = date.today,会有小概率错误发生
datFrom.AddTicks(2000)
datTo.AddTicks(1000)
Else
datFrom = dtpDamDatFrom.Value
datTo = dtpDamDatEnd.Value
End If
'商品
If chkPrdDam.Checked = False Then
szProId = ""
Else
szProId = Trim(cmbPrdNam.Text)
End If
'经手人
If chkDamEmp.Checked = False Then
szEmp = ""
Else
szEmp = Trim(txtDamEmp.Text)
End If
'开始查询
dgdDamList.DataSource = stadamObj.Fnd(datFrom, datTo, szProId, szEmp)
End Sub
Private Sub btnPrt_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnPrt.Click
stadamObj.Print()
End Sub
Private Sub btnExt_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnExt.Click
Me.Close()
End Sub
End Class
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -