📄 frmsave.frm
字号:
VERSION 5.00
Begin VB.Form frmSave
Caption = "存档报警记录"
ClientHeight = 7260
ClientLeft = 60
ClientTop = 348
ClientWidth = 8052
BeginProperty Font
Name = "宋体"
Size = 10.8
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Icon = "frmSave.frx":0000
LinkTopic = "Form1"
LockControls = -1 'True
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 7260
ScaleWidth = 8052
StartUpPosition = 2 'CenterScreen
Begin VB.TextBox txtReson
Height = 372
Left = 1320
TabIndex = 4
Top = 1142
Width = 4968
End
Begin VB.TextBox txtMotorMan
Height = 375
Left = 4716
TabIndex = 3
Top = 637
Width = 1560
End
Begin VB.TextBox txtCarStyle
Height = 375
Left = 4716
TabIndex = 1
Top = 132
Width = 1560
End
Begin VB.TextBox txtCarMan
Height = 375
Left = 1320
TabIndex = 2
Top = 637
Width = 2652
End
Begin VB.TextBox txtCarNumber
Height = 375
Left = 1320
TabIndex = 0
Top = 132
Width = 2652
End
Begin VB.CommandButton cmdCancel
Cancel = -1 'True
Caption = "退出"
Height = 396
Left = 6492
TabIndex = 8
Top = 2148
Width = 1215
End
Begin VB.CommandButton cmdDelete
Caption = "删除"
Height = 396
Left = 6492
TabIndex = 6
Top = 804
Width = 1215
End
Begin VB.CommandButton cmdPrint
Caption = "打印..."
Height = 396
Left = 6492
TabIndex = 7
Top = 1476
Width = 1215
End
Begin VB.CommandButton cmdOk
Caption = "存盘"
Default = -1 'True
Height = 396
Left = 6492
TabIndex = 5
Top = 132
Width = 1215
End
Begin VB.Label labPost
BorderStyle = 1 'Fixed Single
Height = 372
Left = 1320
TabIndex = 16
Top = 2148
Width = 4968
End
Begin VB.Label labDirection
BorderStyle = 1 'Fixed Single
Height = 372
Left = 4716
TabIndex = 13
Top = 1644
Width = 1560
End
Begin VB.Label labTime
BorderStyle = 1 'Fixed Single
Caption = "2000年12月31日20:12:45"
Height = 372
Left = 1320
TabIndex = 15
Top = 1644
Width = 2652
End
Begin VB.Label Label1
AutoSize = -1 'True
Caption = "车主名称:"
Height = 216
Left = 312
TabIndex = 19
Top = 636
Width = 1080
End
Begin VB.Label Label3
AutoSize = -1 'True
Caption = "违章地点:"
Height = 216
Left = 312
TabIndex = 18
Top = 2148
Width = 972
End
Begin VB.Label Label4
AutoSize = -1 'True
Caption = "违章时间:"
Height = 216
Left = 312
TabIndex = 17
Top = 1644
Width = 1080
End
Begin VB.Label Label5
AutoSize = -1 'True
Caption = "方向:"
Height = 216
Left = 4092
TabIndex = 14
Top = 1644
Width = 648
End
Begin VB.Label Label6
AutoSize = -1 'True
Caption = "姓名:"
Height = 216
Left = 4092
TabIndex = 12
Top = 648
Width = 648
End
Begin VB.Label Label9
AutoSize = -1 'True
Caption = "车牌号码:"
Height = 216
Left = 312
TabIndex = 11
Top = 132
Width = 1056
End
Begin VB.Label Label2
AutoSize = -1 'True
Caption = "车型:"
Height = 216
Left = 4092
TabIndex = 10
Top = 132
Width = 648
End
Begin VB.Label Label7
AutoSize = -1 'True
Caption = "违章原因:"
Height = 216
Left = 312
TabIndex = 9
Top = 1140
Width = 1080
End
Begin VB.Image Image1
Appearance = 0 'Flat
BorderStyle = 1 'Fixed Single
Height = 4452
Left = 360
Top = 2736
Width = 7368
End
End
Attribute VB_Name = "frmSave"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Dim itemX As ListItem
Private Sub cmdCancel_Click()
Unload Me
End Sub
Private Sub cmdDelete_Click()
Dim nYesNo As Integer, rs As Recordset
Dim sFile As String
nYesNo = MsgBox("删除后将无法再恢复,确认删除吗?", vbYesNo + vbQuestion, "剔除报警记录")
If nYesNo = vbYes Then
'数据库中删除相应记录
Set rs = myDB.OpenRecordset("Select * from tabCaptureRec where fldID = " & Format(itemX.Tag))
If Not rs.EOF Then
sFile = GetAppPath & "Jpg\" & rs!fldJpgFile
Kill sFile
rs.Delete
End If
rs.Close
frmServer.bSaveed = True
Unload Me
End If
End Sub
'存档,至少要车牌号码
Private Sub cmdOK_Click()
Dim nYesNo As Integer, rs As Recordset
txtCarNumber.Text = Trim(txtCarNumber.Text)
txtCarStyle.Text = Trim(txtCarStyle.Text)
txtCarMan.Text = Trim(txtCarMan.Text)
txtMotorMan.Text = Trim(txtMotorMan.Text)
txtReson.Text = Trim(txtReson.Text)
If txtCarNumber.Text = "" Then
MsgBox "请确定车牌号码,以便存档和查询", , "缺少数据"
txtCarNumber.SetFocus
ElseIf txtCarStyle.Text = "" Or txtReson.Text = "" Or txtCarMan.Text = "" Or txtMotorMan.Text = "" Then
nYesNo = MsgBox("数据不完整,确认存盘吗?", vbYesNo + vbQuestion, "数据不完整")
If nYesNo = vbNo Then
Exit Sub
End If
End If
Set rs = myDB.OpenRecordset("Select * from tabCaptureRec where fldID = " & Format(itemX.Tag))
If Not rs.EOF Then
rs.Edit
rs!fldCarNumber = txtCarNumber.Text
rs!fldCarMan = txtCarMan.Text
rs!fldMotorMan = txtMotorMan.Text
rs!fldCarStyle = txtCarStyle.Text
rs!fldReson = txtReson.Text
rs!fldState = "存盘"
rs.Update
End If
rs.Close
frmServer.bSaveed = True
MsgBox "存盘完毕,此后通过查询定位、操作此记录!"
End Sub
Private Sub cmdPrint_Click()
Dim nYesNo As Integer, rs As Recordset
Dim sPrintID As String, sFile As String
Dim prtDate As Date
txtCarNumber.Text = Trim(txtCarNumber.Text)
txtCarStyle.Text = Trim(txtCarStyle.Text)
txtCarMan.Text = Trim(txtCarMan.Text)
txtMotorMan.Text = Trim(txtMotorMan.Text)
txtReson.Text = Trim(txtReson.Text)
If txtCarNumber.Text = "" Or txtCarStyle.Text = "" Or txtCarMan.Text = "" Or txtMotorMan.Text = "" Or txtReson.Text = "" Then
MsgBox "数据不完整,请确认所有数据后再执行打印操作!"
Exit Sub
Else
sPrintID = GetPrintID
prtDate = Date
Set rs = myDB.OpenRecordset("Select * from tabCaptureRec where fldID = " & Format(itemX.Tag))
If Not rs.EOF Then
rs.Edit
rs!fldCarNumber = txtCarNumber.Text
rs!fldCarMan = txtCarMan.Text
rs!fldMotorMan = txtMotorMan.Text
rs!fldCarStyle = txtCarStyle.Text
rs!fldReson = txtReson.Text
rs!fldPrintID = sPrintID
rs!fldPrintDate = prtDate
rs!fldPrinted = True
rs.Update
End If
rs.Close
sFile = GetAppPath & itemX.SubItems(4)
Call frmPrint.PrintNotes(sPrintID, txtCarMan.Text, txtMotorMan.Text, txtCarNumber.Text, labPost.Caption, labTime.Caption, txtReson.Text, Format(prtDate, "Long Date"), sFile, txtCarStyle.Text)
frmServer.bSaveed = True
End If
End Sub
Private Sub Form_Load()
Set itemX = frmServer.lstViwCapture.SelectedItem
labPost.Caption = itemX.SubItems(1)
labDirection.Caption = itemX.SubItems(2)
labTime.Caption = itemX.SubItems(3)
Image1.Picture = frmServer.Image1.Picture
frmServer.bSaveed = False
End Sub
Private Sub Form_Resize()
Image1.Width = 498 * Screen.TwipsPerPixelX
Image1.Height = 288 * Screen.TwipsPerPixelY
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -