frmCp.vb
上传用户:wj57717022
上传日期:2014-12-16
资源大小:4093k
文件大小:54k
- 'Imports webJxc.WebReference
- 'Imports webJxc.frmCp
- Imports Microsoft.VisualBasic
- Public Class frmCp
- 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 StatusBar1 As System.Windows.Forms.StatusBar
- Friend WithEvents GroupBox1 As System.Windows.Forms.GroupBox
- Friend WithEvents tbrCp As System.Windows.Forms.ToolBar
- Friend WithEvents dgcp As System.Windows.Forms.DataGrid
- Friend WithEvents tbrAdd As System.Windows.Forms.ToolBarButton
- Friend WithEvents tbrSave As System.Windows.Forms.ToolBarButton
- Friend WithEvents tbrModify As System.Windows.Forms.ToolBarButton
- Friend WithEvents tbrDelete As System.Windows.Forms.ToolBarButton
- Friend WithEvents tbrPrint As System.Windows.Forms.ToolBarButton
- Friend WithEvents Label1 As System.Windows.Forms.Label
- Friend WithEvents Label2 As System.Windows.Forms.Label
- Friend WithEvents Label3 As System.Windows.Forms.Label
- Friend WithEvents Label4 As System.Windows.Forms.Label
- Friend WithEvents Label5 As System.Windows.Forms.Label
- Friend WithEvents Label6 As System.Windows.Forms.Label
- Friend WithEvents Label7 As System.Windows.Forms.Label
- Friend WithEvents Label8 As System.Windows.Forms.Label
- Friend WithEvents Label9 As System.Windows.Forms.Label
- Friend WithEvents Label10 As System.Windows.Forms.Label
- Friend WithEvents Label11 As System.Windows.Forms.Label
- Friend WithEvents Label12 As System.Windows.Forms.Label
- Friend WithEvents Label13 As System.Windows.Forms.Label
- Friend WithEvents txtName As System.Windows.Forms.TextBox
- Friend WithEvents txtRule As System.Windows.Forms.TextBox
- Friend WithEvents txtNumber As System.Windows.Forms.TextBox
- Friend WithEvents txtPrice As System.Windows.Forms.TextBox
- Friend WithEvents txtSprice As System.Windows.Forms.TextBox
- Friend WithEvents txtUnit As System.Windows.Forms.TextBox
- Friend WithEvents txtKl As System.Windows.Forms.TextBox
- Friend WithEvents txtAddress As System.Windows.Forms.TextBox
- Friend WithEvents txtProduct As System.Windows.Forms.TextBox
- Friend WithEvents txtPprice As System.Windows.Forms.TextBox
- Friend WithEvents txtLprice As System.Windows.Forms.TextBox
- Friend WithEvents txtAvaid As System.Windows.Forms.TextBox
- Friend WithEvents GroupBox2 As System.Windows.Forms.GroupBox
- Friend WithEvents Label14 As System.Windows.Forms.Label
- Friend WithEvents btnQuery As System.Windows.Forms.Button
- Friend WithEvents cboType As System.Windows.Forms.ComboBox
- Friend WithEvents tbrSeparator As System.Windows.Forms.ToolBarButton
- Friend WithEvents tbrExit As System.Windows.Forms.ToolBarButton
- Friend WithEvents StatusBarPanel1 As System.Windows.Forms.StatusBarPanel
- Friend WithEvents MsdnTextboxValidator1 As MSDNTextboxValidator.MSDNTextboxValidator
- Friend WithEvents ErrorProvider1 As System.Windows.Forms.ErrorProvider
- Friend WithEvents ImageList2 As System.Windows.Forms.ImageList
- Friend WithEvents txtQuery As System.Windows.Forms.TextBox
- Friend WithEvents Label15 As System.Windows.Forms.Label
- Friend WithEvents Label16 As System.Windows.Forms.Label
- Friend WithEvents txtjprice As System.Windows.Forms.TextBox
- Friend WithEvents txtzprice As System.Windows.Forms.TextBox
- Friend WithEvents txtmednumber As System.Windows.Forms.Label
- <System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
- Me.components = New System.ComponentModel.Container
- Dim resources As System.Resources.ResourceManager = New System.Resources.ResourceManager(GetType(frmCp))
- Me.tbrCp = New System.Windows.Forms.ToolBar
- Me.tbrAdd = New System.Windows.Forms.ToolBarButton
- Me.tbrSave = New System.Windows.Forms.ToolBarButton
- Me.tbrModify = New System.Windows.Forms.ToolBarButton
- Me.tbrDelete = New System.Windows.Forms.ToolBarButton
- Me.tbrPrint = New System.Windows.Forms.ToolBarButton
- Me.tbrSeparator = New System.Windows.Forms.ToolBarButton
- Me.tbrExit = New System.Windows.Forms.ToolBarButton
- Me.ImageList2 = New System.Windows.Forms.ImageList(Me.components)
- Me.StatusBar1 = New System.Windows.Forms.StatusBar
- Me.StatusBarPanel1 = New System.Windows.Forms.StatusBarPanel
- Me.GroupBox1 = New System.Windows.Forms.GroupBox
- Me.txtmednumber = New System.Windows.Forms.Label
- Me.txtzprice = New System.Windows.Forms.TextBox
- Me.txtjprice = New System.Windows.Forms.TextBox
- Me.Label16 = New System.Windows.Forms.Label
- Me.Label15 = New System.Windows.Forms.Label
- Me.cboType = New System.Windows.Forms.ComboBox
- Me.txtAvaid = New System.Windows.Forms.TextBox
- Me.txtLprice = New System.Windows.Forms.TextBox
- Me.txtPprice = New System.Windows.Forms.TextBox
- Me.txtProduct = New System.Windows.Forms.TextBox
- Me.txtAddress = New System.Windows.Forms.TextBox
- Me.txtKl = New System.Windows.Forms.TextBox
- Me.txtUnit = New System.Windows.Forms.TextBox
- Me.txtSprice = New System.Windows.Forms.TextBox
- Me.txtPrice = New System.Windows.Forms.TextBox
- Me.txtNumber = New System.Windows.Forms.TextBox
- Me.txtRule = New System.Windows.Forms.TextBox
- Me.txtName = New System.Windows.Forms.TextBox
- Me.Label13 = New System.Windows.Forms.Label
- Me.Label12 = New System.Windows.Forms.Label
- Me.Label11 = New System.Windows.Forms.Label
- Me.Label10 = New System.Windows.Forms.Label
- Me.Label9 = New System.Windows.Forms.Label
- Me.Label8 = New System.Windows.Forms.Label
- Me.Label7 = New System.Windows.Forms.Label
- Me.Label6 = New System.Windows.Forms.Label
- Me.Label5 = New System.Windows.Forms.Label
- Me.Label4 = New System.Windows.Forms.Label
- Me.Label3 = New System.Windows.Forms.Label
- Me.Label2 = New System.Windows.Forms.Label
- Me.Label1 = New System.Windows.Forms.Label
- Me.dgcp = New System.Windows.Forms.DataGrid
- Me.GroupBox2 = New System.Windows.Forms.GroupBox
- Me.txtQuery = New System.Windows.Forms.TextBox
- Me.btnQuery = New System.Windows.Forms.Button
- Me.Label14 = New System.Windows.Forms.Label
- Me.MsdnTextboxValidator1 = New MSDNTextboxValidator.MSDNTextboxValidator(Me.components)
- Me.ErrorProvider1 = New System.Windows.Forms.ErrorProvider
- CType(Me.StatusBarPanel1, System.ComponentModel.ISupportInitialize).BeginInit()
- Me.GroupBox1.SuspendLayout()
- CType(Me.dgcp, System.ComponentModel.ISupportInitialize).BeginInit()
- Me.GroupBox2.SuspendLayout()
- Me.SuspendLayout()
- '
- 'tbrCp
- '
- Me.tbrCp.AllowDrop = True
- Me.tbrCp.Appearance = System.Windows.Forms.ToolBarAppearance.Flat
- Me.tbrCp.Buttons.AddRange(New System.Windows.Forms.ToolBarButton() {Me.tbrAdd, Me.tbrSave, Me.tbrModify, Me.tbrDelete, Me.tbrPrint, Me.tbrSeparator, Me.tbrExit})
- Me.tbrCp.DropDownArrows = True
- Me.tbrCp.ImageList = Me.ImageList2
- Me.tbrCp.Location = New System.Drawing.Point(0, 0)
- Me.tbrCp.Name = "tbrCp"
- Me.tbrCp.ShowToolTips = True
- Me.tbrCp.Size = New System.Drawing.Size(712, 41)
- Me.tbrCp.TabIndex = 0
- '
- 'tbrAdd
- '
- Me.tbrAdd.ImageIndex = 7
- Me.tbrAdd.Text = "添加"
- '
- 'tbrSave
- '
- Me.tbrSave.ImageIndex = 4
- Me.tbrSave.Text = "保存"
- '
- 'tbrModify
- '
- Me.tbrModify.ImageIndex = 5
- Me.tbrModify.Text = "修改"
- '
- 'tbrDelete
- '
- Me.tbrDelete.ImageIndex = 6
- Me.tbrDelete.Text = "删除"
- '
- 'tbrPrint
- '
- Me.tbrPrint.ImageIndex = 12
- Me.tbrPrint.Text = "打印"
- '
- 'tbrSeparator
- '
- Me.tbrSeparator.Style = System.Windows.Forms.ToolBarButtonStyle.Separator
- Me.tbrSeparator.Text = "退出"
- '
- 'tbrExit
- '
- Me.tbrExit.ImageIndex = 11
- Me.tbrExit.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
- '
- 'StatusBar1
- '
- Me.StatusBar1.Location = New System.Drawing.Point(0, 449)
- Me.StatusBar1.Name = "StatusBar1"
- Me.StatusBar1.Panels.AddRange(New System.Windows.Forms.StatusBarPanel() {Me.StatusBarPanel1})
- Me.StatusBar1.Size = New System.Drawing.Size(712, 21)
- Me.StatusBar1.TabIndex = 1
- '
- 'StatusBarPanel1
- '
- Me.StatusBarPanel1.AutoSize = System.Windows.Forms.StatusBarPanelAutoSize.Spring
- Me.StatusBarPanel1.Icon = CType(resources.GetObject("StatusBarPanel1.Icon"), System.Drawing.Icon)
- Me.StatusBarPanel1.Text = "StatusBarPanel1"
- '
- 'GroupBox1
- '
- Me.GroupBox1.Anchor = CType(((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Left) _
- Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
- Me.GroupBox1.Controls.Add(Me.txtmednumber)
- Me.GroupBox1.Controls.Add(Me.txtzprice)
- Me.GroupBox1.Controls.Add(Me.txtjprice)
- Me.GroupBox1.Controls.Add(Me.Label16)
- Me.GroupBox1.Controls.Add(Me.Label15)
- Me.GroupBox1.Controls.Add(Me.cboType)
- Me.GroupBox1.Controls.Add(Me.txtAvaid)
- Me.GroupBox1.Controls.Add(Me.txtLprice)
- Me.GroupBox1.Controls.Add(Me.txtPprice)
- Me.GroupBox1.Controls.Add(Me.txtProduct)
- Me.GroupBox1.Controls.Add(Me.txtAddress)
- Me.GroupBox1.Controls.Add(Me.txtKl)
- Me.GroupBox1.Controls.Add(Me.txtUnit)
- Me.GroupBox1.Controls.Add(Me.txtSprice)
- Me.GroupBox1.Controls.Add(Me.txtPrice)
- Me.GroupBox1.Controls.Add(Me.txtNumber)
- Me.GroupBox1.Controls.Add(Me.txtRule)
- Me.GroupBox1.Controls.Add(Me.txtName)
- Me.GroupBox1.Controls.Add(Me.Label13)
- Me.GroupBox1.Controls.Add(Me.Label12)
- Me.GroupBox1.Controls.Add(Me.Label11)
- Me.GroupBox1.Controls.Add(Me.Label10)
- Me.GroupBox1.Controls.Add(Me.Label9)
- Me.GroupBox1.Controls.Add(Me.Label8)
- Me.GroupBox1.Controls.Add(Me.Label7)
- Me.GroupBox1.Controls.Add(Me.Label6)
- Me.GroupBox1.Controls.Add(Me.Label5)
- Me.GroupBox1.Controls.Add(Me.Label4)
- Me.GroupBox1.Controls.Add(Me.Label3)
- Me.GroupBox1.Controls.Add(Me.Label2)
- Me.GroupBox1.Controls.Add(Me.Label1)
- Me.GroupBox1.Location = New System.Drawing.Point(6, 56)
- Me.GroupBox1.Name = "GroupBox1"
- Me.GroupBox1.Size = New System.Drawing.Size(703, 160)
- Me.GroupBox1.TabIndex = 2
- Me.GroupBox1.TabStop = False
- Me.GroupBox1.Text = "添加药品信息"
- '
- 'txtmednumber
- '
- Me.txtmednumber.Location = New System.Drawing.Point(344, 120)
- Me.txtmednumber.Name = "txtmednumber"
- Me.txtmednumber.TabIndex = 31
- '
- 'txtzprice
- '
- Me.MsdnTextboxValidator1.SetCustomValidationEnabled(Me.txtzprice, True)
- Me.MsdnTextboxValidator1.SetDataType(Me.txtzprice, MSDNTextboxValidator.DataTypeConstants.DecimalType)
- Me.MsdnTextboxValidator1.SetDisplayName(Me.txtzprice, "")
- Me.txtzprice.Location = New System.Drawing.Point(216, 88)
- Me.MsdnTextboxValidator1.SetMaxValue(Me.txtzprice, "")
- Me.MsdnTextboxValidator1.SetMinValue(Me.txtzprice, "")
- Me.txtzprice.Name = "txtzprice"
- Me.MsdnTextboxValidator1.SetRegularExpression(Me.txtzprice, "")
- Me.MsdnTextboxValidator1.SetRequired(Me.txtzprice, False)
- Me.txtzprice.Size = New System.Drawing.Size(78, 21)
- Me.txtzprice.TabIndex = 30
- Me.txtzprice.Text = ""
- '
- 'txtjprice
- '
- Me.MsdnTextboxValidator1.SetCustomValidationEnabled(Me.txtjprice, True)
- Me.MsdnTextboxValidator1.SetDataType(Me.txtjprice, MSDNTextboxValidator.DataTypeConstants.DecimalType)
- Me.MsdnTextboxValidator1.SetDisplayName(Me.txtjprice, "")
- Me.txtjprice.Location = New System.Drawing.Point(60, 88)
- Me.MsdnTextboxValidator1.SetMaxValue(Me.txtjprice, "")
- Me.MsdnTextboxValidator1.SetMinValue(Me.txtjprice, "")
- Me.txtjprice.Name = "txtjprice"
- Me.MsdnTextboxValidator1.SetRegularExpression(Me.txtjprice, "")
- Me.MsdnTextboxValidator1.SetRequired(Me.txtjprice, False)
- Me.txtjprice.Size = New System.Drawing.Size(84, 21)
- Me.txtjprice.TabIndex = 29
- Me.txtjprice.Text = ""
- '
- 'Label16
- '
- Me.Label16.AutoSize = True
- Me.Label16.Location = New System.Drawing.Point(176, 96)
- Me.Label16.Name = "Label16"
- Me.Label16.Size = New System.Drawing.Size(48, 17)
- Me.Label16.TabIndex = 28
- Me.Label16.Text = "最低价:"
- '
- 'Label15
- '
- Me.Label15.AutoSize = True
- Me.Label15.Location = New System.Drawing.Point(20, 96)
- Me.Label15.Name = "Label15"
- Me.Label15.Size = New System.Drawing.Size(48, 17)
- Me.Label15.TabIndex = 27
- Me.Label15.Text = "建议价:"
- '
- 'cboType
- '
- Me.cboType.Items.AddRange(New Object() {"P01:抗生素", "P02:其它抗菌药", "P03:维生素,激素,生化类", "P04:解热止痛感冒药", "P05:中枢药", "P06:心血管药", "P07:消化系统药", "P08:其它西药", "P09:中药", "Z01:抗生素", "Z02:其他抗菌素", "Z03:维生素,激素,生化类", "Z04:电解质,大输液", "Z05:麻醉,镇静,抗过敏,解热止痛", "Z06:心血管,血液,利尿药", "Z07:中药制剂", "Z08:其它", "F01:西药粉剂", "F02:中药制剂", "K01:抗菌类", "K02:西药液体", "K03:感冒止咳", "K04:中药治疗类", "K05:营养滋补类", "K06:其它", "W01:眼用药", "W02:五官科药材", "W03:栓剂", "W04:皮肤用", "W05:贴膏", "W06:液体制剂", "W07:外用粉剂", "B01:保健药品", "B02:保健食品", "B03:消字号", "Q01:敷料", "Q02:一次性布料", "Q03:一次性针筒", "Q04:一次性输液器", "Q05:一次性针头", "Q06:一次性其他用品", "Q07:医用材料", "Q08:医用器械"})
- Me.cboType.Location = New System.Drawing.Point(216, 24)
- Me.cboType.Name = "cboType"
- Me.cboType.Size = New System.Drawing.Size(78, 20)
- Me.cboType.TabIndex = 26
- '
- 'txtAvaid
- '
- Me.MsdnTextboxValidator1.SetCustomValidationEnabled(Me.txtAvaid, True)
- Me.MsdnTextboxValidator1.SetDataType(Me.txtAvaid, MSDNTextboxValidator.DataTypeConstants.StringType)
- Me.MsdnTextboxValidator1.SetDisplayName(Me.txtAvaid, "")
- Me.txtAvaid.Location = New System.Drawing.Point(462, 88)
- Me.MsdnTextboxValidator1.SetMaxValue(Me.txtAvaid, "")
- Me.MsdnTextboxValidator1.SetMinValue(Me.txtAvaid, "")
- Me.txtAvaid.Name = "txtAvaid"
- Me.MsdnTextboxValidator1.SetRegularExpression(Me.txtAvaid, "")
- Me.MsdnTextboxValidator1.SetRequired(Me.txtAvaid, False)
- Me.txtAvaid.Size = New System.Drawing.Size(72, 21)
- Me.txtAvaid.TabIndex = 25
- Me.txtAvaid.Text = ""
- '
- 'txtLprice
- '
- Me.MsdnTextboxValidator1.SetCustomValidationEnabled(Me.txtLprice, True)
- Me.MsdnTextboxValidator1.SetDataType(Me.txtLprice, MSDNTextboxValidator.DataTypeConstants.DecimalType)
- Me.MsdnTextboxValidator1.SetDisplayName(Me.txtLprice, "")
- Me.txtLprice.Location = New System.Drawing.Point(600, 56)
- Me.MsdnTextboxValidator1.SetMaxValue(Me.txtLprice, "")
- Me.MsdnTextboxValidator1.SetMinValue(Me.txtLprice, "")
- Me.txtLprice.Name = "txtLprice"
- Me.MsdnTextboxValidator1.SetRegularExpression(Me.txtLprice, "")
- Me.MsdnTextboxValidator1.SetRequired(Me.txtLprice, False)
- Me.txtLprice.Size = New System.Drawing.Size(90, 21)
- Me.txtLprice.TabIndex = 24
- Me.txtLprice.Text = ""
- '
- 'txtPprice
- '
- Me.MsdnTextboxValidator1.SetCustomValidationEnabled(Me.txtPprice, True)
- Me.MsdnTextboxValidator1.SetDataType(Me.txtPprice, MSDNTextboxValidator.DataTypeConstants.DecimalType)
- Me.MsdnTextboxValidator1.SetDisplayName(Me.txtPprice, "")
- Me.txtPprice.Location = New System.Drawing.Point(462, 56)
- Me.MsdnTextboxValidator1.SetMaxValue(Me.txtPprice, "")
- Me.MsdnTextboxValidator1.SetMinValue(Me.txtPprice, "")
- Me.txtPprice.Name = "txtPprice"
- Me.MsdnTextboxValidator1.SetRegularExpression(Me.txtPprice, "")
- Me.MsdnTextboxValidator1.SetRequired(Me.txtPprice, False)
- Me.txtPprice.Size = New System.Drawing.Size(72, 21)
- Me.txtPprice.TabIndex = 23
- Me.txtPprice.Text = ""
- '
- 'txtProduct
- '
- Me.MsdnTextboxValidator1.SetCustomValidationEnabled(Me.txtProduct, True)
- Me.MsdnTextboxValidator1.SetDataType(Me.txtProduct, MSDNTextboxValidator.DataTypeConstants.StringType)
- Me.MsdnTextboxValidator1.SetDisplayName(Me.txtProduct, "")
- Me.txtProduct.Location = New System.Drawing.Point(60, 120)
- Me.MsdnTextboxValidator1.SetMaxValue(Me.txtProduct, "")
- Me.MsdnTextboxValidator1.SetMinValue(Me.txtProduct, "")
- Me.txtProduct.Name = "txtProduct"
- Me.MsdnTextboxValidator1.SetRegularExpression(Me.txtProduct, "")
- Me.MsdnTextboxValidator1.SetRequired(Me.txtProduct, False)
- Me.txtProduct.Size = New System.Drawing.Size(236, 21)
- Me.txtProduct.TabIndex = 22
- Me.txtProduct.Text = ""
- '
- 'txtAddress
- '
- Me.MsdnTextboxValidator1.SetCustomValidationEnabled(Me.txtAddress, True)
- Me.MsdnTextboxValidator1.SetDataType(Me.txtAddress, MSDNTextboxValidator.DataTypeConstants.StringType)
- Me.MsdnTextboxValidator1.SetDisplayName(Me.txtAddress, "")
- Me.txtAddress.Location = New System.Drawing.Point(600, 88)
- Me.MsdnTextboxValidator1.SetMaxValue(Me.txtAddress, "")
- Me.MsdnTextboxValidator1.SetMinValue(Me.txtAddress, "")
- Me.txtAddress.Name = "txtAddress"
- Me.MsdnTextboxValidator1.SetRegularExpression(Me.txtAddress, "")
- Me.MsdnTextboxValidator1.SetRequired(Me.txtAddress, False)
- Me.txtAddress.Size = New System.Drawing.Size(90, 21)
- Me.txtAddress.TabIndex = 21
- Me.txtAddress.Text = ""
- '
- 'txtKl
- '
- Me.MsdnTextboxValidator1.SetCustomValidationEnabled(Me.txtKl, True)
- Me.MsdnTextboxValidator1.SetDataType(Me.txtKl, MSDNTextboxValidator.DataTypeConstants.DecimalType)
- Me.MsdnTextboxValidator1.SetDisplayName(Me.txtKl, "")
- Me.txtKl.Location = New System.Drawing.Point(366, 88)
- Me.MsdnTextboxValidator1.SetMaxValue(Me.txtKl, "")
- Me.MsdnTextboxValidator1.SetMinValue(Me.txtKl, "")
- Me.txtKl.Name = "txtKl"
- Me.MsdnTextboxValidator1.SetRegularExpression(Me.txtKl, "")
- Me.MsdnTextboxValidator1.SetRequired(Me.txtKl, False)
- Me.txtKl.Size = New System.Drawing.Size(40, 21)
- Me.txtKl.TabIndex = 20
- Me.txtKl.Text = ""
- '
- 'txtUnit
- '
- Me.MsdnTextboxValidator1.SetCustomValidationEnabled(Me.txtUnit, True)
- Me.MsdnTextboxValidator1.SetDataType(Me.txtUnit, MSDNTextboxValidator.DataTypeConstants.StringType)
- Me.MsdnTextboxValidator1.SetDisplayName(Me.txtUnit, "")
- Me.txtUnit.Location = New System.Drawing.Point(366, 56)
- Me.MsdnTextboxValidator1.SetMaxValue(Me.txtUnit, "")
- Me.MsdnTextboxValidator1.SetMinValue(Me.txtUnit, "")
- Me.txtUnit.Name = "txtUnit"
- Me.MsdnTextboxValidator1.SetRegularExpression(Me.txtUnit, "")
- Me.MsdnTextboxValidator1.SetRequired(Me.txtUnit, False)
- Me.txtUnit.Size = New System.Drawing.Size(40, 21)
- Me.txtUnit.TabIndex = 19
- Me.txtUnit.Text = ""
- '
- 'txtSprice
- '
- Me.MsdnTextboxValidator1.SetCustomValidationEnabled(Me.txtSprice, True)
- Me.MsdnTextboxValidator1.SetDataType(Me.txtSprice, MSDNTextboxValidator.DataTypeConstants.DecimalType)
- Me.MsdnTextboxValidator1.SetDisplayName(Me.txtSprice, "")
- Me.txtSprice.Location = New System.Drawing.Point(216, 56)
- Me.MsdnTextboxValidator1.SetMaxValue(Me.txtSprice, "")
- Me.MsdnTextboxValidator1.SetMinValue(Me.txtSprice, "")
- Me.txtSprice.Name = "txtSprice"
- Me.MsdnTextboxValidator1.SetRegularExpression(Me.txtSprice, "")
- Me.MsdnTextboxValidator1.SetRequired(Me.txtSprice, False)
- Me.txtSprice.Size = New System.Drawing.Size(78, 21)
- Me.txtSprice.TabIndex = 18
- Me.txtSprice.Text = ""
- '
- 'txtPrice
- '
- Me.MsdnTextboxValidator1.SetCustomValidationEnabled(Me.txtPrice, True)
- Me.MsdnTextboxValidator1.SetDataType(Me.txtPrice, MSDNTextboxValidator.DataTypeConstants.DecimalType)
- Me.MsdnTextboxValidator1.SetDisplayName(Me.txtPrice, "")
- Me.txtPrice.Location = New System.Drawing.Point(60, 56)
- Me.MsdnTextboxValidator1.SetMaxValue(Me.txtPrice, "")
- Me.MsdnTextboxValidator1.SetMinValue(Me.txtPrice, "")
- Me.txtPrice.Name = "txtPrice"
- Me.MsdnTextboxValidator1.SetRegularExpression(Me.txtPrice, "")
- Me.MsdnTextboxValidator1.SetRequired(Me.txtPrice, False)
- Me.txtPrice.Size = New System.Drawing.Size(84, 21)
- Me.txtPrice.TabIndex = 17
- Me.txtPrice.Text = ""
- '
- 'txtNumber
- '
- Me.MsdnTextboxValidator1.SetCustomValidationEnabled(Me.txtNumber, True)
- Me.MsdnTextboxValidator1.SetDataType(Me.txtNumber, MSDNTextboxValidator.DataTypeConstants.StringType)
- Me.MsdnTextboxValidator1.SetDisplayName(Me.txtNumber, "")
- Me.txtNumber.Location = New System.Drawing.Point(600, 24)
- Me.MsdnTextboxValidator1.SetMaxValue(Me.txtNumber, "")
- Me.MsdnTextboxValidator1.SetMinValue(Me.txtNumber, "")
- Me.txtNumber.Name = "txtNumber"
- Me.txtNumber.ReadOnly = True
- Me.MsdnTextboxValidator1.SetRegularExpression(Me.txtNumber, "")
- Me.MsdnTextboxValidator1.SetRequired(Me.txtNumber, False)
- Me.txtNumber.Size = New System.Drawing.Size(90, 21)
- Me.txtNumber.TabIndex = 16
- Me.txtNumber.Text = ""
- '
- 'txtRule
- '
- Me.txtRule.BackColor = System.Drawing.SystemColors.HighlightText
- Me.MsdnTextboxValidator1.SetCustomValidationEnabled(Me.txtRule, True)
- Me.MsdnTextboxValidator1.SetDataType(Me.txtRule, MSDNTextboxValidator.DataTypeConstants.StringType)
- Me.MsdnTextboxValidator1.SetDisplayName(Me.txtRule, "")
- Me.txtRule.Location = New System.Drawing.Point(366, 25)
- Me.MsdnTextboxValidator1.SetMaxValue(Me.txtRule, "")
- Me.MsdnTextboxValidator1.SetMinValue(Me.txtRule, "")
- Me.txtRule.Name = "txtRule"
- Me.MsdnTextboxValidator1.SetRegularExpression(Me.txtRule, "")
- Me.MsdnTextboxValidator1.SetRequired(Me.txtRule, False)
- Me.txtRule.Size = New System.Drawing.Size(168, 21)
- Me.txtRule.TabIndex = 15
- Me.txtRule.Text = ""
- '
- 'txtName
- '
- Me.MsdnTextboxValidator1.SetCustomValidationEnabled(Me.txtName, True)
- Me.MsdnTextboxValidator1.SetDataType(Me.txtName, MSDNTextboxValidator.DataTypeConstants.StringType)
- Me.MsdnTextboxValidator1.SetDisplayName(Me.txtName, "")
- Me.txtName.Location = New System.Drawing.Point(60, 24)
- Me.MsdnTextboxValidator1.SetMaxValue(Me.txtName, "")
- Me.MsdnTextboxValidator1.SetMinValue(Me.txtName, "")
- Me.txtName.Name = "txtName"
- Me.MsdnTextboxValidator1.SetRegularExpression(Me.txtName, "")
- Me.MsdnTextboxValidator1.SetRequired(Me.txtName, False)
- Me.txtName.Size = New System.Drawing.Size(84, 21)
- Me.txtName.TabIndex = 13
- Me.txtName.Text = ""
- '
- 'Label13
- '
- Me.Label13.AutoSize = True
- Me.Label13.Location = New System.Drawing.Point(560, 64)
- Me.Label13.Name = "Label13"
- Me.Label13.Size = New System.Drawing.Size(48, 17)
- Me.Label13.TabIndex = 12
- Me.Label13.Text = "零售价:"
- '
- 'Label12
- '
- Me.Label12.AutoSize = True
- Me.Label12.Location = New System.Drawing.Point(422, 62)
- Me.Label12.Name = "Label12"
- Me.Label12.Size = New System.Drawing.Size(48, 17)
- Me.Label12.TabIndex = 11
- Me.Label12.Text = "批发价:"
- '
- 'Label11
- '
- Me.Label11.AutoSize = True
- Me.Label11.Location = New System.Drawing.Point(422, 96)
- Me.Label11.Name = "Label11"
- Me.Label11.Size = New System.Drawing.Size(48, 17)
- Me.Label11.TabIndex = 10
- Me.Label11.Text = "有效期:"
- '
- 'Label10
- '
- Me.Label10.AutoSize = True
- Me.Label10.Location = New System.Drawing.Point(8, 128)
- Me.Label10.Name = "Label10"
- Me.Label10.Size = New System.Drawing.Size(60, 17)
- Me.Label10.TabIndex = 9
- Me.Label10.Text = "生产厂家:"
- '
- 'Label9
- '
- Me.Label9.AutoSize = True
- Me.Label9.Location = New System.Drawing.Point(572, 96)
- Me.Label9.Name = "Label9"
- Me.Label9.Size = New System.Drawing.Size(35, 17)
- Me.Label9.TabIndex = 8
- Me.Label9.Text = "产地:"
- '
- 'Label8
- '
- Me.Label8.AutoSize = True
- Me.Label8.Location = New System.Drawing.Point(338, 96)
- Me.Label8.Name = "Label8"
- Me.Label8.Size = New System.Drawing.Size(35, 17)
- Me.Label8.TabIndex = 7
- Me.Label8.Text = "扣率:"
- '
- 'Label7
- '
- Me.Label7.AutoSize = True
- Me.Label7.Location = New System.Drawing.Point(188, 64)
- Me.Label7.Name = "Label7"
- Me.Label7.Size = New System.Drawing.Size(35, 17)
- Me.Label7.TabIndex = 6
- Me.Label7.Text = "售价:"
- '
- 'Label6
- '
- Me.Label6.AutoSize = True
- Me.Label6.Location = New System.Drawing.Point(32, 64)
- Me.Label6.Name = "Label6"
- Me.Label6.Size = New System.Drawing.Size(35, 17)
- Me.Label6.TabIndex = 5
- Me.Label6.Text = "单价:"
- '
- 'Label5
- '
- Me.Label5.AutoSize = True
- Me.Label5.Location = New System.Drawing.Point(338, 62)
- Me.Label5.Name = "Label5"
- Me.Label5.Size = New System.Drawing.Size(35, 17)
- Me.Label5.TabIndex = 4
- Me.Label5.Text = "单位:"
- '
- 'Label4
- '
- Me.Label4.AutoSize = True
- Me.Label4.Location = New System.Drawing.Point(164, 32)
- Me.Label4.Name = "Label4"
- Me.Label4.Size = New System.Drawing.Size(60, 17)
- Me.Label4.TabIndex = 3
- Me.Label4.Text = "药品类型:"
- '
- 'Label3
- '
- Me.Label3.AutoSize = True
- Me.Label3.Location = New System.Drawing.Point(314, 31)
- Me.Label3.Name = "Label3"
- Me.Label3.Size = New System.Drawing.Size(60, 17)
- Me.Label3.TabIndex = 2
- Me.Label3.Text = "药品规格:"
- '
- 'Label2
- '
- Me.Label2.AutoSize = True
- Me.Label2.Location = New System.Drawing.Point(8, 32)
- Me.Label2.Name = "Label2"
- Me.Label2.Size = New System.Drawing.Size(60, 17)
- Me.Label2.TabIndex = 1
- Me.Label2.Text = "药品名称:"
- '
- 'Label1
- '
- Me.Label1.AutoSize = True
- Me.Label1.Location = New System.Drawing.Point(548, 31)
- Me.Label1.Name = "Label1"
- Me.Label1.Size = New System.Drawing.Size(60, 17)
- Me.Label1.TabIndex = 0
- Me.Label1.Text = "药品编号:"
- '
- 'dgcp
- '
- Me.dgcp.AlternatingBackColor = System.Drawing.Color.Gainsboro
- Me.dgcp.Anchor = CType((((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Bottom) _
- Or System.Windows.Forms.AnchorStyles.Left) _
- Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
- Me.dgcp.BackColor = System.Drawing.Color.Silver
- Me.dgcp.BackgroundColor = System.Drawing.Color.LightGray
- Me.dgcp.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle
- Me.dgcp.CaptionBackColor = System.Drawing.Color.DarkSlateBlue
- Me.dgcp.CaptionFont = New System.Drawing.Font("Tahoma", 8.0!)
- Me.dgcp.CaptionForeColor = System.Drawing.Color.White
- Me.dgcp.CaptionVisible = False
- Me.dgcp.DataMember = ""
- Me.dgcp.FlatMode = True
- Me.dgcp.ForeColor = System.Drawing.Color.Black
- Me.dgcp.GridLineColor = System.Drawing.Color.White
- Me.dgcp.HeaderBackColor = System.Drawing.Color.DarkGray
- Me.dgcp.HeaderForeColor = System.Drawing.Color.Black
- Me.dgcp.LinkColor = System.Drawing.Color.DarkSlateBlue
- Me.dgcp.Location = New System.Drawing.Point(6, 272)
- Me.dgcp.Name = "dgcp"
- Me.dgcp.ParentRowsBackColor = System.Drawing.Color.Black
- Me.dgcp.ParentRowsForeColor = System.Drawing.Color.White
- Me.dgcp.RowHeadersVisible = False
- Me.dgcp.SelectionBackColor = System.Drawing.Color.DarkSlateBlue
- Me.dgcp.SelectionForeColor = System.Drawing.Color.White
- Me.dgcp.Size = New System.Drawing.Size(703, 160)
- Me.dgcp.TabIndex = 3
- '
- 'GroupBox2
- '
- Me.GroupBox2.Anchor = CType(((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Left) _
- Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
- Me.GroupBox2.Controls.Add(Me.txtQuery)
- Me.GroupBox2.Controls.Add(Me.btnQuery)
- Me.GroupBox2.Controls.Add(Me.Label14)
- Me.GroupBox2.Location = New System.Drawing.Point(6, 224)
- Me.GroupBox2.Name = "GroupBox2"
- Me.GroupBox2.Size = New System.Drawing.Size(703, 48)
- Me.GroupBox2.TabIndex = 4
- Me.GroupBox2.TabStop = False
- Me.GroupBox2.Text = "查询药品信息"
- '
- 'txtQuery
- '
- Me.MsdnTextboxValidator1.SetCustomValidationEnabled(Me.txtQuery, True)
- Me.MsdnTextboxValidator1.SetDataType(Me.txtQuery, MSDNTextboxValidator.DataTypeConstants.StringType)
- Me.MsdnTextboxValidator1.SetDisplayName(Me.txtQuery, "")
- Me.txtQuery.Location = New System.Drawing.Point(272, 18)
- Me.MsdnTextboxValidator1.SetMaxValue(Me.txtQuery, "")
- Me.MsdnTextboxValidator1.SetMinValue(Me.txtQuery, "")
- Me.txtQuery.Name = "txtQuery"
- Me.MsdnTextboxValidator1.SetRegularExpression(Me.txtQuery, "")
- Me.MsdnTextboxValidator1.SetRequired(Me.txtQuery, False)
- Me.txtQuery.Size = New System.Drawing.Size(168, 21)
- Me.txtQuery.TabIndex = 3
- Me.txtQuery.Text = ""
- '
- 'btnQuery
- '
- Me.btnQuery.FlatStyle = System.Windows.Forms.FlatStyle.Popup
- Me.btnQuery.Location = New System.Drawing.Point(440, 18)
- Me.btnQuery.Name = "btnQuery"
- Me.btnQuery.Size = New System.Drawing.Size(88, 21)
- Me.btnQuery.TabIndex = 2
- Me.btnQuery.Text = "查询"
- '
- 'Label14
- '
- Me.Label14.Anchor = CType((((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Bottom) _
- Or System.Windows.Forms.AnchorStyles.Left) _
- Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
- Me.Label14.AutoSize = True
- Me.Label14.Font = New System.Drawing.Font("宋体", 9.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(134, Byte))
- Me.Label14.Location = New System.Drawing.Point(126, 25)
- Me.Label14.Name = "Label14"
- Me.Label14.Size = New System.Drawing.Size(153, 17)
- Me.Label14.TabIndex = 1
- Me.Label14.Text = "请输入药品编号或拼音码:"
- '
- 'MsdnTextboxValidator1
- '
- Me.MsdnTextboxValidator1.DisplayControl = Nothing
- Me.MsdnTextboxValidator1.ErrorProvider = Nothing
- Me.MsdnTextboxValidator1.InvalidBackColor = System.Drawing.Color.Empty
- Me.MsdnTextboxValidator1.TooltipProvider = Nothing
- '
- 'ErrorProvider1
- '
- Me.ErrorProvider1.ContainerControl = Me
- '
- 'frmCp
- '
- Me.AutoScaleBaseSize = New System.Drawing.Size(6, 14)
- Me.BackColor = System.Drawing.SystemColors.Control
- Me.ClientSize = New System.Drawing.Size(712, 470)
- Me.Controls.Add(Me.GroupBox2)
- Me.Controls.Add(Me.dgcp)
- Me.Controls.Add(Me.GroupBox1)
- Me.Controls.Add(Me.StatusBar1)
- Me.Controls.Add(Me.tbrCp)
- Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle
- Me.MaximizeBox = False
- Me.Name = "frmCp"
- Me.Text = "药品基本信息"
- Me.WindowState = System.Windows.Forms.FormWindowState.Maximized
- CType(Me.StatusBarPanel1, System.ComponentModel.ISupportInitialize).EndInit()
- Me.GroupBox1.ResumeLayout(False)
- CType(Me.dgcp, System.ComponentModel.ISupportInitialize).EndInit()
- Me.GroupBox2.ResumeLayout(False)
- Me.ResumeLayout(False)
- End Sub
- #End Region
- Public lsweb As New jxcmanage
- Public dslocals As New DataSet
- Public web As New WebReference.DataManager
- Private Sub frmCp_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
- dslocals = lsweb.returndataset("select * from wz_cp", "wz_cp")
- dslocals.Clear()
- dgcp.DataSource = dslocals.Tables("wz_cp").DefaultView
- tbrSave.Enabled = False
- tbrAdd.Enabled = True
- tbrModify.Enabled = True
- tbrDelete.Enabled = True
- tbrPrint.Enabled = True
- tbrExit.Enabled = True
-
- End Sub
- Public Sub tbnEnable(ByVal strboolean As String, ByVal tbr As ToolBar)
- If strboolean = "tbrAdd.Enabled = True" Then
- tbrSave.Enabled = False
- tbrModify.Enabled = False
- tbrDelete.Enabled = False
- tbrPrint.Enabled = False
- tbrExit.Enabled = True
- ElseIf strboolean = "tbrAdd.Enabled = False" Then
- tbrAdd.Enabled = False
- tbrSave.Enabled = True
- tbrModify.Enabled = False
- tbrDelete.Enabled = False
- tbrPrint.Enabled = True
- tbrExit.Enabled = True
- ElseIf strboolean = "tbrSave.Enabled = True" Then
- tbrAdd.Enabled = False
- tbrModify.Enabled = False
- tbrDelete.Enabled = False
- tbrPrint.Enabled = True
- tbrExit.Enabled = True
- ElseIf strboolean = "tbrSave.Enabled = False" Then
- tbrSave.Enabled = False
- tbrAdd.Enabled = True
- tbrModify.Enabled = True
- tbrDelete.Enabled = True
- tbrPrint.Enabled = True
- tbrExit.Enabled = True
- ElseIf strboolean = "tbrModify.Enabled = True" Then
- tbrAdd.Enabled = False
- tbrSave.Enabled = True
- tbrDelete.Enabled = False
- tbrPrint.Enabled = False
- tbrExit.Enabled = True
- ElseIf strboolean = "tbrModify.Enabled = False" Then
- tbrModify.Enabled = False
- tbrAdd.Enabled = False
- tbrSave.Enabled = True
- tbrDelete.Enabled = False
- tbrPrint.Enabled = True
- tbrExit.Enabled = True
- ElseIf strboolean = "tbrDelete.Enabled = True" Then
- tbrAdd.Enabled = False
- tbrSave.Enabled = True
- tbrModify.Enabled = False
- tbrPrint.Enabled = False
- tbrExit.Enabled = True
- ElseIf strboolean = "tbrDelete.Enabled = False" Then
- tbrDelete.Enabled = False
- tbrAdd.Enabled = False
- tbrSave.Enabled = True
- tbrModify.Enabled = False
- tbrPrint.Enabled = False
- tbrExit.Enabled = True
- End If
- End Sub
- Private Sub cboType_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cboType.SelectedIndexChanged
- Dim cbotext As String = cboType.Text.Substring(0, 3)
- Dim webserver As New jxcmanage
- Dim number As Integer
- number = webserver.maxint(cbotext) + 1
- Dim txtnum As String = cbotext & "-"
- txtNumber.Text = cbotext & "-" & Format(number, "0000")
- End Sub
- Private Sub tbrCp_ButtonClick(ByVal sender As System.Object, ByVal e As System.Windows.Forms.ToolBarButtonClickEventArgs) Handles tbrCp.ButtonClick
- Select Case e.Button.Text
- Case "添加"
- tbnEnable("tbrAdd.Enabled = False", tbrCp)
- add()
- dslocals.Clear()
- dgcp.DataSource = dslocals.Tables("wz_cp").DefaultView
- Case "保存"
- If txtNumber.Text = String.Empty Or txtPrice.Text = "" Or txtSprice.Text = "" Or txtPprice.Text = "" Or txtLprice.Text = "" Or txtjprice.Text = "" Or txtzprice.Text = "" Or txtKl.Text = "" Then
- MessageBox.Show("信息不完整,保存失败!", "提示", MessageBoxButtons.OK)
- Else
- save()
- tbnEnable("tbrSave.Enabled = False", tbrCp)
- End If
- Case "修改"
- modify()
- tbnEnable("tbrModify.Enabled = False", tbrCp)
- Case "删除"
- delete()
- tbnEnable("tbrDelete.Enabled = False", tbrCp)
- Case "打印"
- print()
- Case "退出"
- Me.Close()
- End Select
- End Sub
- Private Sub print()
- If txtQuery.Text = String.Empty Then
- MessageBox.Show("没有要打印的记录!", "提示", MessageBoxButtons.OK)
- Else
- Dim frmviewcper As New frmviewcp
- frmviewcper.strquery = lsweb.getinfoes(txtQuery.Text)
- frmviewcper.Show()
- End If
- End Sub
- Private Sub save()
- dslocals = lsweb.returndataset("select * from wz_cp", "wz_cp")
- Dim dr As DataRow = dslocals.Tables(0).NewRow()
- dr("药品编号") = txtNumber.Text.Trim
- dr("药品名称") = txtName.Text.Trim
- dr("药品规格") = txtRule.Text.Trim
- dr("药品类型") = cboType.Text.Trim
- dr("单位") = txtUnit.Text.Trim
- dr("单价") = txtPrice.Text.Trim
- dr("售价") = txtSprice.Text.Trim
- dr("扣率") = txtKl.Text.Trim
- dr("产地") = txtAddress.Text.Trim
- dr("生产厂家") = txtProduct.Text.Trim
- dr("有效期") = txtAvaid.Text.Trim
- dr("批发价") = txtPprice.Text.Trim
- dr("零售价") = txtLprice.Text.Trim
- dr("建议价") = txtjprice.Text.Trim
- dr("最低价") = txtzprice.Text.Trim
- dr("数量") = 0
- dr("金额") = 0
- dslocals.Tables(0).Rows.Add(dr)
- If lsweb.updatedataset("select * from wz_cp", "wz_cp", dslocals, DataRowState.Added) = True Then
- MessageBox.Show("药品信息成功保存!", "提示", MessageBoxButtons.OK)
- Else
- MessageBox.Show("药品信息保存失败!", "提示", MessageBoxButtons.AbortRetryIgnore)
- End If
- 'lsweb.Dispose()
- End Sub
- Private Sub modify()
- 'Try
- ' Dim STRSQL As String
- ' STRSQL = "update wz_cp set 药品编号='" & txtmednumber.Text.Trim & "',药品名称='" & txtName.Text.Trim & "',药品规格='" & txtRule.Text.Trim & "',药品类型='" & cboType.Text.Trim & "',单位='" & txtUnit.Text.Trim & "',单价=" & CDec(txtPrice.Text.Trim) & ",售价=" & CDec(txtSprice.Text.Trim) & ",扣率='" & txtKl.Text.Trim & "',产地='" & txtAddress.Text.Trim & "',生产厂家='" & txtProduct.Text.Trim & "',登记日期=getdate(),有效期='" & txtAvaid.Text.Trim & "',批发价=" & CDec(txtPprice.Text.Trim) & ",零售价=" & CDec(txtLprice.Text.Trim) & ",建议价=" & CDec(txtjprice.Text.Trim) & ",最低价=" & CDec(txtzprice.Text.Trim) & " where 药品编号='" & txtmednumber.Text.Trim & "'"
- ' lsweb.runSql(STRSQL)
- ' MessageBox.Show("药品信息修改成功!", "提示", MessageBoxButtons.OK)
- ' Catch ex As Exception
- ' MessageBox.Show(ex.Message, "提示", MessageBoxButtons.OK)
- ' End Try
- If lsweb.updatecp(txtmednumber.Text.Trim, txtName.Text.Trim, txtRule.Text.Trim, cboType.Text.Trim, txtUnit.Text.Trim, txtPrice.Text.Trim, txtSprice.Text.Trim, txtKl.Text.Trim, txtAddress.Text.Trim, txtProduct.Text.Trim, txtAvaid.Text.Trim, txtPprice.Text.Trim, txtLprice.Text.Trim, txtjprice.Text.Trim, txtzprice.Text.Trim) = True Then
- MessageBox.Show("药品信息修改成功!", "提示", MessageBoxButtons.OK)
- Else
- MessageBox.Show("药品信息修改失败!", "提示", MessageBoxButtons.OK)
- End If
- End Sub
- Private Sub add()
- txtNumber.Focus()
- txtNumber.Text = "".Trim()
- txtName.Text = "".Trim()
- txtRule.Text = "".Trim()
- cboType.Text = "".Trim()
- txtUnit.Text = "".Trim()
- txtPrice.Text = "".Trim()
- txtSprice.Text = "".Trim()
- txtKl.Text = "".Trim()
- txtAddress.Text = "".Trim()
- txtProduct.Text = "".Trim()
- txtAvaid.Text = "".Trim()
- txtPprice.Text = "".Trim()
- txtLprice.Text = "".Trim()
- txtjprice.Text = "".Trim()
- txtzprice.Text = "".Trim()
- End Sub
- Private Sub btnQuery_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnQuery.Click
- If txtQuery.Text = "" Then
- dslocals = lsweb.returndataset("select * from wz_cp", "wz_cp")
- dgcp.DataSource = dslocals.Tables("wz_cp").DefaultView
- Else
- dslocals = lsweb.returndataset("select * from wz_cp where 药品编号 like'%" & txtQuery.Text.Trim & "%' or 拼音码 like '%" & txtQuery.Text.Trim & "%'", "wz_cp")
- dgcp.DataSource = dslocals.Tables("wz_cp").DefaultView
- End If
- End Sub
- Private Sub delete()
- Dim drv As DataRowView = BindingContext(Me.dgcp.DataSource).Current
- If drv(0) Is System.DBNull.Value Then
- MessageBox.Show("没有要删除的记录!", "提示", MessageBoxButtons.OK)
- Else
- Dim strquery As String = drv(0)
- If lsweb.deletecp(strquery) = True Then
- MessageBox.Show("已经删除记录啦!", "提示", MessageBoxButtons.OK)
- Else
- MessageBox.Show("删除记录失败!", "提示", MessageBoxButtons.OK)
- End If
- End If
- End Sub
- Private Sub view()
- Dim drv As DataRowView = BindingContext(Me.dgcp.DataSource).Current
- Dim dr As DataRow
- dr = drv.Row
- txtmednumber.Text = IIf(dr("药品编号") Is System.DBNull.Value, "", dr("药品编号"))
- txtNumber.Text = IIf(dr("药品编号") Is System.DBNull.Value, "", dr("药品编号"))
- txtName.Text = IIf(dr("药品名称") Is System.DBNull.Value, "", dr("药品名称"))
- txtRule.Text = IIf(dr("药品规格") Is System.DBNull.Value, "", dr("药品规格"))
- cboType.Text = IIf(dr("药品类型") Is System.DBNull.Value, "", dr("药品类型"))
- txtUnit.Text = IIf(dr("单位") Is System.DBNull.Value, "", dr("单位"))
- txtPrice.Text = IIf(dr("单价") Is System.DBNull.Value, 0, dr("单价"))
- txtSprice.Text = IIf(dr("售价") Is System.DBNull.Value, 0, dr("售价"))
- txtKl.Text = IIf(dr("扣率") Is System.DBNull.Value, 0, dr("扣率"))
- txtAddress.Text = IIf(dr("产地") Is System.DBNull.Value, "", dr("产地"))
- txtProduct.Text = IIf(dr("生产厂家") Is System.DBNull.Value, "", dr("生产厂家"))
- txtAvaid.Text = IIf(dr("有效期") Is System.DBNull.Value, "", dr("有效期"))
- txtPprice.Text = IIf(dr("批发价") Is System.DBNull.Value, 0, dr("批发价"))
- txtLprice.Text = IIf(dr("零售价") Is System.DBNull.Value, 0, dr("零售价"))
- txtjprice.Text = IIf(dr("建议价") Is System.DBNull.Value, 0, dr("建议价"))
- txtzprice.Text = IIf(dr("最低价") Is System.DBNull.Value, 0, dr("最低价"))
- End Sub
- Private Sub dgcp_CurrentCellChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles dgcp.CurrentCellChanged
- view()
- tbrModify.Enabled = True
- tbrDelete.Enabled = True
- tbrPrint.Enabled = True
- tbrExit.Enabled = True
- End Sub
- Private Sub txtName_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles txtName.KeyDown
- If e.KeyCode = Keys.Enter Then
- cboType.Focus()
- End If
- End Sub
- Private Sub cboType_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles cboType.KeyDown
- If e.KeyCode = Keys.Enter Then
- txtRule.Focus()
- End If
- End Sub
- Private Sub txtRule_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles txtRule.KeyDown
- If e.KeyCode = Keys.Enter Then
- txtPrice.Focus()
- End If
- End Sub
- Private Sub txtPrice_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles txtPrice.KeyDown
- If e.KeyCode = Keys.Enter Then
- txtSprice.Focus()
- End If
- End Sub
- Private Sub txtSprice_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles txtSprice.KeyDown
- If e.KeyCode = Keys.Enter Then
- txtUnit.Focus()
- End If
- End Sub
- Private Sub txtUnit_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles txtUnit.KeyDown
- If e.KeyCode = Keys.Enter Then
- txtPprice.Focus()
- End If
- End Sub
- Private Sub txtPprice_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles txtPprice.KeyDown
- If e.KeyCode = Keys.Enter Then
- txtLprice.Focus()
- End If
- End Sub
- Private Sub txtLprice_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles txtLprice.KeyDown
- If e.KeyCode = Keys.Enter Then
- txtjprice.Focus()
- End If
- End Sub
- Private Sub txtKl_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles txtKl.KeyDown
- If e.KeyCode = Keys.Enter Then
- txtAvaid.Focus()
- End If
- End Sub
- Private Sub txtAddress_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles txtAddress.KeyDown
- If e.KeyCode = Keys.Enter Then
- txtProduct.Focus()
- End If
- End Sub
- Private Sub txtProduct_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles txtProduct.KeyDown
- If e.KeyCode = Keys.Enter Then
- txtAvaid.Focus()
- End If
- End Sub
- Private Sub txtName_Validating(ByVal sender As Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles txtName.Validating
- If txtName.Text = String.Empty Then
- ErrorProvider1.SetError(txtName, "不能为空,请输入药品名称!")
- txtName.Focus()
- Else
- ErrorProvider1.SetError(txtName, "")
- End If
- End Sub
- Private Sub cboType_Validating(ByVal sender As Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles cboType.Validating
- If cboType.Text = String.Empty Then
- ErrorProvider1.SetError(cboType, "不能为空,请选择列表栏!")
- cboType.Focus()
- Else
- ErrorProvider1.SetError(cboType, "")
- End If
- End Sub
- Private Sub txtRule_Validating(ByVal sender As Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles txtRule.Validating
- If txtRule.Text = String.Empty Then
- ErrorProvider1.SetError(txtRule, "不能为空,请输入药品规格!")
- txtRule.Focus()
- Else
- ErrorProvider1.SetError(txtRule, "")
- End If
- End Sub
- Private Sub txtPrice_Validating(ByVal sender As Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles txtPrice.Validating
- If Not IsNumeric(txtPrice.Text) Or txtPrice.Text = String.Empty Then
- ErrorProvider1.SetError(txtPrice, "不是数值类型且不能为空。")
- txtPrice.Focus()
- Else
- ErrorProvider1.SetError(txtPrice, "")
- End If
- End Sub
- Private Sub txtSprice_Validating(ByVal sender As Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles txtSprice.Validating
- If Not IsNumeric(txtSprice.Text) Or txtSprice.Text = String.Empty Then
- ErrorProvider1.SetError(txtSprice, "不是数值类型且不能为空。")
- txtSprice.Focus()
- Else
- ErrorProvider1.SetError(txtSprice, "")
- End If
- End Sub
- Private Sub txtUnit_Validating(ByVal sender As Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles txtUnit.Validating
- If txtUnit.Text = String.Empty Then
- ErrorProvider1.SetError(txtUnit, "不能为空,请输入单位!")
- txtUnit.Focus()
- Else
- ErrorProvider1.SetError(txtUnit, "")
- End If
- End Sub
- Private Sub txtPprice_Validating(ByVal sender As Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles txtPprice.Validating
- If Not IsNumeric(txtPprice.Text) Or txtPprice.Text = String.Empty Then
- ErrorProvider1.SetError(txtPprice, "不是数值类型且不能为空。")
- txtPprice.Focus()
- Else
- ErrorProvider1.SetError(txtPprice, "")
- End If
- End Sub
- Private Sub txtLprice_Validating(ByVal sender As Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles txtLprice.Validating
- If Not IsNumeric(txtLprice.Text) Or txtLprice.Text = String.Empty Then
- ErrorProvider1.SetError(txtLprice, "不是数值类型且不能为空。")
- txtLprice.Focus()
- Else
- ErrorProvider1.SetError(txtLprice, "")
- End If
- End Sub
- Private Sub txtKl_Validating(ByVal sender As Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles txtKl.Validating
- If Not IsNumeric(txtKl.Text) Or txtKl.Text = String.Empty Then
- ErrorProvider1.SetError(txtKl, "不是数值类型且不能为空。")
- txtKl.Focus()
- Else
- ErrorProvider1.SetError(txtKl, "")
- End If
- End Sub
- Private Sub txtAddress_Validating(ByVal sender As Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles txtAddress.Validating
- If txtAddress.Text = String.Empty Then
- ErrorProvider1.SetError(txtAddress, "不能为空,请输入产地!")
- txtAddress.Focus()
- Else
- ErrorProvider1.SetError(txtAddress, "")
- End If
- End Sub
- Private Sub txtProduct_Validating(ByVal sender As Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles txtProduct.Validating
- If txtProduct.Text = String.Empty Then
- ErrorProvider1.SetError(txtProduct, "不能为空,请输入生产厂家!")
- txtProduct.Focus()
- Else
- ErrorProvider1.SetError(txtProduct, "")
- End If
- End Sub
- Private Sub txtAvaid_Validating(ByVal sender As Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles txtAvaid.Validating
- If txtAvaid.Text = String.Empty Then
- ErrorProvider1.SetError(txtAvaid, "不能为空,请输入有效期!")
- txtAvaid.Focus()
- Else
- ErrorProvider1.SetError(txtAvaid, "")
- End If
- End Sub
- Private Sub txtAvaid_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles txtAvaid.KeyDown
- If e.KeyCode = Keys.Enter Then
- txtAddress.Focus()
- End If
- End Sub
-
- Private Sub txtjprice_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles txtjprice.KeyDown
- If e.KeyCode = Keys.Enter Then
- txtzprice.Focus()
- End If
- End Sub
-
- Private Sub txtzprice_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles txtzprice.KeyDown
- If e.KeyCode = Keys.Enter Then
- txtKl.Focus()
- End If
- End Sub
-
- Private Sub txtjprice_Validating(ByVal sender As Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles txtjprice.Validating
- If Not IsNumeric(txtjprice.Text) Or txtjprice.Text = String.Empty Then
- ErrorProvider1.SetError(txtjprice, "不是数值类型且不能为空。")
- txtjprice.Focus()
- Else
- ErrorProvider1.SetError(txtjprice, "")
- End If
- End Sub
- Private Sub txtzprice_Validating(ByVal sender As Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles txtzprice.Validating
- If Not IsNumeric(txtzprice.Text) Or txtzprice.Text = String.Empty Then
- ErrorProvider1.SetError(txtzprice, "不是数值类型且不能为空。")
- txtzprice.Focus()
- Else
- ErrorProvider1.SetError(txtzprice, "")
- End If
- End Sub
-
- End Class