frmMdManage.vb
上传用户:wj57717022
上传日期:2014-12-16
资源大小:4093k
文件大小:37k
- Public Class frmMdManage
- 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 tbnAdd As System.Windows.Forms.ToolBarButton
- Friend WithEvents tbnSave As System.Windows.Forms.ToolBarButton
- Friend WithEvents tbnModify As System.Windows.Forms.ToolBarButton
- Friend WithEvents tbndelete As System.Windows.Forms.ToolBarButton
- Friend WithEvents tbnexit As System.Windows.Forms.ToolBarButton
- Friend WithEvents ErrorProvider1 As System.Windows.Forms.ErrorProvider
- Friend WithEvents GroupBox1 As System.Windows.Forms.GroupBox
- Friend WithEvents txttax As System.Windows.Forms.TextBox
- Friend WithEvents txtfzr As System.Windows.Forms.TextBox
- Friend WithEvents txtdate As System.Windows.Forms.DateTimePicker
- Friend WithEvents Label17 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 Label10 As System.Windows.Forms.Label
- Friend WithEvents Label9 As System.Windows.Forms.Label
- Friend WithEvents Label7 As System.Windows.Forms.Label
- Friend WithEvents Label6 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 Panel1 As System.Windows.Forms.Panel
- Friend WithEvents dgview As System.Windows.Forms.DataGrid
- Friend WithEvents tbnmd As System.Windows.Forms.ToolBar
- Friend WithEvents ImageList2 As System.Windows.Forms.ImageList
- Friend WithEvents txtprice As System.Windows.Forms.TextBox
- Friend WithEvents txtjs As System.Windows.Forms.TextBox
- Friend WithEvents txtys As System.Windows.Forms.TextBox
- Friend WithEvents txtpym As System.Windows.Forms.TextBox
- Friend WithEvents txtcjz As System.Windows.Forms.TextBox
- Friend WithEvents txtarea As System.Windows.Forms.TextBox
- Friend WithEvents txttele As System.Windows.Forms.TextBox
- Friend WithEvents txtnumber As System.Windows.Forms.TextBox
- Friend WithEvents txtname As System.Windows.Forms.TextBox
- Friend WithEvents txtdemo As System.Windows.Forms.TextBox
- <System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
- Me.components = New System.ComponentModel.Container
- Dim resources As System.Resources.ResourceManager = New System.Resources.ResourceManager(GetType(frmMdManage))
- Me.tbnmd = New System.Windows.Forms.ToolBar
- Me.tbnAdd = New System.Windows.Forms.ToolBarButton
- Me.tbnSave = New System.Windows.Forms.ToolBarButton
- Me.tbnModify = 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.ErrorProvider1 = New System.Windows.Forms.ErrorProvider
- Me.GroupBox1 = New System.Windows.Forms.GroupBox
- Me.txtdemo = New System.Windows.Forms.TextBox
- Me.txtname = New System.Windows.Forms.TextBox
- Me.txtnumber = New System.Windows.Forms.TextBox
- Me.txttele = New System.Windows.Forms.TextBox
- Me.txtarea = New System.Windows.Forms.TextBox
- Me.txtcjz = New System.Windows.Forms.TextBox
- Me.txtpym = New System.Windows.Forms.TextBox
- Me.txtys = New System.Windows.Forms.TextBox
- Me.txtjs = New System.Windows.Forms.TextBox
- Me.txtprice = New System.Windows.Forms.TextBox
- Me.txttax = New System.Windows.Forms.TextBox
- Me.txtfzr = New System.Windows.Forms.TextBox
- Me.txtdate = New System.Windows.Forms.DateTimePicker
- Me.Label17 = 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.Label12 = New System.Windows.Forms.Label
- Me.Label10 = New System.Windows.Forms.Label
- Me.Label9 = 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.Panel1 = New System.Windows.Forms.Panel
- Me.dgview = New System.Windows.Forms.DataGrid
- Me.GroupBox1.SuspendLayout()
- Me.Panel1.SuspendLayout()
- CType(Me.dgview, System.ComponentModel.ISupportInitialize).BeginInit()
- Me.SuspendLayout()
- '
- 'tbnmd
- '
- Me.tbnmd.Appearance = System.Windows.Forms.ToolBarAppearance.Flat
- Me.tbnmd.Buttons.AddRange(New System.Windows.Forms.ToolBarButton() {Me.tbnAdd, Me.tbnSave, Me.tbnModify, Me.tbndelete, Me.tbnexit})
- Me.tbnmd.DropDownArrows = True
- Me.tbnmd.ImageList = Me.ImageList2
- Me.tbnmd.Location = New System.Drawing.Point(0, 0)
- Me.tbnmd.Name = "tbnmd"
- Me.tbnmd.ShowToolTips = True
- Me.tbnmd.Size = New System.Drawing.Size(520, 41)
- Me.tbnmd.TabIndex = 1
- '
- 'tbnAdd
- '
- Me.tbnAdd.ImageIndex = 7
- Me.tbnAdd.Text = "添加"
- '
- 'tbnSave
- '
- Me.tbnSave.ImageIndex = 4
- Me.tbnSave.Text = "保存"
- '
- 'tbnModify
- '
- Me.tbnModify.ImageIndex = 5
- Me.tbnModify.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
- '
- 'ErrorProvider1
- '
- Me.ErrorProvider1.ContainerControl = Me
- '
- 'GroupBox1
- '
- Me.GroupBox1.Controls.Add(Me.txtdemo)
- Me.GroupBox1.Controls.Add(Me.txtname)
- Me.GroupBox1.Controls.Add(Me.txtnumber)
- Me.GroupBox1.Controls.Add(Me.txttele)
- Me.GroupBox1.Controls.Add(Me.txtarea)
- Me.GroupBox1.Controls.Add(Me.txtcjz)
- Me.GroupBox1.Controls.Add(Me.txtpym)
- Me.GroupBox1.Controls.Add(Me.txtys)
- Me.GroupBox1.Controls.Add(Me.txtjs)
- Me.GroupBox1.Controls.Add(Me.txtprice)
- Me.GroupBox1.Controls.Add(Me.txttax)
- Me.GroupBox1.Controls.Add(Me.txtfzr)
- Me.GroupBox1.Controls.Add(Me.txtdate)
- Me.GroupBox1.Controls.Add(Me.Label17)
- Me.GroupBox1.Controls.Add(Me.Label15)
- Me.GroupBox1.Controls.Add(Me.Label14)
- Me.GroupBox1.Controls.Add(Me.Label13)
- Me.GroupBox1.Controls.Add(Me.Label12)
- Me.GroupBox1.Controls.Add(Me.Label10)
- Me.GroupBox1.Controls.Add(Me.Label9)
- 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.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(520, 191)
- Me.GroupBox1.TabIndex = 3
- Me.GroupBox1.TabStop = False
- '
- 'txtdemo
- '
- Me.txtdemo.Location = New System.Drawing.Point(54, 149)
- Me.txtdemo.Name = "txtdemo"
- Me.txtdemo.Size = New System.Drawing.Size(288, 21)
- Me.txtdemo.TabIndex = 73
- Me.txtdemo.Text = ""
- '
- 'txtname
- '
- Me.txtname.Location = New System.Drawing.Point(54, 56)
- Me.txtname.Name = "txtname"
- Me.txtname.Size = New System.Drawing.Size(96, 21)
- Me.txtname.TabIndex = 72
- Me.txtname.Text = ""
- '
- 'txtnumber
- '
- Me.txtnumber.Location = New System.Drawing.Point(54, 25)
- Me.txtnumber.Name = "txtnumber"
- Me.txtnumber.Size = New System.Drawing.Size(96, 21)
- Me.txtnumber.TabIndex = 71
- Me.txtnumber.Text = ""
- '
- 'txttele
- '
- Me.txttele.Location = New System.Drawing.Point(54, 118)
- Me.txttele.Name = "txttele"
- Me.txttele.Size = New System.Drawing.Size(96, 21)
- Me.txttele.TabIndex = 70
- Me.txttele.Text = ""
- '
- 'txtarea
- '
- Me.txtarea.Location = New System.Drawing.Point(240, 25)
- Me.txtarea.Name = "txtarea"
- Me.txtarea.Size = New System.Drawing.Size(75, 21)
- Me.txtarea.TabIndex = 69
- Me.txtarea.Text = ""
- '
- 'txtcjz
- '
- Me.txtcjz.Location = New System.Drawing.Point(240, 56)
- Me.txtcjz.Name = "txtcjz"
- Me.txtcjz.Size = New System.Drawing.Size(75, 21)
- Me.txtcjz.TabIndex = 68
- Me.txtcjz.Text = ""
- '
- 'txtpym
- '
- Me.txtpym.Location = New System.Drawing.Point(54, 87)
- Me.txtpym.Name = "txtpym"
- Me.txtpym.ReadOnly = True
- Me.txtpym.Size = New System.Drawing.Size(96, 21)
- Me.txtpym.TabIndex = 67
- Me.txtpym.Text = ""
- '
- 'txtys
- '
- Me.txtys.Location = New System.Drawing.Point(432, 87)
- Me.txtys.Name = "txtys"
- Me.txtys.Size = New System.Drawing.Size(75, 21)
- Me.txtys.TabIndex = 66
- Me.txtys.Text = ""
- '
- 'txtjs
- '
- Me.txtjs.Location = New System.Drawing.Point(432, 56)
- Me.txtjs.Name = "txtjs"
- Me.txtjs.Size = New System.Drawing.Size(75, 21)
- Me.txtjs.TabIndex = 65
- Me.txtjs.Text = ""
- '
- 'txtprice
- '
- Me.txtprice.Location = New System.Drawing.Point(432, 25)
- Me.txtprice.Name = "txtprice"
- Me.txtprice.Size = New System.Drawing.Size(75, 21)
- Me.txtprice.TabIndex = 64
- Me.txtprice.Text = ""
- '
- 'txttax
- '
- Me.txttax.Location = New System.Drawing.Point(240, 120)
- Me.txttax.Name = "txttax"
- Me.txttax.Size = New System.Drawing.Size(102, 21)
- Me.txttax.TabIndex = 63
- Me.txttax.Text = ""
- '
- 'txtfzr
- '
- Me.txtfzr.Location = New System.Drawing.Point(432, 118)
- Me.txtfzr.Name = "txtfzr"
- Me.txtfzr.Size = New System.Drawing.Size(75, 21)
- Me.txtfzr.TabIndex = 62
- Me.txtfzr.Text = ""
- '
- 'txtdate
- '
- Me.txtdate.Location = New System.Drawing.Point(240, 88)
- Me.txtdate.Name = "txtdate"
- Me.txtdate.Size = New System.Drawing.Size(102, 21)
- Me.txtdate.TabIndex = 61
- '
- 'Label17
- '
- Me.Label17.AutoSize = True
- Me.Label17.Location = New System.Drawing.Point(23, 156)
- Me.Label17.Name = "Label17"
- Me.Label17.Size = New System.Drawing.Size(42, 17)
- Me.Label17.TabIndex = 60
- Me.Label17.Text = "备注:"
- Me.Label17.TextAlign = System.Drawing.ContentAlignment.MiddleRight
- '
- 'Label15
- '
- Me.Label15.AutoSize = True
- Me.Label15.Location = New System.Drawing.Point(390, 128)
- Me.Label15.Name = "Label15"
- Me.Label15.Size = New System.Drawing.Size(54, 17)
- Me.Label15.TabIndex = 59
- Me.Label15.Text = "负责人:"
- '
- 'Label14
- '
- Me.Label14.AutoSize = True
- Me.Label14.Location = New System.Drawing.Point(376, 96)
- Me.Label14.Name = "Label14"
- Me.Label14.Size = New System.Drawing.Size(66, 17)
- Me.Label14.TabIndex = 58
- Me.Label14.Text = "运输方式:"
- Me.Label14.TextAlign = System.Drawing.ContentAlignment.MiddleRight
- '
- 'Label13
- '
- Me.Label13.AutoSize = True
- Me.Label13.Location = New System.Drawing.Point(210, 128)
- Me.Label13.Name = "Label13"
- Me.Label13.Size = New System.Drawing.Size(42, 17)
- Me.Label13.TabIndex = 57
- Me.Label13.Text = "传真:"
- '
- 'Label12
- '
- Me.Label12.AutoSize = True
- Me.Label12.Location = New System.Drawing.Point(185, 96)
- Me.Label12.Name = "Label12"
- Me.Label12.Size = New System.Drawing.Size(66, 17)
- Me.Label12.TabIndex = 56
- Me.Label12.Text = "创建时间:"
- Me.Label12.TextAlign = System.Drawing.ContentAlignment.MiddleRight
- '
- 'Label10
- '
- Me.Label10.AutoSize = True
- Me.Label10.Location = New System.Drawing.Point(24, 128)
- Me.Label10.Name = "Label10"
- Me.Label10.Size = New System.Drawing.Size(42, 17)
- Me.Label10.TabIndex = 55
- Me.Label10.Text = "电话:"
- '
- 'Label9
- '
- Me.Label9.AutoSize = True
- Me.Label9.Location = New System.Drawing.Point(197, 64)
- Me.Label9.Name = "Label9"
- Me.Label9.Size = New System.Drawing.Size(54, 17)
- Me.Label9.TabIndex = 54
- Me.Label9.Text = "创建者:"
- Me.Label9.TextAlign = System.Drawing.ContentAlignment.MiddleRight
- '
- 'Label7
- '
- Me.Label7.AutoSize = True
- Me.Label7.Location = New System.Drawing.Point(12, 96)
- Me.Label7.Name = "Label7"
- Me.Label7.Size = New System.Drawing.Size(54, 17)
- Me.Label7.TabIndex = 53
- Me.Label7.Text = "拼音码:"
- '
- 'Label6
- '
- Me.Label6.AutoSize = True
- Me.Label6.Location = New System.Drawing.Point(376, 64)
- Me.Label6.Name = "Label6"
- Me.Label6.Size = New System.Drawing.Size(66, 17)
- Me.Label6.TabIndex = 52
- Me.Label6.Text = "结算方式:"
- Me.Label6.TextAlign = System.Drawing.ContentAlignment.MiddleRight
- '
- 'Label4
- '
- Me.Label4.AutoSize = True
- Me.Label4.Location = New System.Drawing.Point(24, 64)
- Me.Label4.Name = "Label4"
- Me.Label4.Size = New System.Drawing.Size(42, 17)
- Me.Label4.TabIndex = 51
- Me.Label4.Text = "名称:"
- '
- 'Label3
- '
- Me.Label3.AutoSize = True
- Me.Label3.Location = New System.Drawing.Point(376, 31)
- Me.Label3.Name = "Label3"
- Me.Label3.Size = New System.Drawing.Size(66, 17)
- Me.Label3.TabIndex = 50
- Me.Label3.Text = "价格方案:"
- Me.Label3.TextAlign = System.Drawing.ContentAlignment.MiddleRight
- '
- 'Label2
- '
- Me.Label2.AutoSize = True
- Me.Label2.Location = New System.Drawing.Point(185, 31)
- Me.Label2.Name = "Label2"
- Me.Label2.Size = New System.Drawing.Size(66, 17)
- Me.Label2.TabIndex = 49
- Me.Label2.Text = "营业面积:"
- Me.Label2.TextAlign = System.Drawing.ContentAlignment.MiddleRight
- '
- 'Label1
- '
- Me.Label1.AutoSize = True
- Me.Label1.Location = New System.Drawing.Point(24, 31)
- Me.Label1.Name = "Label1"
- Me.Label1.Size = New System.Drawing.Size(42, 17)
- Me.Label1.TabIndex = 48
- Me.Label1.Text = "编号:"
- '
- 'Panel1
- '
- Me.Panel1.Controls.Add(Me.dgview)
- Me.Panel1.Dock = System.Windows.Forms.DockStyle.Fill
- Me.Panel1.Location = New System.Drawing.Point(0, 232)
- Me.Panel1.Name = "Panel1"
- Me.Panel1.Size = New System.Drawing.Size(520, 244)
- Me.Panel1.TabIndex = 4
- '
- '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, 0)
- Me.dgview.Name = "dgview"
- Me.dgview.Size = New System.Drawing.Size(520, 244)
- Me.dgview.TabIndex = 2
- '
- 'frmMdManage
- '
- Me.AutoScaleBaseSize = New System.Drawing.Size(6, 14)
- Me.ClientSize = New System.Drawing.Size(520, 476)
- Me.Controls.Add(Me.Panel1)
- Me.Controls.Add(Me.GroupBox1)
- Me.Controls.Add(Me.tbnmd)
- Me.Name = "frmMdManage"
- Me.Text = "门店名称登记"
- Me.WindowState = System.Windows.Forms.FormWindowState.Maximized
- Me.GroupBox1.ResumeLayout(False)
- Me.Panel1.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 名称,Telephone as 电话,Tax as 传真,Yarea as 营业面积,PriceFa as 价格方案,Phxs as 运输方式,Js as 结算方式,cDate as 创建日期,Fzr as 负责人,cjr as 创建人,Demo as 备注 from MdManager", "MdManager")
- Public Sub add()
- ' dslocals.Clear()
- txtnumber.Text = ""
- txtNumber.Focus()
- txtarea.Text = ""
- txtName.Text = ""
- txttax.Text = ""
- txtDate.Text = ""
- txtcjz.Text = ""
- txtFzr.Text = ""
- txtTele.Text = ""
- txtys.Text = ""
- txtdemo.Text = ""
- txtjs.Text = ""
- txtprice.Text = ""
- End Sub
- Private Sub frmMdManage_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
- dslocals.Clear()
- dgview.DataSource = dslocals.Tables(0).DefaultView
- txtdate.Value = Today.ToString
- End Sub
- 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
- Private Sub Modified()
- If lsweb.updatedataset("select Number as 编号,Cname as 名称,Telephone as 电话,Tax as 传真,Yarea as 营业面积,PriceFa as 价格方案,Phxs as 运输方式,Js as 结算方式,cDate as 创建日期,Fzr as 负责人,cjr as 创建人,Demo as 备注 from MdManager", "MdManager", dslocals, DataRowState.Modified) = True Then
- MessageBox.Show("药品信息成功保存!", "提示", MessageBoxButtons.OK)
- Else
- MessageBox.Show("药品信息保存失败!", "提示", MessageBoxButtons.AbortRetryIgnore)
- End If
- 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("名称"))
- txtarea.Text = IIf(dr("营业面积") Is System.DBNull.Value, "", dr("营业面积"))
- txtprice.Text = IIf(dr("价格方案") Is System.DBNull.Value, "", dr("价格方案"))
- txtys.Text = IIf(dr("运输方式") Is System.DBNull.Value, "", dr("运输方式"))
- txtjs.Text = IIf(dr("结算方式") Is System.DBNull.Value, "", dr("结算方式"))
- txtdate.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("电话"))
- txttax.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.deleteMdManager(strquery) = True Then
- MessageBox.Show("已经删除记录啦!", "提示", MessageBoxButtons.OK)
- Else
- MessageBox.Show("删除记录失败!", "提示", MessageBoxButtons.OK)
- End If
- End If
- End Sub
- Private Sub ToolBar2_ButtonClick(ByVal sender As System.Object, ByVal e As System.Windows.Forms.ToolBarButtonClickEventArgs) Handles tbnmd.ButtonClick
- Select Case e.Button.Text
- Case "添加"
- add()
- tbnEnable("tbnAdd.Enabled = False", tbnmd)
- Case "保存"
- If txtnumber.Text = "" Or txtname.Text = "" Then
- MessageBox.Show("信息不完整,保存失败!", "提示", MessageBoxButtons.OK)
- Else
- Dim dr As DataRow = dslocals.Tables("MdManager").NewRow()
- dr("编号") = Me.txtnumber.Text.Trim
- dr("名称") = Me.txtname.Text.Trim
- dr("电话") = Me.txttele.Text.Trim
- dr("传真") = Me.txttax.Text.Trim
- dr("营业面积") = Me.txtarea.Text.Trim
- dr("价格方案") = Me.txtprice.Text.Trim
- dr("运输方式") = Me.txtys.Text.Trim
- dr("结算方式") = Me.txtjs.Text.Trim
- dr("创建日期") = Me.txtdate.Text.Trim
- dr("创建人") = Me.txtcjz.Text.Trim
- dr("负责人") = Me.txtfzr.Text.Trim
- dr("备注") = Me.txtdemo.Text.Trim
- dslocals.Tables("MdManager").Rows.Add(dr)
- If lsweb.updatedataset("select Number as 编号,Cname as 名称,Telephone as 电话,Tax as 传真,Yarea as 营业面积,PriceFa as 价格方案,Phxs as 运输方式,Js as 结算方式,cDate as 创建日期,Fzr as 负责人,cjr as 创建人,Demo as 备注 from MdManager", "MdManager", dslocals, DataRowState.Added) = True Then
- MessageBox.Show("信息成功保存!", "提示", MessageBoxButtons.OK)
- Else
- MessageBox.Show("信息保存失败!", "提示", MessageBoxButtons.AbortRetryIgnore)
- End If
- tbnEnable("tbnSave.Enabled = False", tbnmd)
- End If
- Case "修改"
- Modified()
- tbnEnable("tbnModify.Enabled = False", tbnmd)
- Case "删除"
- delete()
- tbnEnable("tbnDelete.Enabled = False", tbnmd)
- Case "退出"
- Me.Close()
- End Select
- End Sub
-
- Private Sub txttax_KeyDown(ByVal sender As System.Object, ByVal e As System.Windows.Forms.KeyEventArgs)
- If e.KeyCode = Keys.Enter Then
- txtfzr.Focus()
- End If
- End Sub
- Private Sub txtfzr_KeyDown(ByVal sender As System.Object, ByVal e As System.Windows.Forms.KeyEventArgs)
- If e.KeyCode = Keys.Enter Then
- txtdemo.Focus()
- End If
- End Sub
-
- Private Sub txtprice_Validating(ByVal sender As System.Object, ByVal e As System.ComponentModel.CancelEventArgs)
- If txtprice.Text = String.Empty Then
- ErrorProvider1.SetError(txtprice, "不能为空。")
- txtprice.Focus()
- Else
- ErrorProvider1.SetError(txtprice, "")
- End If
- End Sub
- Private Sub txtname_Validating(ByVal sender As System.Object, ByVal e As System.ComponentModel.CancelEventArgs)
- If txtname.Text = String.Empty Then
- ErrorProvider1.SetError(txtname, "不能为空。")
- txtname.Focus()
- Else
- ErrorProvider1.SetError(txtname, "")
- End If
- End Sub
- Private Sub txtcjz_Validating(ByVal sender As System.Object, ByVal e As System.ComponentModel.CancelEventArgs)
- If txtcjz.Text = String.Empty Then
- ErrorProvider1.SetError(txtcjz, "不能为空。")
- txtcjz.Focus()
- Else
- ErrorProvider1.SetError(txtcjz, "")
- End If
- End Sub
- Private Sub txtjs_Validating(ByVal sender As System.Object, ByVal e As System.ComponentModel.CancelEventArgs)
- If txtjs.Text = String.Empty Then
- ErrorProvider1.SetError(txtjs, "不能为空。")
- txtjs.Focus()
- Else
- ErrorProvider1.SetError(txtjs, "")
- End If
- End Sub
- Private Sub txtys_Validating(ByVal sender As System.Object, ByVal e As System.ComponentModel.CancelEventArgs)
- If txtys.Text = String.Empty Then
- ErrorProvider1.SetError(txtys, "不能为空。")
- txtys.Focus()
- Else
- ErrorProvider1.SetError(txtys, "")
- End If
- End Sub
- Private Sub txttele_Validating(ByVal sender As System.Object, ByVal e As System.ComponentModel.CancelEventArgs)
- If txttele.Text = String.Empty Then
- ErrorProvider1.SetError(txttele, "不能为空。")
- txttele.Focus()
- Else
- ErrorProvider1.SetError(txttele, "")
- End If
- End Sub
- Private Sub txttax_Validating(ByVal sender As System.Object, ByVal e As System.ComponentModel.CancelEventArgs)
- If txttax.Text = String.Empty Then
- ErrorProvider1.SetError(txttax, "不能为空。")
- txttax.Focus()
- Else
- ErrorProvider1.SetError(txttax, "")
- End If
- End Sub
- Private Sub txtfzr_Validating(ByVal sender As System.Object, ByVal e As System.ComponentModel.CancelEventArgs)
- If txtfzr.Text = String.Empty Then
- ErrorProvider1.SetError(txtfzr, "不能为空。")
- txtfzr.Focus()
- Else
- ErrorProvider1.SetError(txtfzr, "")
- End If
- End Sub
- Private Sub txtdemo_Validating(ByVal sender As System.Object, ByVal e As System.ComponentModel.CancelEventArgs)
- If txtdemo.Text = String.Empty Then
- ErrorProvider1.SetError(txtdemo, "不能为空。")
- txtdemo.Focus()
- Else
- ErrorProvider1.SetError(txtdemo, "")
- End If
- End Sub
- Private Sub txtnumber_KeyDown1(ByVal sender As System.Object, ByVal e As System.Windows.Forms.KeyEventArgs)
- If e.KeyCode = Keys.Enter Then
- txtarea.Focus()
- End If
- End Sub
-
- Private Sub txtarea_KeyDown1(ByVal sender As System.Object, ByVal e As System.Windows.Forms.KeyEventArgs)
- If e.KeyCode = Keys.Enter Then
- txtprice.Focus()
- End If
- End Sub
-
- Private Sub txtprice_KeyDown1(ByVal sender As System.Object, ByVal e As System.Windows.Forms.KeyEventArgs)
- If e.KeyCode = Keys.Enter Then
- txtname.Focus()
- End If
- End Sub
-
- Private Sub txtname_KeyDown1(ByVal sender As System.Object, ByVal e As System.Windows.Forms.KeyEventArgs)
- If e.KeyCode = Keys.Enter Then
- txtcjz.Focus()
- End If
- End Sub
-
- Private Sub txtcjz_KeyDown1(ByVal sender As System.Object, ByVal e As System.Windows.Forms.KeyEventArgs)
- If e.KeyCode = Keys.Enter Then
- txtjs.Focus()
- End If
- End Sub
-
- Private Sub txtjs_KeyDown1(ByVal sender As System.Object, ByVal e As System.Windows.Forms.KeyEventArgs)
- If e.KeyCode = Keys.Enter Then
- txtys.Focus()
- End If
- End Sub
- Private Sub txtys_KeyDown1(ByVal sender As System.Object, ByVal e As System.Windows.Forms.KeyEventArgs)
- If e.KeyCode = Keys.Enter Then
- txttele.Focus()
- End If
- End Sub
-
- Private Sub txttele_KeyDown1(ByVal sender As System.Object, ByVal e As System.Windows.Forms.KeyEventArgs)
- If e.KeyCode = Keys.Enter Then
- txttax.Focus()
- End If
- End Sub
-
- Private Sub txttax_KeyDown1(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles txttax.KeyDown
- If e.KeyCode = Keys.Enter Then
- txtfzr.Focus()
- End If
- End Sub
-
- Private Sub txtfzr_KeyDown1(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles txtfzr.KeyDown
- If e.KeyCode = Keys.Enter Then
- txtdemo.Focus()
- End If
- End Sub
- Private Sub txtnumber_Validating(ByVal sender As System.Object, ByVal e As System.ComponentModel.CancelEventArgs)
- If txtnumber.Text = String.Empty Then
- ErrorProvider1.SetError(txtnumber, "不能为空。")
- txtnumber.Focus()
- Else
- ErrorProvider1.SetError(txtnumber, "")
- End If
- End Sub
- Private Sub txtarea_Validating(ByVal sender As System.Object, ByVal e As System.ComponentModel.CancelEventArgs)
- If txtarea.Text = String.Empty Then
- ErrorProvider1.SetError(txtarea, "不能为空。")
- txtarea.Focus()
- Else
- ErrorProvider1.SetError(txtarea, "")
- End If
- End Sub
-
-
- Private Sub txttax_Validating1(ByVal sender As Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles txttax.Validating
- If txttax.Text = String.Empty Then
- ErrorProvider1.SetError(txttax, "不能为空。")
- txttax.Focus()
- Else
- ErrorProvider1.SetError(txttax, "")
- End If
- End Sub
- Private Sub txtfzr_Validating1(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 txtnumber_KeyDown2(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles txtnumber.KeyDown
- If e.KeyCode = Keys.Enter Then
- txtarea.Focus()
- End If
- End Sub
-
- Private Sub txtarea_KeyDown2(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles txtarea.KeyDown
- If e.KeyCode = Keys.Enter Then
- txtprice.Focus()
- End If
- End Sub
-
- Private Sub txtprice_KeyDown2(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles txtprice.KeyDown
- If e.KeyCode = Keys.Enter Then
- txtname.Focus()
- End If
- End Sub
-
- Private Sub txtname_KeyDown2(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles txtname.KeyDown
- If e.KeyCode = Keys.Enter Then
- txtcjz.Focus()
- End If
- End Sub
-
- Private Sub txtcjz_KeyDown2(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles txtcjz.KeyDown
- If e.KeyCode = Keys.Enter Then
- txtjs.Focus()
- End If
- End Sub
- Private Sub txtjs_KeyDown2(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles txtjs.KeyDown
- If e.KeyCode = Keys.Enter Then
- txtys.Focus()
- End If
- End Sub
-
- Private Sub txtys_KeyDown2(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles txtys.KeyDown
- If e.KeyCode = Keys.Enter Then
- txttele.Focus()
- End If
- End Sub
-
- Private Sub txttele_KeyDown2(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles txttele.KeyDown
- If e.KeyCode = Keys.Enter Then
- txttax.Focus()
- End If
- End Sub
-
- Private Sub txtnumber_Validating2(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 txtarea_Validating2(ByVal sender As Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles txtarea.Validating
- If txtarea.Text = String.Empty Then
- ErrorProvider1.SetError(txtarea, "不能为空。")
- txtarea.Focus()
- Else
- ErrorProvider1.SetError(txtarea, "")
- End If
- End Sub
-
- Private Sub txtprice_Validating2(ByVal sender As Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles txtprice.Validating
- If txtprice.Text = String.Empty Then
- ErrorProvider1.SetError(txtprice, "不能为空。")
- txtprice.Focus()
- Else
- ErrorProvider1.SetError(txtprice, "")
- End If
- End Sub
-
- Private Sub txtname_Validating2(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 txtcjz_Validating2(ByVal sender As Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles txtcjz.Validating
- If txtcjz.Text = String.Empty Then
- ErrorProvider1.SetError(txtcjz, "不能为空。")
- txtcjz.Focus()
- Else
- ErrorProvider1.SetError(txtcjz, "")
- End If
- End Sub
- Private Sub txtjs_Validating2(ByVal sender As Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles txtjs.Validating
- If txtjs.Text = String.Empty Then
- ErrorProvider1.SetError(txtjs, "不能为空。")
- txtjs.Focus()
- Else
- ErrorProvider1.SetError(txtjs, "")
- End If
- End Sub
-
- Private Sub txtys_Validating2(ByVal sender As Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles txtys.Validating
- If txtys.Text = String.Empty Then
- ErrorProvider1.SetError(txtys, "不能为空。")
- txtys.Focus()
- Else
- ErrorProvider1.SetError(txtys, "")
- End If
- End Sub
-
- Private Sub txttele_Validating2(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 txtdemo_Validating2(ByVal sender As Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles txtdemo.Validating
- If txtdemo.Text = String.Empty Then
- ErrorProvider1.SetError(txtdemo, "不能为空。")
- txtdemo.Focus()
- Else
- ErrorProvider1.SetError(txtdemo, "")
- End If
- End Sub
-
- Private Sub txtnumber_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles txtnumber.TextChanged
- End Sub
- End Class