📄 frmddform.vb
字号:
Me.DateTimePicker1.Font = New System.Drawing.Font("宋体", 10.5!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(134, Byte))
Me.DateTimePicker1.Location = New System.Drawing.Point(152, 117)
Me.DateTimePicker1.Name = "DateTimePicker1"
Me.DateTimePicker1.Size = New System.Drawing.Size(168, 23)
Me.DateTimePicker1.TabIndex = 22
'
'Label10
'
Me.Label10.Font = New System.Drawing.Font("华文新魏", 10.5!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(134, Byte))
Me.Label10.ForeColor = System.Drawing.Color.Red
Me.Label10.Location = New System.Drawing.Point(16, 149)
Me.Label10.Name = "Label10"
Me.Label10.Size = New System.Drawing.Size(88, 23)
Me.Label10.TabIndex = 21
Me.Label10.Text = "截止日期"
Me.Label10.TextAlign = System.Drawing.ContentAlignment.MiddleLeft
'
'Label9
'
Me.Label9.Font = New System.Drawing.Font("华文新魏", 10.5!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(134, Byte))
Me.Label9.ForeColor = System.Drawing.Color.Red
Me.Label9.Location = New System.Drawing.Point(16, 117)
Me.Label9.Name = "Label9"
Me.Label9.Size = New System.Drawing.Size(88, 23)
Me.Label9.TabIndex = 20
Me.Label9.Text = "执行日期"
Me.Label9.TextAlign = System.Drawing.ContentAlignment.MiddleLeft
'
'TextBox5
'
Me.TextBox5.BackColor = System.Drawing.SystemColors.Info
Me.TextBox5.Font = New System.Drawing.Font("宋体", 9.75!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(134, Byte))
Me.TextBox5.ForeColor = System.Drawing.Color.Navy
Me.TextBox5.Location = New System.Drawing.Point(152, 24)
Me.TextBox5.Name = "TextBox5"
Me.TextBox5.Size = New System.Drawing.Size(168, 22)
Me.TextBox5.TabIndex = 15
Me.TextBox5.Text = ""
'
'Label5
'
Me.Label5.Font = New System.Drawing.Font("华文新魏", 9.749999!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(134, Byte))
Me.Label5.ForeColor = System.Drawing.Color.Blue
Me.Label5.Location = New System.Drawing.Point(16, 85)
Me.Label5.Name = "Label5"
Me.Label5.Size = New System.Drawing.Size(136, 23)
Me.Label5.TabIndex = 14
Me.Label5.Text = "收费标准(元/公里)"
Me.Label5.TextAlign = System.Drawing.ContentAlignment.MiddleLeft
'
'TextBox6
'
Me.TextBox6.BackColor = System.Drawing.SystemColors.Info
Me.TextBox6.Font = New System.Drawing.Font("宋体", 9.75!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(134, Byte))
Me.TextBox6.ForeColor = System.Drawing.Color.Navy
Me.TextBox6.Location = New System.Drawing.Point(152, 55)
Me.TextBox6.Name = "TextBox6"
Me.TextBox6.Size = New System.Drawing.Size(168, 22)
Me.TextBox6.TabIndex = 13
Me.TextBox6.Text = ""
'
'Label6
'
Me.Label6.Font = New System.Drawing.Font("华文新魏", 9.749999!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(134, Byte))
Me.Label6.ForeColor = System.Drawing.Color.Blue
Me.Label6.Location = New System.Drawing.Point(16, 176)
Me.Label6.Name = "Label6"
Me.Label6.Size = New System.Drawing.Size(104, 23)
Me.Label6.TabIndex = 12
Me.Label6.Text = "详细说明"
Me.Label6.TextAlign = System.Drawing.ContentAlignment.MiddleLeft
'
'TextBox7
'
Me.TextBox7.BackColor = System.Drawing.SystemColors.Info
Me.TextBox7.Font = New System.Drawing.Font("宋体", 9.75!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(134, Byte))
Me.TextBox7.ForeColor = System.Drawing.Color.Navy
Me.TextBox7.Location = New System.Drawing.Point(152, 86)
Me.TextBox7.Name = "TextBox7"
Me.TextBox7.Size = New System.Drawing.Size(168, 22)
Me.TextBox7.TabIndex = 11
Me.TextBox7.Text = ""
'
'Label7
'
Me.Label7.Font = New System.Drawing.Font("华文新魏", 9.749999!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(134, Byte))
Me.Label7.ForeColor = System.Drawing.Color.Blue
Me.Label7.Location = New System.Drawing.Point(16, 54)
Me.Label7.Name = "Label7"
Me.Label7.Size = New System.Drawing.Size(80, 23)
Me.Label7.TabIndex = 10
Me.Label7.Text = "车型名称"
Me.Label7.TextAlign = System.Drawing.ContentAlignment.MiddleLeft
'
'TextBox8
'
Me.TextBox8.BackColor = System.Drawing.SystemColors.Info
Me.TextBox8.Font = New System.Drawing.Font("宋体", 9.75!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(134, Byte))
Me.TextBox8.ForeColor = System.Drawing.Color.Navy
Me.TextBox8.Location = New System.Drawing.Point(24, 200)
Me.TextBox8.Multiline = True
Me.TextBox8.Name = "TextBox8"
Me.TextBox8.Size = New System.Drawing.Size(296, 64)
Me.TextBox8.TabIndex = 9
Me.TextBox8.Text = ""
'
'Label8
'
Me.Label8.Font = New System.Drawing.Font("华文新魏", 9.749999!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(134, Byte))
Me.Label8.ForeColor = System.Drawing.Color.Blue
Me.Label8.Location = New System.Drawing.Point(16, 23)
Me.Label8.Name = "Label8"
Me.Label8.Size = New System.Drawing.Size(80, 23)
Me.Label8.TabIndex = 8
Me.Label8.Text = "车型代码"
Me.Label8.TextAlign = System.Drawing.ContentAlignment.MiddleLeft
'
'Button3
'
Me.Button3.Font = New System.Drawing.Font("华文行楷", 10.5!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(134, Byte))
Me.Button3.ForeColor = System.Drawing.Color.Navy
Me.Button3.Location = New System.Drawing.Point(360, 232)
Me.Button3.Name = "Button3"
Me.Button3.Size = New System.Drawing.Size(64, 32)
Me.Button3.TabIndex = 16
Me.Button3.Text = "删除"
'
'Button4
'
Me.Button4.Font = New System.Drawing.Font("华文行楷", 10.5!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(134, Byte))
Me.Button4.ForeColor = System.Drawing.Color.Navy
Me.Button4.Location = New System.Drawing.Point(360, 272)
Me.Button4.Name = "Button4"
Me.Button4.Size = New System.Drawing.Size(64, 32)
Me.Button4.TabIndex = 17
Me.Button4.Text = "保存"
'
'Button1
'
Me.Button1.Font = New System.Drawing.Font("华文行楷", 10.5!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(134, Byte))
Me.Button1.ForeColor = System.Drawing.Color.Navy
Me.Button1.Location = New System.Drawing.Point(360, 152)
Me.Button1.Name = "Button1"
Me.Button1.Size = New System.Drawing.Size(64, 32)
Me.Button1.TabIndex = 14
Me.Button1.Text = "添加"
'
'Button2
'
Me.Button2.Font = New System.Drawing.Font("华文行楷", 10.5!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(134, Byte))
Me.Button2.ForeColor = System.Drawing.Color.Navy
Me.Button2.Location = New System.Drawing.Point(360, 192)
Me.Button2.Name = "Button2"
Me.Button2.Size = New System.Drawing.Size(64, 32)
Me.Button2.TabIndex = 15
Me.Button2.Text = "修改"
'
'ToolBar1
'
Me.ToolBar1.Appearance = System.Windows.Forms.ToolBarAppearance.Flat
Me.ToolBar1.Buttons.AddRange(New System.Windows.Forms.ToolBarButton() {Me.ToolBarButton1, Me.ToolBarButton2, Me.ToolBarButton3, Me.ToolBarButton4, Me.ToolBarButton5, Me.ToolBarButton6})
Me.ToolBar1.ButtonSize = New System.Drawing.Size(25, 25)
Me.ToolBar1.DropDownArrows = True
Me.ToolBar1.ImageList = Me.ImageList1
Me.ToolBar1.Name = "ToolBar1"
Me.ToolBar1.ShowToolTips = True
Me.ToolBar1.Size = New System.Drawing.Size(432, 34)
Me.ToolBar1.TabIndex = 19
'
'ToolBarButton1
'
Me.ToolBarButton1.ImageIndex = 0
Me.ToolBarButton1.ToolTipText = "第一项记录"
'
'ToolBarButton2
'
Me.ToolBarButton2.ImageIndex = 1
Me.ToolBarButton2.ToolTipText = "前一项记录"
'
'ToolBarButton3
'
Me.ToolBarButton3.ImageIndex = 2
Me.ToolBarButton3.ToolTipText = "后一项记录"
'
'ToolBarButton4
'
Me.ToolBarButton4.ImageIndex = 3
Me.ToolBarButton4.ToolTipText = "最后一项记录"
'
'ToolBarButton5
'
Me.ToolBarButton5.Style = System.Windows.Forms.ToolBarButtonStyle.Separator
'
'ToolBarButton6
'
Me.ToolBarButton6.ImageIndex = 4
Me.ToolBarButton6.ToolTipText = "退出设置"
'
'ImageList1
'
Me.ImageList1.ColorDepth = System.Windows.Forms.ColorDepth.Depth8Bit
Me.ImageList1.ImageSize = New System.Drawing.Size(25, 25)
Me.ImageList1.ImageStream = CType(resources.GetObject("ImageList1.ImageStream"), System.Windows.Forms.ImageListStreamer)
Me.ImageList1.TransparentColor = System.Drawing.Color.Transparent
'
'CheckBox2
'
Me.CheckBox2.Checked = True
Me.CheckBox2.CheckState = System.Windows.Forms.CheckState.Checked
Me.CheckBox2.Font = New System.Drawing.Font("华文新魏", 10.5!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(134, Byte))
Me.CheckBox2.ForeColor = System.Drawing.Color.Blue
Me.CheckBox2.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft
Me.CheckBox2.Location = New System.Drawing.Point(360, 88)
Me.CheckBox2.Name = "CheckBox2"
Me.CheckBox2.Size = New System.Drawing.Size(64, 24)
Me.CheckBox2.TabIndex = 21
Me.CheckBox2.Text = "只读"
Me.CheckBox2.TextAlign = System.Drawing.ContentAlignment.MiddleCenter
'
'frmDDForm
'
Me.AcceptButton = Me.Button5
Me.AutoScaleBaseSize = New System.Drawing.Size(6, 14)
Me.ClientSize = New System.Drawing.Size(432, 349)
Me.Controls.AddRange(New System.Windows.Forms.Control() {Me.CheckBox2, Me.ToolBar1, Me.Button5, Me.TabControl1, Me.Button3, Me.Button4, Me.Button1, Me.Button2})
Me.Icon = CType(resources.GetObject("$this.Icon"), System.Drawing.Icon)
Me.Name = "frmDDForm"
Me.Text = "设置收费站点和收费标准"
Me.TabControl1.ResumeLayout(False)
Me.TabPage1.ResumeLayout(False)
Me.GroupBox2.ResumeLayout(False)
Me.GroupBox3.ResumeLayout(False)
Me.TabPage2.ResumeLayout(False)
Me.GroupBox1.ResumeLayout(False)
Me.ResumeLayout(False)
End Sub
#End Region
Public Function GetStationInfo()
StationSQLstr = "SELECT * FROM CSInfo"
'查询账号和密码是否一致。
Message = "没有收费站信息或者数据库访问失败,请检查数据库是否有内容及相关设置。"
Caption = "访问数据库失败"
'定义没有账号与密码不一致的消息
Call ConnToDB(StationSQLstr, Message, Caption)
'调用模块中数据库访问函数来查询。
If IsError = False Then
CSCount.Count = DS.Tables.Item(0).Rows.Count - 1
'获取数据集中的所有数据记录数目
'没有发生错误时的需要触发的事件。
Else
Exit Function
'退出子过程。
'发生错误时需要触发的事件。
End If
'错误处理
End Function
Public Function GetStandardInfo()
StdSQLstr = "SELECT * FROM CSStd"
DBConn = New OleDbConnection()
'实例化一个新的数据库连接。
DBConn.ConnectionString = ConnectStr
'设置数据库连接字段,包括数据库引擎和数据库存放路径。
MyDB = New OleDbDataAdapter(StdSQLstr, DBConn)
'实例化一个新的数据适配器,并赋值。
StdDS = New DataSet()
StdDS.Clear()
MyDB.Fill(StdDS)
Message = "没有收费标准信息或者数据库访问失败," & _
"请检查数据库是否有内容及相关设置。"
Caption = "访问数据库失败"
'定义没有账号与密码不一致的消息
Call ConnToDB(StationSQLstr, Message, Caption)
'调用模块中数据库访问函数来查询。
If IsError = False Then
StdCount.Count = StdDS.Tables.Item(0).Rows.Count - 1
'获取数据集中的所有数据记录数目
'没有发生错误时的需要触发的事件。
Else
Exit Function
'退出子过程。
'发生错误时需要触发的事件。
End If
'错误处理
End Function
Public Function ShowCSInfo(ByVal index As Integer)
Me.TextBox1.Text = DS.Tables.Item(0).Rows.Item(index).Item(0)
Me.TextBox2.Text = DS.Tables.Item(0).Rows.Item(index).Item(1)
Me.TextBox3.Text = DS.Tables.Item(0).Rows.Item(index).Item(2)
Me.TextBox4.Text = DS.Tables.Item(0).Rows.Item(index).Item(3)
Me.CheckBox1.Checked = DS.Tables.Item(0).Rows.Item(index).Item(4)
IsLocalStn = DS.Tables.Item(0).Rows.Item(index).Item(4)
If IsLocalStn = True Then
LocalStCode = Me.TextBox1.Text
LocalStName = Me.TextBox3.Text
End If
'在约束控件中显示数据
End Function
Public Function ShowCSStd(ByVal index As Integer)
Me.TextBox5.Text = StdDS.Tables.Item(0).Rows.Item(index).Item(0)
Me.TextBox6.Text = StdDS.Tables.Item(0).Rows.Item(index).Item(1)
Me.TextBox7.Text = StdDS.Tables.Item(0).Rows.Item(index).Item(2)
Me.TextBox8.Text = StdDS.Tables.Item(0).Rows.Item(index).Item(3)
Me.DateTimePicker1.Value = StdDS.Tables.Item(0).Rows.Item(index).Item(4)
Me.DateTimePicker2.Value = StdDS.Tables.Item(0).Rows.Item(index).Item(5)
End Function
Private Sub Button1_Click(ByVal sender As System.Object, _
ByVal e As System.EventArgs) _
Handles Button1.Click
Call ClearCS()
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -