frmkcby.vb
上传用户:wj57717022
上传日期:2014-12-16
资源大小:4093k
文件大小:31k
- Public Class frmkcby
- 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 GroupBox1 As System.Windows.Forms.GroupBox
- Friend WithEvents Label17 As System.Windows.Forms.Label
- Friend WithEvents Label16 As System.Windows.Forms.Label
- Friend WithEvents Label15 As System.Windows.Forms.Label
- Friend WithEvents Label14 As System.Windows.Forms.Label
- Friend WithEvents Label13 As System.Windows.Forms.Label
- Friend WithEvents Label12 As System.Windows.Forms.Label
- Friend WithEvents Label11 As System.Windows.Forms.Label
- Friend WithEvents Label10 As System.Windows.Forms.Label
- Friend WithEvents Label9 As System.Windows.Forms.Label
- Friend WithEvents Label8 As System.Windows.Forms.Label
- Friend WithEvents Label7 As System.Windows.Forms.Label
- Friend WithEvents Label6 As System.Windows.Forms.Label
- Friend WithEvents Label5 As System.Windows.Forms.Label
- Friend WithEvents Label4 As System.Windows.Forms.Label
- 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 txtczy As System.Windows.Forms.TextBox
- Friend WithEvents txtavaid As System.Windows.Forms.TextBox
- Friend WithEvents txtbatch As System.Windows.Forms.TextBox
- Friend WithEvents txtaddress As System.Windows.Forms.TextBox
- Friend WithEvents txtpackage As System.Windows.Forms.TextBox
- Friend WithEvents txtkcount As System.Windows.Forms.TextBox
- Friend WithEvents txtmoney As System.Windows.Forms.TextBox
- Friend WithEvents txtcount As System.Windows.Forms.TextBox
- Friend WithEvents txtjj As System.Windows.Forms.TextBox
- Friend WithEvents txtunit As System.Windows.Forms.TextBox
- Friend WithEvents txtmedname As System.Windows.Forms.TextBox
- Friend WithEvents txtmednumber As System.Windows.Forms.TextBox
- Friend WithEvents txthw As System.Windows.Forms.ComboBox
- Friend WithEvents txtbillnumber As System.Windows.Forms.TextBox
- Friend WithEvents txtdate As System.Windows.Forms.DateTimePicker
- Friend WithEvents txtno As System.Windows.Forms.TextBox
- Friend WithEvents tbnAdd As System.Windows.Forms.ToolBarButton
- Friend WithEvents tbnsave As System.Windows.Forms.ToolBarButton
- Friend WithEvents tbnprint As System.Windows.Forms.ToolBarButton
- Friend WithEvents tbnexit As System.Windows.Forms.ToolBarButton
- Friend WithEvents dgview As System.Windows.Forms.DataGrid
- Friend WithEvents txtmedrule As System.Windows.Forms.TextBox
- Friend WithEvents ErrorProvider1 As System.Windows.Forms.ErrorProvider
- Friend WithEvents tbrby As System.Windows.Forms.ToolBar
- Friend WithEvents ImageList2 As System.Windows.Forms.ImageList
- <System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
- Me.components = New System.ComponentModel.Container
- Dim resources As System.Resources.ResourceManager = New System.Resources.ResourceManager(GetType(frmkcby))
- Me.tbrby = New System.Windows.Forms.ToolBar
- Me.tbnAdd = New System.Windows.Forms.ToolBarButton
- Me.tbnsave = New System.Windows.Forms.ToolBarButton
- Me.tbnprint = New System.Windows.Forms.ToolBarButton
- Me.tbnexit = New System.Windows.Forms.ToolBarButton
- Me.ImageList2 = New System.Windows.Forms.ImageList(Me.components)
- Me.dgview = New System.Windows.Forms.DataGrid
- Me.GroupBox1 = New System.Windows.Forms.GroupBox
- Me.txtczy = New System.Windows.Forms.TextBox
- Me.Label17 = New System.Windows.Forms.Label
- Me.txtavaid = New System.Windows.Forms.TextBox
- Me.txtbatch = New System.Windows.Forms.TextBox
- Me.txtaddress = New System.Windows.Forms.TextBox
- Me.txtpackage = New System.Windows.Forms.TextBox
- Me.Label16 = New System.Windows.Forms.Label
- Me.Label15 = New System.Windows.Forms.Label
- Me.Label14 = New System.Windows.Forms.Label
- Me.Label13 = New System.Windows.Forms.Label
- Me.txtkcount = New System.Windows.Forms.TextBox
- Me.Label12 = New System.Windows.Forms.Label
- Me.txtmoney = New System.Windows.Forms.TextBox
- Me.Label11 = New System.Windows.Forms.Label
- Me.txtcount = New System.Windows.Forms.TextBox
- Me.Label10 = New System.Windows.Forms.Label
- Me.txtjj = New System.Windows.Forms.TextBox
- Me.Label9 = New System.Windows.Forms.Label
- Me.txtunit = New System.Windows.Forms.TextBox
- Me.Label8 = New System.Windows.Forms.Label
- Me.txtmedrule = New System.Windows.Forms.TextBox
- Me.txtmedname = New System.Windows.Forms.TextBox
- Me.txtmednumber = New System.Windows.Forms.TextBox
- Me.Label7 = New System.Windows.Forms.Label
- Me.Label6 = New System.Windows.Forms.Label
- Me.Label5 = New System.Windows.Forms.Label
- Me.txthw = New System.Windows.Forms.ComboBox
- Me.Label4 = New System.Windows.Forms.Label
- Me.txtbillnumber = New System.Windows.Forms.TextBox
- Me.Label3 = New System.Windows.Forms.Label
- Me.txtdate = New System.Windows.Forms.DateTimePicker
- Me.Label2 = New System.Windows.Forms.Label
- Me.txtno = New System.Windows.Forms.TextBox
- Me.Label1 = New System.Windows.Forms.Label
- Me.ErrorProvider1 = New System.Windows.Forms.ErrorProvider
- CType(Me.dgview, System.ComponentModel.ISupportInitialize).BeginInit()
- Me.GroupBox1.SuspendLayout()
- Me.SuspendLayout()
- '
- 'tbrby
- '
- Me.tbrby.Appearance = System.Windows.Forms.ToolBarAppearance.Flat
- Me.tbrby.Buttons.AddRange(New System.Windows.Forms.ToolBarButton() {Me.tbnAdd, Me.tbnsave, Me.tbnprint, Me.tbnexit})
- Me.tbrby.DropDownArrows = True
- Me.tbrby.ImageList = Me.ImageList2
- Me.tbrby.Location = New System.Drawing.Point(0, 0)
- Me.tbrby.Name = "tbrby"
- Me.tbrby.ShowToolTips = True
- Me.tbrby.Size = New System.Drawing.Size(645, 41)
- Me.tbrby.TabIndex = 0
- '
- 'tbnAdd
- '
- Me.tbnAdd.ImageIndex = 7
- Me.tbnAdd.Text = "添加"
- '
- 'tbnsave
- '
- Me.tbnsave.ImageIndex = 4
- Me.tbnsave.Text = "保存"
- '
- 'tbnprint
- '
- Me.tbnprint.ImageIndex = 12
- Me.tbnprint.Text = "打印"
- '
- 'tbnexit
- '
- Me.tbnexit.ImageIndex = 11
- Me.tbnexit.Text = "退出"
- '
- 'ImageList2
- '
- Me.ImageList2.ImageSize = New System.Drawing.Size(16, 16)
- Me.ImageList2.ImageStream = CType(resources.GetObject("ImageList2.ImageStream"), System.Windows.Forms.ImageListStreamer)
- Me.ImageList2.TransparentColor = System.Drawing.Color.Transparent
- '
- '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, 184)
- Me.dgview.Name = "dgview"
- Me.dgview.Size = New System.Drawing.Size(645, 279)
- Me.dgview.TabIndex = 4
- '
- 'GroupBox1
- '
- Me.GroupBox1.Controls.Add(Me.txtczy)
- Me.GroupBox1.Controls.Add(Me.Label17)
- Me.GroupBox1.Controls.Add(Me.txtavaid)
- Me.GroupBox1.Controls.Add(Me.txtbatch)
- Me.GroupBox1.Controls.Add(Me.txtaddress)
- Me.GroupBox1.Controls.Add(Me.txtpackage)
- Me.GroupBox1.Controls.Add(Me.Label16)
- Me.GroupBox1.Controls.Add(Me.Label15)
- Me.GroupBox1.Controls.Add(Me.Label14)
- Me.GroupBox1.Controls.Add(Me.Label13)
- Me.GroupBox1.Controls.Add(Me.txtkcount)
- Me.GroupBox1.Controls.Add(Me.Label12)
- Me.GroupBox1.Controls.Add(Me.txtmoney)
- Me.GroupBox1.Controls.Add(Me.Label11)
- Me.GroupBox1.Controls.Add(Me.txtcount)
- Me.GroupBox1.Controls.Add(Me.Label10)
- Me.GroupBox1.Controls.Add(Me.txtjj)
- Me.GroupBox1.Controls.Add(Me.Label9)
- Me.GroupBox1.Controls.Add(Me.txtunit)
- Me.GroupBox1.Controls.Add(Me.Label8)
- Me.GroupBox1.Controls.Add(Me.txtmedrule)
- Me.GroupBox1.Controls.Add(Me.txtmedname)
- Me.GroupBox1.Controls.Add(Me.txtmednumber)
- Me.GroupBox1.Controls.Add(Me.Label7)
- Me.GroupBox1.Controls.Add(Me.Label6)
- Me.GroupBox1.Controls.Add(Me.Label5)
- Me.GroupBox1.Controls.Add(Me.txthw)
- Me.GroupBox1.Controls.Add(Me.Label4)
- Me.GroupBox1.Controls.Add(Me.txtbillnumber)
- Me.GroupBox1.Controls.Add(Me.Label3)
- Me.GroupBox1.Controls.Add(Me.txtdate)
- Me.GroupBox1.Controls.Add(Me.Label2)
- Me.GroupBox1.Controls.Add(Me.txtno)
- Me.GroupBox1.Controls.Add(Me.Label1)
- Me.GroupBox1.Dock = System.Windows.Forms.DockStyle.Top
- Me.GroupBox1.Location = New System.Drawing.Point(0, 41)
- Me.GroupBox1.Name = "GroupBox1"
- Me.GroupBox1.Size = New System.Drawing.Size(645, 143)
- Me.GroupBox1.TabIndex = 3
- Me.GroupBox1.TabStop = False
- Me.GroupBox1.Text = "库存报溢登记"
- '
- 'txtczy
- '
- Me.txtczy.Location = New System.Drawing.Point(570, 112)
- Me.txtczy.Name = "txtczy"
- Me.txtczy.ReadOnly = True
- Me.txtczy.Size = New System.Drawing.Size(68, 21)
- Me.txtczy.TabIndex = 33
- Me.txtczy.Text = ""
- '
- 'Label17
- '
- Me.Label17.AutoSize = True
- Me.Label17.Location = New System.Drawing.Point(528, 118)
- Me.Label17.Name = "Label17"
- Me.Label17.Size = New System.Drawing.Size(54, 17)
- Me.Label17.TabIndex = 32
- Me.Label17.Text = "操作员:"
- '
- 'txtavaid
- '
- Me.txtavaid.Location = New System.Drawing.Point(462, 112)
- Me.txtavaid.Name = "txtavaid"
- Me.txtavaid.ReadOnly = True
- Me.txtavaid.Size = New System.Drawing.Size(60, 21)
- Me.txtavaid.TabIndex = 31
- Me.txtavaid.Text = ""
- '
- 'txtbatch
- '
- Me.txtbatch.Location = New System.Drawing.Point(294, 112)
- Me.txtbatch.Name = "txtbatch"
- Me.txtbatch.ReadOnly = True
- Me.txtbatch.Size = New System.Drawing.Size(102, 21)
- Me.txtbatch.TabIndex = 30
- Me.txtbatch.Text = ""
- '
- 'txtaddress
- '
- Me.txtaddress.Location = New System.Drawing.Point(156, 112)
- Me.txtaddress.Name = "txtaddress"
- Me.txtaddress.ReadOnly = True
- Me.txtaddress.Size = New System.Drawing.Size(78, 21)
- Me.txtaddress.TabIndex = 29
- Me.txtaddress.Text = ""
- '
- 'txtpackage
- '
- Me.txtpackage.Location = New System.Drawing.Point(60, 112)
- Me.txtpackage.Name = "txtpackage"
- Me.txtpackage.ReadOnly = True
- Me.txtpackage.Size = New System.Drawing.Size(42, 21)
- Me.txtpackage.TabIndex = 28
- Me.txtpackage.Text = ""
- '
- 'Label16
- '
- Me.Label16.AutoSize = True
- Me.Label16.Location = New System.Drawing.Point(420, 118)
- Me.Label16.Name = "Label16"
- Me.Label16.Size = New System.Drawing.Size(54, 17)
- Me.Label16.TabIndex = 27
- Me.Label16.Text = "有效期:"
- '
- 'Label15
- '
- Me.Label15.AutoSize = True
- Me.Label15.Location = New System.Drawing.Point(128, 118)
- Me.Label15.Name = "Label15"
- Me.Label15.Size = New System.Drawing.Size(42, 17)
- Me.Label15.TabIndex = 26
- Me.Label15.Text = "产地:"
- '
- 'Label14
- '
- Me.Label14.AutoSize = True
- Me.Label14.Location = New System.Drawing.Point(264, 118)
- Me.Label14.Name = "Label14"
- Me.Label14.Size = New System.Drawing.Size(42, 17)
- Me.Label14.TabIndex = 25
- Me.Label14.Text = "批号:"
- '
- 'Label13
- '
- Me.Label13.AutoSize = True
- Me.Label13.Location = New System.Drawing.Point(32, 118)
- Me.Label13.Name = "Label13"
- Me.Label13.Size = New System.Drawing.Size(42, 17)
- Me.Label13.TabIndex = 24
- Me.Label13.Text = "包装:"
- '
- 'txtkcount
- '
- Me.txtkcount.Location = New System.Drawing.Point(462, 81)
- Me.txtkcount.Name = "txtkcount"
- Me.txtkcount.ReadOnly = True
- Me.txtkcount.Size = New System.Drawing.Size(60, 21)
- Me.txtkcount.TabIndex = 23
- Me.txtkcount.Text = ""
- '
- 'Label12
- '
- Me.Label12.AutoSize = True
- Me.Label12.Location = New System.Drawing.Point(420, 87)
- Me.Label12.Name = "Label12"
- Me.Label12.Size = New System.Drawing.Size(54, 17)
- Me.Label12.TabIndex = 22
- Me.Label12.Text = "原数量:"
- '
- 'txtmoney
- '
- Me.txtmoney.Location = New System.Drawing.Point(570, 81)
- Me.txtmoney.Name = "txtmoney"
- Me.txtmoney.ReadOnly = True
- Me.txtmoney.Size = New System.Drawing.Size(68, 21)
- Me.txtmoney.TabIndex = 21
- Me.txtmoney.Text = ""
- '
- 'Label11
- '
- Me.Label11.AutoSize = True
- Me.Label11.Location = New System.Drawing.Point(540, 87)
- Me.Label11.Name = "Label11"
- Me.Label11.Size = New System.Drawing.Size(42, 17)
- Me.Label11.TabIndex = 20
- Me.Label11.Text = "金额:"
- '
- 'txtcount
- '
- Me.txtcount.Location = New System.Drawing.Point(294, 80)
- Me.txtcount.Name = "txtcount"
- Me.txtcount.Size = New System.Drawing.Size(102, 21)
- Me.txtcount.TabIndex = 19
- Me.txtcount.Text = ""
- '
- 'Label10
- '
- Me.Label10.AutoSize = True
- Me.Label10.Location = New System.Drawing.Point(240, 88)
- Me.Label10.Name = "Label10"
- Me.Label10.Size = New System.Drawing.Size(66, 17)
- Me.Label10.TabIndex = 18
- Me.Label10.Text = "报溢数量:"
- '
- 'txtjj
- '
- Me.txtjj.Location = New System.Drawing.Point(156, 80)
- Me.txtjj.Name = "txtjj"
- Me.txtjj.Size = New System.Drawing.Size(78, 21)
- Me.txtjj.TabIndex = 17
- Me.txtjj.Text = ""
- '
- 'Label9
- '
- Me.Label9.AutoSize = True
- Me.Label9.Location = New System.Drawing.Point(128, 88)
- Me.Label9.Name = "Label9"
- Me.Label9.Size = New System.Drawing.Size(42, 17)
- Me.Label9.TabIndex = 16
- Me.Label9.Text = "进价:"
- '
- 'txtunit
- '
- Me.txtunit.Location = New System.Drawing.Point(60, 81)
- Me.txtunit.Name = "txtunit"
- Me.txtunit.ReadOnly = True
- Me.txtunit.Size = New System.Drawing.Size(42, 21)
- Me.txtunit.TabIndex = 15
- Me.txtunit.Text = ""
- '
- 'Label8
- '
- Me.Label8.AutoSize = True
- Me.Label8.Location = New System.Drawing.Point(32, 87)
- Me.Label8.Name = "Label8"
- Me.Label8.Size = New System.Drawing.Size(42, 17)
- Me.Label8.TabIndex = 14
- Me.Label8.Text = "单位:"
- '
- 'txtmedrule
- '
- Me.txtmedrule.Location = New System.Drawing.Point(462, 50)
- Me.txtmedrule.Name = "txtmedrule"
- Me.txtmedrule.ReadOnly = True
- Me.txtmedrule.Size = New System.Drawing.Size(174, 21)
- Me.txtmedrule.TabIndex = 13
- Me.txtmedrule.Text = ""
- '
- 'txtmedname
- '
- Me.txtmedname.Location = New System.Drawing.Point(294, 50)
- Me.txtmedname.Name = "txtmedname"
- Me.txtmedname.ReadOnly = True
- Me.txtmedname.Size = New System.Drawing.Size(102, 21)
- Me.txtmedname.TabIndex = 12
- Me.txtmedname.Text = ""
- '
- 'txtmednumber
- '
- Me.txtmednumber.Location = New System.Drawing.Point(60, 48)
- Me.txtmednumber.Name = "txtmednumber"
- Me.txtmednumber.Size = New System.Drawing.Size(174, 21)
- Me.txtmednumber.TabIndex = 11
- Me.txtmednumber.Text = ""
- '
- 'Label7
- '
- Me.Label7.AutoSize = True
- Me.Label7.Location = New System.Drawing.Point(408, 56)
- Me.Label7.Name = "Label7"
- Me.Label7.Size = New System.Drawing.Size(66, 17)
- Me.Label7.TabIndex = 10
- Me.Label7.Text = "药品规格:"
- '
- 'Label6
- '
- Me.Label6.AutoSize = True
- Me.Label6.Location = New System.Drawing.Point(240, 56)
- Me.Label6.Name = "Label6"
- Me.Label6.Size = New System.Drawing.Size(66, 17)
- Me.Label6.TabIndex = 9
- Me.Label6.Text = "药品名称:"
- '
- 'Label5
- '
- Me.Label5.AutoSize = True
- Me.Label5.Location = New System.Drawing.Point(8, 56)
- Me.Label5.Name = "Label5"
- Me.Label5.Size = New System.Drawing.Size(66, 17)
- Me.Label5.TabIndex = 8
- Me.Label5.Text = "药品编号:"
- '
- 'txthw
- '
- Me.txthw.Location = New System.Drawing.Point(156, 16)
- Me.txthw.Name = "txthw"
- Me.txthw.Size = New System.Drawing.Size(78, 20)
- Me.txthw.TabIndex = 7
- '
- 'Label4
- '
- Me.Label4.AutoSize = True
- Me.Label4.Location = New System.Drawing.Point(128, 25)
- Me.Label4.Name = "Label4"
- Me.Label4.Size = New System.Drawing.Size(42, 17)
- Me.Label4.TabIndex = 6
- Me.Label4.Text = "货位:"
- '
- 'txtbillnumber
- '
- Me.txtbillnumber.Location = New System.Drawing.Point(462, 19)
- Me.txtbillnumber.Name = "txtbillnumber"
- Me.txtbillnumber.ReadOnly = True
- Me.txtbillnumber.Size = New System.Drawing.Size(174, 21)
- Me.txtbillnumber.TabIndex = 5
- Me.txtbillnumber.Text = ""
- '
- 'Label3
- '
- Me.Label3.AutoSize = True
- Me.Label3.Location = New System.Drawing.Point(432, 25)
- Me.Label3.Name = "Label3"
- Me.Label3.Size = New System.Drawing.Size(42, 17)
- Me.Label3.TabIndex = 4
- Me.Label3.Text = "票号:"
- '
- 'txtdate
- '
- Me.txtdate.Location = New System.Drawing.Point(294, 19)
- Me.txtdate.Name = "txtdate"
- Me.txtdate.Size = New System.Drawing.Size(102, 21)
- Me.txtdate.TabIndex = 3
- Me.txtdate.Value = New Date(2006, 4, 15, 0, 0, 0, 0)
- '
- 'Label2
- '
- Me.Label2.AutoSize = True
- Me.Label2.Location = New System.Drawing.Point(264, 25)
- Me.Label2.Name = "Label2"
- Me.Label2.Size = New System.Drawing.Size(42, 17)
- Me.Label2.TabIndex = 2
- Me.Label2.Text = "日期:"
- '
- 'txtno
- '
- Me.txtno.Location = New System.Drawing.Point(60, 16)
- Me.txtno.Name = "txtno"
- Me.txtno.ReadOnly = True
- Me.txtno.Size = New System.Drawing.Size(42, 21)
- Me.txtno.TabIndex = 1
- Me.txtno.Text = ""
- '
- 'Label1
- '
- Me.Label1.AutoSize = True
- Me.Label1.Location = New System.Drawing.Point(32, 25)
- Me.Label1.Name = "Label1"
- Me.Label1.Size = New System.Drawing.Size(42, 17)
- Me.Label1.TabIndex = 0
- Me.Label1.Text = "序号:"
- '
- 'ErrorProvider1
- '
- Me.ErrorProvider1.ContainerControl = Me
- '
- 'frmkcby
- '
- Me.AutoScaleBaseSize = New System.Drawing.Size(6, 14)
- Me.ClientSize = New System.Drawing.Size(645, 463)
- Me.Controls.Add(Me.dgview)
- Me.Controls.Add(Me.GroupBox1)
- Me.Controls.Add(Me.tbrby)
- Me.Name = "frmkcby"
- Me.Text = "库存报溢"
- Me.WindowState = System.Windows.Forms.FormWindowState.Maximized
- CType(Me.dgview, System.ComponentModel.ISupportInitialize).EndInit()
- Me.GroupBox1.ResumeLayout(False)
- Me.ResumeLayout(False)
- End Sub
- #End Region
- Public lsweb As New jxcmanage
- Public dslocals As DataSet = lsweb.returndataset("select 序号,药品编号,药品名称,药品规格,单位,进价,报溢数量,原数量,金额,批号,有效期,包装,产地,票号,货位,操作员,日期 from wz_kc_by", "wz_kc_by")
- Private Sub frmkcbs_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
- tbnsave.Enabled = False
- dslocals.Clear()
- dgview.DataSource = dslocals.Tables("wz_kc_by").DefaultView
- txtdate.Value() = Today().ToString()
- Dim hwdr As System.Data.SqlClient.SqlDataReader
- hwdr = lsweb.returnDataReader("select 货位 from wz_hw")
- Do While hwdr.Read()
- txthw.Items.Add(hwdr("货位"))
- Loop
- txtdate.Value = Today.ToString
- End Sub
- Public Sub add()
- dslocals.Clear()
- txtmednumber.Text() = ""
- txthw.Focus()
- txtdate.Value() = Today().ToString()
- txtNo.Text = 1
-
- txtbillnumber.Text = lsweb.selectbill("BY").ToString
- txtmednumber.Text = ""
- txtUnit.Text() = ""
- txtJJ.Text() = ""
- txtCount.Text() = ""
- End Sub
- Private Sub save()
- If lsweb.updatedataset("select 序号,药品编号,药品名称,药品规格,单位,进价,报溢数量,原数量,金额,批号,有效期,包装,产地,票号,货位,操作员,日期 from wz_kc_by", "wz_kc_by", dslocals, DataRowState.Added) = True Then
- MessageBox.Show("信息成功保存!", "提示", MessageBoxButtons.OK)
- Else
- MessageBox.Show("信息保存失败!", "提示", MessageBoxButtons.AbortRetryIgnore)
- End If
- End Sub
- Private Sub ToolBar1_ButtonClick(ByVal sender As System.Object, ByVal e As System.Windows.Forms.ToolBarButtonClickEventArgs) Handles tbrby.ButtonClick
- Select Case e.Button.Text
- Case "添加"
- add()
- tbnEnable("tbnAdd.Enabled = False", tbrby)
- Case "保存"
- save()
- tbnEnable("tbnSave.Enabled = False", tbrby)
- Case "退出"
- Me.Close()
- End Select
- End Sub
- Public Sub tbnEnable(ByVal strboolean As String, ByVal tbr As ToolBar)
- If strboolean = "tbnAdd.Enabled = True" Then
- tbnsave.Enabled = False
- tbnprint.Enabled = False
- tbnexit.Enabled = True
- ElseIf strboolean = "tbnAdd.Enabled = False" Then
- tbnAdd.Enabled = False
- tbnsave.Enabled = True
- tbnprint.Enabled = True
- tbnexit.Enabled = True
- ElseIf strboolean = "tbnSave.Enabled = True" Then
- tbnAdd.Enabled = False
- tbnprint.Enabled = True
- tbnexit.Enabled = True
- ElseIf strboolean = "tbnSave.Enabled = False" Then
- tbnsave.Enabled = False
- tbnAdd.Enabled = True
- tbnprint.Enabled = True
- tbnexit.Enabled = True
- End If
- End Sub
- Private Sub txtmednumber_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles txtmednumber.TextChanged
- End Sub
- Public Function getinfo(ByVal strqueryid As String) As String
- Dim strOrderId As String
- strOrderId = strqueryid
- Return strOrderId
- End Function
- Private Sub txtmednumber_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles txtmednumber.KeyDown
- If e.KeyCode = Keys.Enter Then
- Dim dlgs As frmMedKcQuery = New frmMedKcQuery
- dlgs.PYMs = Me.getinfo(txtmednumber.Text)
- If dlgs.PYMs = String.Empty Then
- ErrorProvider1.SetError(txtmednumber, "不能为空,请输入查询码!")
- Else
- dlgs.ShowDialog()
- ErrorProvider1.SetError(txtmednumber, "")
- End If
- Dim medIdvalue, medbatch, product, avaid, hw, package As String
- medIdvalue = dlgs.GetInfo("药品编号")
- medbatch = dlgs.GetInfo("批号")
- product = dlgs.GetInfo("产地")
- avaid = dlgs.GetInfo("有效期")
- hw = dlgs.GetInfo("货位")
- package = dlgs.GetInfo("包装")
- If medIdvalue Is Nothing Then
- ErrorProvider1.SetError(txtmednumber, "不能为空,请输入查询码!或没有查到记录,请重新开始!")
- Else
- Dim runSqlQuery As String
- runSqlQuery = "select * from wz_kc where 药品编号='" & medIdvalue & "'and 批号 ='" & medbatch & "' and wz_kc.产地='" & product & "' and wz_kc.有效期='" & avaid & "' and wz_kc.货位='" & hw & "' and wz_kc.包装='" & package & "'"
- Dim dv As DataView
- ' Dim mOrderId As New managers
- '调用mCustomId对象的SPcustomersID函数
- Dim dtOrder As DataTable = lsweb.runSql(runSqlQuery).Tables(0)
- 'bb为一随意表名
- dtOrder.TableName = "bb"
- dv = dtOrder.DefaultView
- txtmednumber.Text = dv(0)("药品编号")
- txtmedname.Text = dv(0)("药品名称")
- txtmedrule.Text = dv(0)("药品规格")
- txtunit.Text = dv(0)("单位")
- txtjj.Text = dv(0)("进价")
- txtkcount.Text = dv(0)("数量")
- txtaddress.Text = dv(0)("产地")
- txtbatch.Text = dv(0)("批号")
- txthw.Text = dv(0)("货位")
- txtpackage.Text = dv(0)("包装")
- txtavaid.Text = dv(0)("有效期")
- ErrorProvider1.SetError(txtmednumber, "")
- txtjj.Focus()
- End If
- End If
- End Sub
- Private Sub txtjj_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles txtjj.KeyDown
- If e.KeyCode = Keys.Enter Then
- If txtjj.Text = String.Empty Then
- txtjj_Validating(Nothing, Nothing)
- End If
- Me.txtcount.Focus()
- End If
- End Sub
- Private Sub txthw_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles txthw.KeyDown
- If e.KeyCode = Keys.Enter Then
- txtmednumber.Focus()
- End If
- End Sub
- Private Sub CalMxMoney()
- Dim price As Double = CType(txtjj.Text, Double)
- Dim count As Int16 = CInt(txtcount.Text)
- Me.txtmoney.Text = (price * count).ToString
- End Sub
- Private Sub txtcount_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles txtcount.KeyDown
- If e.KeyCode = Keys.Enter Then
- txtkcount.Focus()
- End If
-
-
- End Sub
- Private Sub txthw_Validating(ByVal sender As Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles txthw.Validating
- If txthw.Text = String.Empty Then
- ErrorProvider1.SetError(txthw, "不能为空。")
- txthw.Focus()
- Else
- ErrorProvider1.SetError(txthw, "")
- End If
- End Sub
- Private Sub txtjj_Validating(ByVal sender As Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles txtjj.Validating
- If Not IsNumeric(txtjj.Text) Or txtjj.Text = String.Empty Then
- ErrorProvider1.SetError(txtjj, "不是数值类型且不能为空。")
- e.Cancel = True
- Else
- ErrorProvider1.SetError(txtjj, "")
- End If
- End Sub
- Private Sub txtcount_Validating(ByVal sender As Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles txtcount.Validating
- If Not IsNumeric(txtcount.Text) Or txtcount.Text = String.Empty Then
- ErrorProvider1.SetError(txtcount, "不是数值类型且不能为空。")
- txtcount.Focus()
- ' e.Cancel = True
- Else
- ErrorProvider1.SetError(txtcount, "")
- End If
- End Sub
-
-
- Private Sub txtkcount_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles txtkcount.KeyDown
- If Not IsNumeric(txtcount.Text) Or txtcount.Text = String.Empty Then
- txtcount_Validating(Nothing, Nothing)
- txtcount.Focus()
- Else
- If e.KeyCode = Keys.Enter Then
- Static i As Int16
- If dslocals.Tables("wz_kc_by").Rows.Count < 1 Then
- i = 1
- Else
- i = i + 1
- End If
- txtno.Text = CStr(i)
- Dim dr As DataRow = dslocals.Tables("wz_kc_by").NewRow()
- dr("序号") = CInt(Me.txtno.Text.Trim)
- dr("药品编号") = Me.txtmednumber.Text.Trim
- dr("药品名称") = Me.txtmedname.Text.Trim
- dr("药品规格") = Me.txtmedrule.Text.Trim
- dr("单位") = Me.txtunit.Text.Trim
- dr("进价") = CDec(Me.txtjj.Text.Trim)
- dr("报溢数量") = Me.txtcount.Text.Trim
- dr("原数量") = Me.txtkcount.Text.Trim
- dr("金额") = CDec(Me.txtjj.Text.Trim) * CInt(Me.txtcount.Text.Trim)
- dr("批号") = Me.txtbatch.Text.Trim
- dr("有效期") = Me.txtavaid.Text.Trim
- dr("包装") = Me.txtpackage.Text.Trim
- dr("产地") = Me.txtaddress.Text.Trim
- dr("日期") = Me.txtdate.Text.Trim
- dr("票号") = Me.txtbillnumber.Text.Trim
- dr("操作员") = Me.txtczy.Text.Trim
- dr("货位") = Me.txthw.Text.Trim
- CalMxMoney()
- dslocals.Tables("wz_kc_by").Rows.Add(dr)
- txtmednumber.Focus()
- 'clear()
- End If
- ErrorProvider1.SetError(txtcount, "")
- Me.txtcount.Text = ""
- End If
- dgview.DataSource = dslocals.Tables("wz_kc_by").DefaultView
- End Sub
- Private Sub frmkcby_Closed(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Closed
- If txtbillnumber.Text <> String.Empty And tbnsave.Enabled = True Then
- lsweb.cancelbill(txtbillnumber.Text.Trim)
- End If
- End Sub
- End Class