📄 frmcaredit.frm
字号:
Width = 720
End
End
Begin VB.Frame Frame1
Caption = "基本信息"
Height = 1575
Left = 120
TabIndex = 0
Top = 120
Width = 9375
Begin VB.ComboBox cob_Status
Height = 300
Left = 3240
TabIndex = 57
Text = "待命"
Top = 1140
Width = 1215
End
Begin VB.TextBox txtBuyDate
BeginProperty DataFormat
Type = 1
Format = "yyyy-MM-dd"
HaveTrueFalseNull= 0
FirstDayOfWeek = 0
FirstWeekOfYear = 0
LCID = 2052
SubFormatType = 3
EndProperty
Height = 300
Left = 7920
TabIndex = 18
Top = 700
Width = 1215
End
Begin MSAdodcLib.Adodc AdodcSales
Height = 330
Left = 4560
Top = 1080
Visible = 0 'False
Width = 2175
_ExtentX = 3836
_ExtentY = 582
ConnectMode = 0
CursorLocation = 3
IsolationLevel = -1
ConnectionTimeout= 15
CommandTimeout = 30
CursorType = 3
LockType = 3
CommandType = 8
CursorOptions = 0
CacheSize = 50
MaxRecords = 0
BOFAction = 0
EOFAction = 0
ConnectStringType= 1
Appearance = 1
BackColor = -2147483643
ForeColor = -2147483640
Orientation = 0
Enabled = -1
Connect = ""
OLEDBString = ""
OLEDBFile = ""
DataSourceName = ""
OtherAttributes = ""
UserName = ""
Password = ""
RecordSource = ""
Caption = "AdodcSales"
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
_Version = 393216
End
Begin MSDataListLib.DataCombo dco_Sale
Height = 330
Left = 960
TabIndex = 17
Top = 1125
Width = 1335
_ExtentX = 2355
_ExtentY = 582
_Version = 393216
Style = 2
ListField = ""
BoundColumn = ""
Text = ""
End
Begin VB.TextBox txtCarCase
Height = 300
Left = 3240
TabIndex = 14
Top = 750
Width = 1215
End
Begin VB.TextBox txtEngineNo
Height = 300
Left = 960
TabIndex = 12
Top = 750
Width = 1335
End
Begin VB.TextBox txtOilNo
Height = 300
Left = 5640
TabIndex = 10
Top = 750
Width = 1095
End
Begin VB.ComboBox cbo_Color
Height = 300
ItemData = "FrmCarEdit.frx":E8D8
Left = 7920
List = "FrmCarEdit.frx":E8E5
TabIndex = 8
Top = 360
Width = 1215
End
Begin MSAdodcLib.Adodc AdodcType
Height = 330
Left = 6840
Top = 1080
Visible = 0 'False
Width = 2295
_ExtentX = 4048
_ExtentY = 582
ConnectMode = 0
CursorLocation = 3
IsolationLevel = -1
ConnectionTimeout= 15
CommandTimeout = 30
CursorType = 3
LockType = 3
CommandType = 8
CursorOptions = 0
CacheSize = 50
MaxRecords = 0
BOFAction = 0
EOFAction = 0
ConnectStringType= 1
Appearance = 1
BackColor = -2147483643
ForeColor = -2147483640
Orientation = 0
Enabled = -1
Connect = ""
OLEDBString = ""
OLEDBFile = ""
DataSourceName = ""
OtherAttributes = ""
UserName = ""
Password = ""
RecordSource = ""
Caption = "AdodcType"
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
_Version = 393216
End
Begin MSDataListLib.DataCombo dco_Type
Height = 330
Left = 3240
TabIndex = 6
Top = 345
Width = 1215
_ExtentX = 2143
_ExtentY = 582
_Version = 393216
Style = 2
ListField = ""
BoundColumn = ""
Text = ""
End
Begin VB.TextBox txtCarName
Height = 300
Left = 5640
TabIndex = 4
Top = 360
Width = 1095
End
Begin VB.TextBox txtCarNo
Height = 300
Left = 960
TabIndex = 2
Top = 360
Width = 1095
End
Begin VB.Label Label28
AutoSize = -1 'True
Caption = "状 态"
Height = 180
Left = 2580
TabIndex = 56
Top = 1200
Width = 540
End
Begin VB.Label Label9
AutoSize = -1 'True
Caption = "购买日期"
Height = 180
Left = 7080
TabIndex = 16
Top = 760
Width = 720
End
Begin VB.Label Label8
AutoSize = -1 'True
Caption = "销 售 商"
Height = 180
Left = 120
TabIndex = 15
Top = 1200
Width = 720
End
Begin VB.Label Label7
AutoSize = -1 'True
Caption = "车架编号"
Height = 180
Left = 2400
TabIndex = 13
Top = 810
Width = 720
End
Begin VB.Label Label6
AutoSize = -1 'True
Caption = "发动机号"
Height = 180
Left = 120
TabIndex = 11
Top = 810
Width = 720
End
Begin VB.Label Label5
AutoSize = -1 'True
Caption = "燃油编号"
Height = 180
Left = 4800
TabIndex = 9
Top = 810
Width = 720
End
Begin VB.Label Label4
AutoSize = -1 'True
Caption = "车辆颜色"
Height = 180
Left = 7080
TabIndex = 7
Top = 420
Width = 720
End
Begin VB.Label Label3
AutoSize = -1 'True
Caption = "车辆类型"
Height = 180
Left = 2400
TabIndex = 5
Top = 420
Width = 720
End
Begin VB.Label Label2
AutoSize = -1 'True
Caption = "车辆名称"
Height = 180
Left = 4800
TabIndex = 3
Top = 420
Width = 720
End
Begin VB.Label Label1
AutoSize = -1 'True
Caption = "车牌号码"
Height = 180
Left = 120
TabIndex = 1
Top = 420
Width = 720
End
End
End
Attribute VB_Name = "FrmCarEdit"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Public Modify As Boolean
Public IIkeys As String
Public sCarNo As String
Private Sub Cmd_Exit_Click()
Unload Me
End Sub
Private Sub Cmd_OK_Click()
If Len(Trim(dco_Type.Text)) = 0 Then
MsgBox "请选择车辆类型"
dco_Type.SetFocus
Exit Sub
End If
If Len(Trim(txtCarName)) = 0 Then
MsgBox "请输入车辆名称"
txtCarName.SetFocus
txtCarName.SelStart = 0
txtCarName.SelLength = Len(txtCarName)
Exit Sub
End If
If Len(Trim(cbo_Color.Text)) = 0 Then
MsgBox "请选择车辆颜色"
cbo_Color.SetFocus
Exit Sub
End If
If Len(Trim(txtEDate)) = 0 Then
MsgBox "请输入结束日期"
txtEDate.SetFocus
Exit Sub
End If
If Len(Trim(txtEngineNo)) = 0 Then
MsgBox "请输入发动机号"
txtEngineNo.SetFocus
txtEngineNo.SelStart = 0
txtEngineNo.SelLength = Len(txtEngineNo)
Exit Sub
End If
If Len(Trim(txtCarCase)) = 0 Then
MsgBox "请输入车架号"
txtCarCase.SetFocus
txtCarCase.SelStart = 0
txtCarCase.SelLength = Len(txtCarCase)
Exit Sub
End If
If Len(Trim(dco_Sale.Text)) = 0 Then
MsgBox "请输入销售商"
dco_Sale.SetFocus
Exit Sub
End If
With MyCar
.CarNo = MakeStr(txtCarNo)
.TypeId = Val(dco_Type.BoundText)
.CarName = MakeStr(txtCarName)
.Color = MakeStr(cbo_Color.Text)
.SaleId = Val(dco_Sale.BoundText)
.BuyDate = MakeStr(txtBuyDate)
.CarCase = MakeStr(txtCarCase)
.EngineNo = MakeStr(txtEngineNo)
.OilNo = MakeStr(txtOilNo)
.InsurNo = MakeStr(txtInsurNo)
.InsurId = Val(dco_Insu.BoundText)
.InsurType = IIkeys
.InsurSdate = MakeStr(txtSDate)
.InsurEdate = MakeStr(txtEDate)
.DayPrice = Val(txtDayPrice)
.WeekEndPrice = Val(txtWeekEndPrice)
.WeekPrice = Val(txtWeekPrice)
.MonthPrice = Val(txtMonthPrice)
.Deposit = Val(txtDeposit)
.DayKM = Val(txtDayKM)
.OverTimePrice = Val(txtOTPrice)
.OverKMPrice = Val(txtOKMPrice)
.Status = Trim(cob_Status.Text)
.Comment = MakeStr(txtComment)
If Modify = False Then
If Len(Trim(txtCarNo)) = 0 Then
MsgBox "请输入车牌号码!"
txtCarNo.SetFocus
txtCarNo.SelStart = 0
txtCarNo.SelLength = Len(txtCarNo)
Exit Sub
End If
If .In_DB(MakeStr(txtCarNo)) = False Then
.Insert
Else
MsgBox ("已经存在此车牌号码")
txtCarNo.SetFocus
Exit Sub
End If
Else
Call .Update(sCarNo)
End If
MsgBox "成功", vbInformation
End With
Unload Me
End Sub
Private Sub Cmd_Select_Click()
FrmTypeSel.Show 1
txtInsurType = Trim(sInsuItems)
IIkeys = Trim(sInsuKeys)
End Sub
Private Sub Form_Load()
DataSetup
End Sub
Private Sub DataSetup()
AdodcType.ConnectionString = Conn
AdodcType.RecordSource = "SELECT * FROM Types WHERE Typeid=1"
Set dco_Type.RowSource = AdodcType
dco_Type.ListField = "TypeName"
dco_Type.BoundColumn = "Id"
AdodcSales.ConnectionString = Conn
AdodcSales.RecordSource = "SELECT * FROM Company WHERE Typeid=1"
Set dco_Sale.RowSource = AdodcSales
dco_Sale.ListField = "Company"
dco_Sale.BoundColumn = "Id"
AdodcInsurance.ConnectionString = Conn
AdodcInsurance.RecordSource = "SELECT * FROM Company WHERE Typeid=2"
Set dco_Insu.RowSource = AdodcInsurance
dco_Insu.ListField = "Company"
dco_Insu.BoundColumn = "Id"
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -