📄 frmconupdate.frm
字号:
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 210
Left = 90
TabIndex = 14
Top = 300
Width = 525
End
Begin VB.Label Label5
AutoSize = -1 'True
Caption = "日期:"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 210
Left = 1620
TabIndex = 13
Top = 300
Width = 525
End
Begin VB.Label Label6
AutoSize = -1 'True
Caption = "司机号:"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 210
Left = 3690
TabIndex = 11
Top = 300
Width = 735
End
Begin VB.Label Label1
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "班次:"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 240
Index = 8
Left = 3810
TabIndex = 12
Top = 300
Visible = 0 'False
Width = 600
End
End
Begin VB.CommandButton cmdOK
Caption = "确定[&O]"
Enabled = 0 'False
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 405
Left = 2220
TabIndex = 4
Top = 5310
Width = 1605
End
Begin VB.CommandButton cmdCancel
Caption = "取消[&C]"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 405
Left = 3870
TabIndex = 3
Top = 5310
Width = 1605
End
Begin VB.CommandButton cmdExit
Caption = "退出[&X]"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 405
Left = 7170
TabIndex = 2
Top = 5310
Width = 1605
End
Begin VB.CommandButton cmdDel
Caption = "删除[&D]"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 405
Left = 5520
TabIndex = 1
Top = 5310
Width = 1605
End
End
End
Attribute VB_Name = "FrmConUpdate"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim sOLDSXW As String
Dim sOLDINPUT_DATE As String
Dim sOLDBUS_NO As String
Private Function NoToName(OpNo As String) As String
Dim rs As New ADODB.Recordset
If OpNo <> "" Then
rs.Open "select opname,OP_NO from AMC_DCY_INFO where opno=" + Trim(OpNo), cnn, adOpenStatic, adLockOptimistic
If rs.EOF Then
Else
NoToName = rs.Fields(0).Value
txtDcOP_No = rs.Fields(1).Value
End If
End If
End Function
Private Function DrNoToName(OpNo As String) As String
Dim rs As New ADODB.Recordset
If OpNo <> "" Then
rs.Open "select name from zz_bus_ic.dbo.Zy_Worker_INFO where op_no='" + Trim(OpNo) + "'", cnn, adOpenStatic, adLockOptimistic
If rs.EOF Then
Else
DrNoToName = rs.Fields(0).Value
End If
End If
End Function
Private Sub cboOldSxw_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then
txtDriverOldNo.SetFocus
End If
End Sub
Private Sub cmbCompany_GotFocus()
Dim rs As New ADODB.Recordset
On Error Resume Next
cmbCompany.ListIndex = -1
rs.Open "select * from zz_bus_ic.dbo.ZY_line_bus_dept_view where line_no='" + txtLineNo + "'", cnn, adOpenStatic, adLockOptimistic
If rs.EOF Then
MsgBox "无此线路号,请检查重输!", vbExclamation, "提示."
Exit Sub
Else
cmbCompany.Text = rs.Fields(1).Value
End If
End Sub
Private Sub cmbSxw_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then
txtConductorNo.SetFocus
End If
End Sub
Private Sub cmdCancel_Click()
txtBusNo = ""
txtCheckName = ""
txtCheckNo = ""
txtDcName = ""
txtDcOPNo = ""
txtDriverName = ""
txtConductorNo = ""
txtConductorName = ""
txtDriverNo = ""
txtLineNo = ""
' txtM001 = ""
' txtM002 = ""
' txtM005 = ""
' txtM01 = ""
' txtM02 = ""
' txtM05 = ""
' txtM1 = ""
' txtM2 = ""
' txtM5 = ""
' txtM10 = ""
' txtM20 = ""
' txtM50 = ""
' txtM100 = ""
txtToTalMoney = 0
' txtTotalNum = 0
txtToTalTicket = 0
cmbCompany.ListIndex = -1
End Sub
Private Sub cmdDel_Click()
Dim sSxw As String
Dim rs As New ADODB.Recordset
On Error Resume Next
' Select Case cboOldSxw.ListIndex
' Case 0
' sSxw = 0
' Case 1
' sSxw = 1
' Case 2
' sSxw = 2
' Case 3
' sSxw = 3
' Case 4
' sSxw = 4
' End Select
If MsgBox("确认要删除车号为『" + txtBusNos + "』的这条记录吗?", vbYesNo, "提示信息...") = vbYes Then
rs.Open "ZYSP_DEL_CON_CASH_INPUT '" + Trim(txtBusNos) + "','" + Format(dtpDateS, "yyyyMMdd") + "'," + Trim(txtDriverOldNo.Text) + "," + Trim(txtConductorOLD.Text), cnn, adOpenStatic, adLockOptimistic
If Err.Number <> 0 Then
MsgBox "删除失败?", vbCritical, "提示..."
Else
Call cmdCancel_Click
MsgBox "删除成功", vbInformation, "提示..."
End If
End If
End Sub
Private Sub cmdExit_Click()
Unload Me
End Sub
Private Sub cmdOK_Click()
Dim acmd As New Command
Dim param As ADODB.Parameter
Dim rs As New ADODB.Recordset
'On Error Resume Next
If txtBusNos.Text = 0 Or txtDriverOldNo.Text = 0 Or txtConductorOLD.Text = 0 Then
MsgBox "补单不能进行修改!", vbExclamation, "提示."
Exit Sub
End If
If txtLineNo = 0 Or txtDcOPNo = 0 Or txtCheckNo = 0 Or txtLineNo = "" Or cmbCompany.Text = "" Or txtDriverName = "" Or txtDcName = "" Then 'Or txtToTalMoney = 0 Or txtTotalNum = 0 Then
MsgBox "数据录入不完整,请检查重输!", vbExclamation, "提示."
Exit Sub
End If
With acmd
.ActiveConnection = cnn
.CommandText = "ZYSP_UPDATE_CON_CASH_INPUT"
.CommandType = adCmdStoredProc
.Parameters("@DRIVEROPNO") = Trim(txtDriverNo)
.Parameters("@CONDUCTOROPNO") = Trim(txtConductorNo)
.Parameters("@INPUT_DATE") = Format(dtpDate, "YYYYMMDD")
.Parameters("@BUS_NO") = Trim(txtBusNo)
.Parameters("@LINE_NO") = Trim(txtLineNo)
rs.Open "select dept_no from zz_bus_ic.dbo.zy_dept_info where name='" + Trim(cmbCompany.Text) + "'", cnn, adOpenStatic, adLockOptimistic
If Not rs.EOF Then
.Parameters("@DEPT_NO") = rs.Fields(0).Value
Else
MsgBox "数据录入不完整,请检查重输!", vbExclamation, "提示..."
Exit Sub
End If
.Parameters("@COUNTBILLOPNO") = Trim(txtDcOP_No)
.Parameters("@CHECKOPNO") = Trim(txtDcOP_No) 'Trim(txtCheckNo)
' .Parameters("@M100") = Trim(txtM100)
' .Parameters("@M50") = Trim(txtM50)
' .Parameters("@M20") = Trim(txtM20)
' .Parameters("@M10") = Trim(txtM10)
' .Parameters("@M5") = Trim(txtM5)
' .Parameters("@M2") = Trim(txtM2)
' .Parameters("@M1") = Trim(txtM1)
' .Parameters("@M05") = Trim(txtM05)
' .Parameters("@M02") = Trim(txtM02)
' .Parameters("@M01") = Trim(txtM01)
' .Parameters("@M005") = Trim(txtM005)
' .Parameters("@M002") = Trim(txtM002)
' .Parameters("@M001") = Trim(txtM001)
.Parameters("@SXW") = cmbSxw.ListIndex
.Parameters("@AvePrice") = CDbl(Trim(TxtAvePrice))
.Parameters("@DAYTOTALTICKET") = Trim(txtTotalNum)
.Parameters("@DAYTOTALMONEY") = CDbl(Trim(txtToTalMoney))
.Parameters("@oldCONDUCTOR") = txtConductorOLD
.Parameters("@OLDINPUT_DATE") = CStr(sOLDINPUT_DATE)
.Parameters("@OLDBUS_NO") = sOLDBUS_NO
.Parameters("@OLDDRIVER_NO") = txtDriverOldNo
.Execute '
If Err.Number <> 0 Then
MsgBox "数据输入失败! 此条记录已经录入不能重复输入!", , "提示..."
Debug.Print Err.Description
Else
MsgBox "数据成功!", , "提示..."
cmdOK.Enabled = False
End If
cmdCancel_Click
txtBusNos.SetFocus
End With
End Sub
Private Sub cmdSearch_Click()
Dim sSxw As String
Dim rs As New ADODB.Recordset
Dim rs1 As New ADODB.Recordset
On Error Resume Next
Select Case cboOldSxw.ListIndex
Case 0
sSxw = 0
Case 1
sSxw = 1
Case 2
sSxw = 2
Case 3
sSxw = 3
Case 4
sSxw = 4
End Select
' rs.Open "select * from ZY_EARNING_INPUT where bus_no='" + txtBusNos + "' and convert(char(8),input_date,112)='" + Format(dtpDateS, "yyyyMMdd") + "' and sxw=" +
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -