- VERSION 5.00
- Begin VB.Form frmEdit
- BorderStyle = 3 'Fixed Dialog
- Caption = "费用结算情况"
- ClientHeight = 2865
- ClientLeft = 45
- ClientTop = 330
- ClientWidth = 6150
- Icon = "frmEdit.frx":0000
- LinkTopic = "Form1"
- MaxButton = 0 'False
- MinButton = 0 'False
- ScaleHeight = 2865
- ScaleWidth = 6150
- ShowInTaskbar = 0 'False
- StartUpPosition = 2 '屏幕中心
- Begin VB.CommandButton cmdOK
- Caption = "确定"
- Height = 275
- Left = 3840
- TabIndex = 15
- Top = 2400
- Width = 900
- End
- Begin VB.CommandButton cmdCancel
- Caption = "取消"
- Height = 275
- Left = 4920
- TabIndex = 14
- Top = 2400
- Width = 900
- End
- Begin VB.Frame Frame4
- Height = 2295
- Left = 120
- TabIndex = 0
- Top = 0
- Width = 5895
- Begin VB.TextBox cboUser
- Appearance = 0 'Flat
- BorderStyle = 0 'None
- Enabled = 0 'False
- Height = 230
- Left = 3840
- TabIndex = 16
- Top = 1800
- Width = 1695
- End
- Begin VB.TextBox txtjsje
- Appearance = 0 'Flat
- BorderStyle = 0 'None
- Height = 230
- Left = 1080
- TabIndex = 6
- Top = 1800
- Width = 1695
- End
- Begin VB.TextBox txtfp
- Appearance = 0 'Flat
- BorderStyle = 0 'None
- Height = 230
- Left = 3840
- TabIndex = 5
- Top = 360
- Width = 1815
- End
- Begin VB.ComboBox cboWay
- Height = 300
- ItemData = "frmEdit.frx":000C
- Left = 1080
- List = "frmEdit.frx":0019
- TabIndex = 4
- Top = 1380
- Width = 1695
- End
- Begin VB.TextBox txtpj
- Appearance = 0 'Flat
- BorderStyle = 0 'None
- Enabled = 0 'False
- Height = 230
- Left = 1080
- TabIndex = 3
- Top = 360
- Width = 1695
- End
- Begin VB.TextBox txtgs
- Appearance = 0 'Flat
- BorderStyle = 0 'None
- Enabled = 0 'False
- Height = 230
- Left = 1080
- TabIndex = 2
- Top = 720
- Width = 1695
- End
- Begin VB.TextBox txtfpn
- Appearance = 0 'Flat
- BorderStyle = 0 'None
- Height = 230
- Left = 3840
- TabIndex = 1
- Top = 720
- Width = 1815
- End
- Begin VB.Label Labels
- AutoSize = -1 'True
- Caption = "结算方式"
- Height = 180
- Index = 7
- Left = 240
- TabIndex = 13
- Top = 1440
- Width = 720
- End
- Begin VB.Label Labels
- AutoSize = -1 'True
- Caption = "结算金额"
- Height = 180
- Index = 8
- Left = 240
- TabIndex = 12
- Top = 1800
- Width = 720
- End
- Begin VB.Label Labels
- AutoSize = -1 'True
- Caption = "经 手 人"
- Height = 180
- Index = 9
- Left = 3000
- TabIndex = 11
- Top = 1800
- Width = 720
- End
- Begin VB.Label Labels
- AutoSize = -1 'True
- Caption = "开票内容"
- Height = 180
- Index = 10
- Left = 3000
- TabIndex = 10
- Top = 360
- Width = 720
- End
- Begin VB.Label Labels
- AutoSize = -1 'True
- Caption = "配件费用"
- Height = 180
- Index = 11
- Left = 240
- TabIndex = 9
- Top = 360
- Width = 720
- End
- Begin VB.Label Labels
- AutoSize = -1 'True
- Caption = "工时费用"
- Height = 180
- Index = 12
- Left = 240
- TabIndex = 8
- Top = 720
- Width = 720
- End
- Begin VB.Label Labels
- AutoSize = -1 'True
- Caption = "开票金额"
- Height = 180
- Index = 13
- Left = 3000
- TabIndex = 7
- Top = 720
- Width = 720
- End
- End
- End
- Attribute VB_Name = "frmEdit"
- Attribute VB_GlobalNameSpace = False
- Attribute VB_Creatable = False
- Attribute VB_PredeclaredId = True
- Attribute VB_Exposed = False
- '****************************************************************************
- '人人为我,我为人人
- '枕善居收藏整理
- '发布日期:2008/01/21
- '描 述:汽车维修管理系统SQL2000版
- '网 站:http://www.Mndsoft.com/ (VB6源码博客)
- '网 站:http://www.VbDnet.com/ (VB.NET源码博客,主要基于.NET2005)
- 'e-mail :Mndsoft@163.com
- 'e-mail :Mndsoft@126.com
- 'OICQ :88382850
- ' 如果您有新的好的代码别忘记给枕善居哦!
- '****************************************************************************
- Option Explicit
- Public mvarID As String
- '根据对话框的显示方式来确定显示的数据
- Private Sub SetStatus()
- Dim ctl As Control
- Dim intBorderStyle As Integer
- Dim lngbkColor As Long
- Dim boolLocked As Boolean
- '默认的文本框风格设置
- intBorderStyle = 1 '3D
- lngbkColor = &H80000009
- boolLocked = False
- cmdOK.Visible = True
- cmdCancel.Caption = "取消"
- cmdOK.Caption = "保存"
- Me.Caption = "编辑结算信息"
- SetDefaultValue g_Conn.Execute("select * from client where id=" & GetID(mvarID))
- For Each ctl In Controls
- If (TypeOf ctl Is TextBox) Then
- ctl.BorderStyle = intBorderStyle
- ctl.BackColor = lngbkColor
- ctl.Locked = boolLocked
- ElseIf (TypeOf ctl Is ComboBox) Or _
- (TypeOf ctl Is DTPicker) Or _
- (TypeOf ctl Is CheckBox) Or _
- (TypeOf ctl Is Slider) Then
- ctl.Enabled = Not boolLocked
- End If
- Next
- End Sub
- Private Sub cmdCancel_Click()
- Unload Me
- End Sub
- Private Sub cmdOK_Click()
- Dim ErrMsg As String
- If Chk Then If RunSql("Update Client set fpnr='" & txtfp.Text & "',fpje=" & Val(txtfpn.Text) & _
- ",jsfs='" & cboWay.Text & "',jsje=" & Val(txtjsje.Text) & ",jsr='" & cboUser.Text & _
- "' where ID=" & GetID(mvarID), ErrMsg) Then Else MsgBox ErrMsg: Exit Sub Else Exit Sub
- With frmAddClient
- .txtfp.Text = txtfp.Text
- .txtfpn.Text = txtfpn.Text
- .cboWay.Text = cboWay.Text
- .txtjsje.Text = txtjsje.Text
- .cboUser.Text = cboUser.Text
- End With
- Unload Me
- End Sub
- Private Sub Form_Load()
- If GetID(mvarID) = 0 Then Unload Me
- SetStatus
- End Sub
- Private Sub SetDefaultValue(Optional objClient As ADODB.Recordset)
- Dim ctl As Control
- Dim i As Integer
- '添加所有的客户类型到组合框
- txtpj = frmAddClient.lbsumPJ
- txtgs = frmAddClient.lbsumGS
- cboUser.Text = g_Admin
- If objClient Is Nothing Then
- For Each ctl In Controls
- If TypeOf ctl Is TextBox Then
- ctl.Text = ""
- End If
- Next
- Else
- With objClient
- txtfp.Text = .Fields("fpnr")
- txtfpn.Text = .Fields("fpje")
- cboWay.Text = .Fields("jsfs")
- txtjsje.Text = .Fields("jsje")
- End With
- End If
- End Sub
- Private Function Chk() As Boolean
- If Trim(txtfp.Text) = "" Then
- MsgBox "开票内容不能为空!"
- Chk = False
- Exit Function
- ElseIf cboWay.Text = "" Then
- MsgBox "结算方式不能为空!"
- Chk = False
- Exit Function
- End If
- Chk = True
- End Function
- Private Sub txtfpn_Change()
- txtfpn = Val(txtfpn.Text)
- End Sub
- Private Sub txtjsje_Change()
- txtjsje = Val(txtjsje)
- End Sub