frmPsManage.vb
上传用户:wj57717022
上传日期:2014-12-16
资源大小:4093k
文件大小:25k
- Public Class frmPsManage
- 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 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 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 tbnAdd As System.Windows.Forms.ToolBarButton
- Friend WithEvents tbnsave As System.Windows.Forms.ToolBarButton
- Friend WithEvents tbndelete As System.Windows.Forms.ToolBarButton
- Friend WithEvents tbnexit As System.Windows.Forms.ToolBarButton
- Friend WithEvents txtMdCount As System.Windows.Forms.TextBox
- Friend WithEvents txtNumber As System.Windows.Forms.TextBox
- Friend WithEvents txtdemo As System.Windows.Forms.TextBox
- Friend WithEvents txtperson As System.Windows.Forms.TextBox
- Friend WithEvents txtAddress As System.Windows.Forms.TextBox
- Friend WithEvents txtFzr As System.Windows.Forms.TextBox
- Friend WithEvents txtTele As System.Windows.Forms.TextBox
- Friend WithEvents txtName As System.Windows.Forms.TextBox
- Friend WithEvents dgview As System.Windows.Forms.DataGrid
- Friend WithEvents txtDate As System.Windows.Forms.DateTimePicker
- Friend WithEvents ErrorProvider1 As System.Windows.Forms.ErrorProvider
- Friend WithEvents tbrps As System.Windows.Forms.ToolBar
- Friend WithEvents tbnmodify As System.Windows.Forms.ToolBarButton
- 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(frmPsManage))
- Me.tbrps = New System.Windows.Forms.ToolBar
- Me.tbnAdd = New System.Windows.Forms.ToolBarButton
- Me.tbnmodify = New System.Windows.Forms.ToolBarButton
- Me.tbnsave = New System.Windows.Forms.ToolBarButton
- Me.tbndelete = New System.Windows.Forms.ToolBarButton
- Me.tbnexit = New System.Windows.Forms.ToolBarButton
- Me.ImageList2 = New System.Windows.Forms.ImageList(Me.components)
- Me.GroupBox1 = New System.Windows.Forms.GroupBox
- Me.txtDate = New System.Windows.Forms.DateTimePicker
- 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.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.txtdemo = New System.Windows.Forms.TextBox
- Me.txtperson = New System.Windows.Forms.TextBox
- Me.txtMdCount = New System.Windows.Forms.TextBox
- Me.txtAddress = New System.Windows.Forms.TextBox
- Me.txtFzr = New System.Windows.Forms.TextBox
- Me.txtTele = New System.Windows.Forms.TextBox
- Me.txtName = New System.Windows.Forms.TextBox
- Me.txtNumber = New System.Windows.Forms.TextBox
- Me.dgview = New System.Windows.Forms.DataGrid
- Me.ErrorProvider1 = New System.Windows.Forms.ErrorProvider
- Me.GroupBox1.SuspendLayout()
- CType(Me.dgview, System.ComponentModel.ISupportInitialize).BeginInit()
- Me.SuspendLayout()
- '
- 'tbrps
- '
- Me.tbrps.Appearance = System.Windows.Forms.ToolBarAppearance.Flat
- Me.tbrps.Buttons.AddRange(New System.Windows.Forms.ToolBarButton() {Me.tbnAdd, Me.tbnmodify, Me.tbnsave, Me.tbndelete, Me.tbnexit})
- Me.tbrps.DropDownArrows = True
- Me.tbrps.ImageList = Me.ImageList2
- Me.tbrps.Location = New System.Drawing.Point(0, 0)
- Me.tbrps.Name = "tbrps"
- Me.tbrps.ShowToolTips = True
- Me.tbrps.Size = New System.Drawing.Size(528, 41)
- Me.tbrps.TabIndex = 0
- '
- 'tbnAdd
- '
- Me.tbnAdd.ImageIndex = 7
- Me.tbnAdd.Text = "添加"
- '
- 'tbnmodify
- '
- Me.tbnmodify.ImageIndex = 5
- Me.tbnmodify.Text = "修改"
- '
- 'tbnsave
- '
- Me.tbnsave.ImageIndex = 4
- Me.tbnsave.Text = "保存"
- '
- 'tbndelete
- '
- Me.tbndelete.ImageIndex = 6
- Me.tbndelete.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
- '
- 'GroupBox1
- '
- Me.GroupBox1.Controls.Add(Me.txtDate)
- 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.Label4)
- Me.GroupBox1.Controls.Add(Me.Label3)
- Me.GroupBox1.Controls.Add(Me.Label2)
- Me.GroupBox1.Controls.Add(Me.Label1)
- Me.GroupBox1.Controls.Add(Me.txtdemo)
- Me.GroupBox1.Controls.Add(Me.txtperson)
- Me.GroupBox1.Controls.Add(Me.txtMdCount)
- Me.GroupBox1.Controls.Add(Me.txtAddress)
- Me.GroupBox1.Controls.Add(Me.txtFzr)
- Me.GroupBox1.Controls.Add(Me.txtTele)
- Me.GroupBox1.Controls.Add(Me.txtName)
- Me.GroupBox1.Controls.Add(Me.txtNumber)
- 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(528, 196)
- Me.GroupBox1.TabIndex = 1
- Me.GroupBox1.TabStop = False
- '
- 'txtDate
- '
- Me.txtDate.Location = New System.Drawing.Point(392, 19)
- Me.txtDate.Name = "txtDate"
- Me.txtDate.Size = New System.Drawing.Size(112, 21)
- Me.txtDate.TabIndex = 22
- '
- 'Label10
- '
- Me.Label10.AutoSize = True
- Me.Label10.Location = New System.Drawing.Point(18, 144)
- Me.Label10.Name = "Label10"
- Me.Label10.Size = New System.Drawing.Size(42, 17)
- Me.Label10.TabIndex = 21
- Me.Label10.Text = "备注:"
- Me.Label10.TextAlign = System.Drawing.ContentAlignment.MiddleRight
- '
- 'Label9
- '
- Me.Label9.AutoSize = True
- Me.Label9.Location = New System.Drawing.Point(18, 112)
- Me.Label9.Name = "Label9"
- Me.Label9.Size = New System.Drawing.Size(42, 17)
- Me.Label9.TabIndex = 20
- Me.Label9.Text = "地址:"
- Me.Label9.TextAlign = System.Drawing.ContentAlignment.MiddleRight
- '
- 'Label8
- '
- Me.Label8.AutoSize = True
- Me.Label8.Location = New System.Drawing.Point(6, 80)
- Me.Label8.Name = "Label8"
- Me.Label8.Size = New System.Drawing.Size(54, 17)
- Me.Label8.TabIndex = 19
- Me.Label8.Text = "负责人:"
- Me.Label8.TextAlign = System.Drawing.ContentAlignment.MiddleRight
- '
- 'Label7
- '
- Me.Label7.AutoSize = True
- Me.Label7.Location = New System.Drawing.Point(162, 80)
- Me.Label7.Name = "Label7"
- Me.Label7.Size = New System.Drawing.Size(66, 17)
- Me.Label7.TabIndex = 18
- Me.Label7.Text = "联系电话:"
- Me.Label7.TextAlign = System.Drawing.ContentAlignment.MiddleRight
- '
- 'Label6
- '
- Me.Label6.AutoSize = True
- Me.Label6.Location = New System.Drawing.Point(328, 19)
- Me.Label6.Name = "Label6"
- Me.Label6.Size = New System.Drawing.Size(66, 17)
- Me.Label6.TabIndex = 17
- Me.Label6.Text = "创建时间:"
- Me.Label6.TextAlign = System.Drawing.ContentAlignment.MiddleRight
- '
- 'Label4
- '
- Me.Label4.AutoSize = True
- Me.Label4.Location = New System.Drawing.Point(336, 48)
- Me.Label4.Name = "Label4"
- Me.Label4.Size = New System.Drawing.Size(54, 17)
- Me.Label4.TabIndex = 15
- Me.Label4.Text = "创建者:"
- Me.Label4.TextAlign = System.Drawing.ContentAlignment.MiddleRight
- '
- 'Label3
- '
- Me.Label3.AutoSize = True
- Me.Label3.Location = New System.Drawing.Point(18, 48)
- Me.Label3.Name = "Label3"
- Me.Label3.Size = New System.Drawing.Size(42, 17)
- Me.Label3.TabIndex = 14
- Me.Label3.Text = "名称:"
- '
- 'Label2
- '
- Me.Label2.AutoSize = True
- Me.Label2.Location = New System.Drawing.Point(162, 19)
- Me.Label2.Name = "Label2"
- Me.Label2.Size = New System.Drawing.Size(66, 17)
- Me.Label2.TabIndex = 13
- Me.Label2.Text = "门店总数:"
- Me.Label2.TextAlign = System.Drawing.ContentAlignment.MiddleRight
- '
- 'Label1
- '
- Me.Label1.AutoSize = True
- Me.Label1.Location = New System.Drawing.Point(18, 19)
- Me.Label1.Name = "Label1"
- Me.Label1.Size = New System.Drawing.Size(42, 17)
- Me.Label1.TabIndex = 12
- Me.Label1.Text = "编号:"
- Me.Label1.TextAlign = System.Drawing.ContentAlignment.MiddleRight
- '
- 'txtdemo
- '
- Me.txtdemo.Location = New System.Drawing.Point(60, 144)
- Me.txtdemo.Multiline = True
- Me.txtdemo.Name = "txtdemo"
- Me.txtdemo.Size = New System.Drawing.Size(444, 44)
- Me.txtdemo.TabIndex = 9
- Me.txtdemo.Text = ""
- '
- 'txtperson
- '
- Me.txtperson.Location = New System.Drawing.Point(392, 48)
- Me.txtperson.Name = "txtperson"
- Me.txtperson.Size = New System.Drawing.Size(112, 21)
- Me.txtperson.TabIndex = 7
- Me.txtperson.Text = ""
- '
- 'txtMdCount
- '
- Me.txtMdCount.Location = New System.Drawing.Point(228, 19)
- Me.txtMdCount.Name = "txtMdCount"
- Me.txtMdCount.Size = New System.Drawing.Size(90, 21)
- Me.txtMdCount.TabIndex = 6
- Me.txtMdCount.Text = ""
- '
- 'txtAddress
- '
- Me.txtAddress.Location = New System.Drawing.Point(60, 112)
- Me.txtAddress.Name = "txtAddress"
- Me.txtAddress.Size = New System.Drawing.Size(444, 21)
- Me.txtAddress.TabIndex = 5
- Me.txtAddress.Text = ""
- '
- 'txtFzr
- '
- Me.txtFzr.Location = New System.Drawing.Point(60, 80)
- Me.txtFzr.Name = "txtFzr"
- Me.txtFzr.Size = New System.Drawing.Size(75, 21)
- Me.txtFzr.TabIndex = 4
- Me.txtFzr.Text = ""
- '
- 'txtTele
- '
- Me.txtTele.Location = New System.Drawing.Point(228, 80)
- Me.txtTele.Name = "txtTele"
- Me.txtTele.Size = New System.Drawing.Size(90, 21)
- Me.txtTele.TabIndex = 3
- Me.txtTele.Text = ""
- '
- 'txtName
- '
- Me.txtName.Location = New System.Drawing.Point(60, 48)
- Me.txtName.Name = "txtName"
- Me.txtName.Size = New System.Drawing.Size(258, 21)
- Me.txtName.TabIndex = 1
- Me.txtName.Text = ""
- '
- 'txtNumber
- '
- Me.txtNumber.Location = New System.Drawing.Point(60, 19)
- Me.txtNumber.Name = "txtNumber"
- Me.txtNumber.Size = New System.Drawing.Size(75, 21)
- Me.txtNumber.TabIndex = 0
- Me.txtNumber.Text = ""
- '
- '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, 237)
- Me.dgview.Name = "dgview"
- Me.dgview.Size = New System.Drawing.Size(528, 246)
- Me.dgview.TabIndex = 2
- '
- 'ErrorProvider1
- '
- Me.ErrorProvider1.ContainerControl = Me
- '
- 'frmPsManage
- '
- Me.AutoScaleBaseSize = New System.Drawing.Size(6, 14)
- Me.ClientSize = New System.Drawing.Size(528, 483)
- Me.Controls.Add(Me.dgview)
- Me.Controls.Add(Me.GroupBox1)
- Me.Controls.Add(Me.tbrps)
- Me.Name = "frmPsManage"
- Me.Text = "配送中心登记"
- Me.WindowState = System.Windows.Forms.FormWindowState.Maximized
- Me.GroupBox1.ResumeLayout(False)
- CType(Me.dgview, System.ComponentModel.ISupportInitialize).EndInit()
- Me.ResumeLayout(False)
- End Sub
- #End Region
- Public lsweb As New jxcmanage
- Public dslocals As DataSet = lsweb.returndataset("select Number as 编号,CName as 名称,mdcount as 门店个数,startTime as 日期,cjz as 创建者,fzr as 负责人,Telephone as 电话,Address as 地址,demo as 备注 from pscenter", "pscenter")
- Public Sub tbnEnable(ByVal strboolean As String, ByVal tbr As ToolBar)
- If strboolean = "tbnAdd.Enabled = True" Then
- tbnsave.Enabled = False
- tbnModify.Enabled = False
- tbndelete.Enabled = False
- tbnexit.Enabled = True
- ElseIf strboolean = "tbnAdd.Enabled = False" Then
- tbnAdd.Enabled = False
- tbnsave.Enabled = True
- tbnModify.Enabled = False
- tbndelete.Enabled = False
- tbnexit.Enabled = True
- ElseIf strboolean = "tbnSave.Enabled = True" Then
- tbnAdd.Enabled = False
- tbnmodify.Enabled = False
- tbndelete.Enabled = False
- tbnexit.Enabled = True
- ElseIf strboolean = "tbnSave.Enabled = False" Then
- tbnsave.Enabled = False
- tbnAdd.Enabled = True
- tbnmodify.Enabled = True
- tbndelete.Enabled = True
- tbnexit.Enabled = True
- ElseIf strboolean = "tbnModify.Enabled = True" Then
- tbnAdd.Enabled = False
- tbnsave.Enabled = True
- tbndelete.Enabled = False
- tbnexit.Enabled = True
- ElseIf strboolean = "tbnModify.Enabled = False" Then
- tbnmodify.Enabled = False
- tbnAdd.Enabled = True
- tbnsave.Enabled = False
- tbndelete.Enabled = False
- tbnexit.Enabled = True
- ElseIf strboolean = "tbnDelete.Enabled = True" Then
- tbnAdd.Enabled = False
- tbnsave.Enabled = True
- tbnmodify.Enabled = False
- tbnexit.Enabled = True
- ElseIf strboolean = "tbnDelete.Enabled = False" Then
- tbndelete.Enabled = False
- tbnAdd.Enabled = False
- tbnsave.Enabled = True
- tbnmodify.Enabled = False
- tbnexit.Enabled = True
- End If
- End Sub
- Public Sub add()
- dslocals.Clear()
- txtNumber.Text = ""
- txtNumber.Focus()
- txtName.Text = ""
- txtMdCount.Text = ""
- txtDate.Text = ""
- txtperson.Text = ""
- txtFzr.Text = ""
- txtTele.Text = ""
- txtAddress.Text = ""
- txtdemo.Text = ""
- End Sub
- Private Sub frmPsManage_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
- 'dslocals.Clear()
- dgview.DataSource = dslocals.Tables("pscenter").DefaultView
- txtDate.Value = Today.ToString
- End Sub
- Private Sub Modified()
- If lsweb.updatedataset("select Number as 编号,CName as 名称,mdcount as 门店个数,startTime as 日期,cjz as 创建者,fzr as 负责人,Telephone as 电话,Address as 地址,demo as 备注 from pscenter", "pscenter", dslocals, DataRowState.Modified) = 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 tbrps.ButtonClick
- Select Case e.Button.Text
- Case "添加"
- add()
- tbnEnable("tbnAdd.Enabled = False", tbrps)
- Case "保存"
- If txtNumber.Text = "" Or txtName.Text = "" Or txtMdCount.Text = "" Then
- MessageBox.Show("信息不完整,保存失败!", "提示", MessageBoxButtons.OK)
- Else
- Dim dr As DataRow = dslocals.Tables("pscenter").NewRow()
- dr("编号") = Me.txtNumber.Text.Trim
- dr("名称") = Me.txtName.Text.Trim
- dr("门店个数") = Me.txtMdCount.Text.Trim
- dr("日期") = Me.txtDate.Text.Trim
- dr("创建者") = Me.txtperson.Text.Trim
- dr("负责人") = Me.txtFzr.Text.Trim
- dr("电话") = Me.txtTele.Text.Trim
- dr("地址") = Me.txtAddress.Text.Trim
- dr("备注") = Me.txtdemo.Text.Trim
- dslocals.Tables("pscenter").Rows.Add(dr)
- If lsweb.updatedataset("select Number as 编号,CName as 名称,mdcount as 门店个数,startTime as 日期,cjz as 创建者,fzr as 负责人,Telephone as 电话,Address as 地址,demo as 备注 from pscenter", "pscenter", dslocals, DataRowState.Added) = True Then
- MessageBox.Show("信息成功保存!", "提示", MessageBoxButtons.OK)
- Else
- MessageBox.Show("信息保存失败!", "提示", MessageBoxButtons.AbortRetryIgnore)
- End If
- tbnEnable("tbnSave.Enabled = False", tbrps)
- End If
- Case "修改"
- Modified()
- tbnEnable("tbnModify.Enabled = False", tbrps)
- Case "删除"
- delete()
- tbnEnable("tbnDelete.Enabled = False", tbrps)
- Case "退出"
- Me.Close()
- End Select
- End Sub
- Private Sub view()
- Dim drv As DataRowView = BindingContext(Me.dgview.DataSource).Current
- Dim dr As DataRow
- dr = drv.Row
- txtNumber.Text = IIf(dr("编号") Is System.DBNull.Value, "", dr("编号"))
- txtName.Text = IIf(dr("名称") Is System.DBNull.Value, "", dr("名称"))
- txtMdCount.Text = IIf(dr("门店个数") Is System.DBNull.Value, "", dr("门店个数"))
- txtDate.Text = IIf(dr("日期") Is System.DBNull.Value, "", dr("日期"))
- txtperson.Text = IIf(dr("创建者") Is System.DBNull.Value, "", dr("创建者"))
- txtFzr.Text = IIf(dr("负责人") Is System.DBNull.Value, 0, dr("负责人"))
- txtTele.Text = IIf(dr("电话") Is System.DBNull.Value, 0, dr("电话"))
- txtAddress.Text = IIf(dr("地址") Is System.DBNull.Value, 0, dr("地址"))
- txtdemo.Text = IIf(dr("备注") Is System.DBNull.Value, "", dr("备注"))
- End Sub
- Private Sub delete()
- Dim drv As DataRowView = BindingContext(Me.dgview.DataSource).Current
- If drv(0) Is System.DBNull.Value Then
- MessageBox.Show("没有要删除的记录!", "提示", MessageBoxButtons.OK)
- Else
- Dim strquery As String = drv(0)
- If lsweb.deletepscenter(strquery) = True Then
- MessageBox.Show("已经删除记录啦!", "提示", MessageBoxButtons.OK)
- Else
- MessageBox.Show("删除记录失败!", "提示", MessageBoxButtons.OK)
- End If
- End If
- End Sub
- Private Sub txtNumber_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles txtNumber.KeyDown
- If e.KeyCode = Keys.Enter Then
- txtMdCount.Focus()
- End If
- End Sub
-
- Private Sub txtMdCount_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles txtMdCount.KeyDown
- If e.KeyCode = Keys.Enter Then
- txtDate.Focus()
- End If
- End Sub
-
- Private Sub txtDate_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles txtDate.KeyDown
- If e.KeyCode = Keys.Enter Then
- txtName.Focus()
- End If
- 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
- txtperson.Focus()
- End If
- End Sub
-
- Private Sub txtperson_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles txtperson.KeyDown
- If e.KeyCode = Keys.Enter Then
- txtFzr.Focus()
- End If
- End Sub
-
- Private Sub txtFzr_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles txtFzr.KeyDown
- If e.KeyCode = Keys.Enter Then
- txtTele.Focus()
- End If
- End Sub
-
- Private Sub txtTele_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles txtTele.KeyDown
- If e.KeyCode = Keys.Enter Then
- txtAddress.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
- txtdemo.Focus()
- End If
- End Sub
- Private Sub txtNumber_Validating(ByVal sender As Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles txtNumber.Validating
- If txtNumber.Text = String.Empty Then
- ErrorProvider1.SetError(txtNumber, "不能为空。")
- txtNumber.Focus()
- Else
- ErrorProvider1.SetError(txtNumber, "")
- End If
- End Sub
- Private Sub txtMdCount_Validating(ByVal sender As Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles txtMdCount.Validating
- If txtMdCount.Text = String.Empty Or Not IsNumeric(txtMdCount.Text) Then
- ErrorProvider1.SetError(txtMdCount, "不能为空且为数值类型!")
- txtMdCount.Focus()
- Else
- ErrorProvider1.SetError(txtMdCount, "")
- 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 txtperson_Validating(ByVal sender As Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles txtperson.Validating
- If txtperson.Text = String.Empty Then
- ErrorProvider1.SetError(txtperson, "不能为空。")
- txtperson.Focus()
- Else
- ErrorProvider1.SetError(txtperson, "")
- End If
- End Sub
- Private Sub txtFzr_Validating(ByVal sender As Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles txtFzr.Validating
- If txtFzr.Text = String.Empty Then
- ErrorProvider1.SetError(txtFzr, "不能为空。")
- txtFzr.Focus()
- Else
- ErrorProvider1.SetError(txtFzr, "")
- End If
- End Sub
- Private Sub txtTele_Validating(ByVal sender As Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles txtTele.Validating
- If txtTele.Text = String.Empty Then
- ErrorProvider1.SetError(txtTele, "不能为空。")
- txtTele.Focus()
- Else
- ErrorProvider1.SetError(txtTele, "")
- 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 dgview_CurrentCellChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles dgview.CurrentCellChanged
- view()
- End Sub
- Private Sub txtMdCount_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles txtMdCount.TextChanged
- End Sub
- End Class