📄 main1.prg
字号:
**************************************************
*-- 类: main1 (e:\sf1\user.vcx)
*-- 父类: form
*-- 基类: form
*
DEFINE CLASS main1 AS form
Height = 371
Width = 495
DoCreate = .T.
ShowTips = .T.
AutoCenter = .T.
Caption = "路桥收费"
WindowType = 1
Name = "Form1"
ADD OBJECT txt收费 AS textbox WITH ;
Comment = "", ;
FontSize = 11, ;
Alignment = 3, ;
Value = 0, ;
ControlSource = "", ;
Enabled = .T., ;
Format = "R", ;
Height = 25, ;
InputMask = "99", ;
Left = 243, ;
TabIndex = 1, ;
Top = 220, ;
Width = 41, ;
DisabledBackColor = RGB(156,226,193), ;
DisabledForeColor = RGB(255,0,0), ;
Name = "txt收费"
ADD OBJECT lbl收费 AS label WITH ;
AutoSize = .T., ;
FontBold = .T., ;
FontSize = 12, ;
WordWrap = .F., ;
BackStyle = 0, ;
Caption = "收费金额", ;
Left = 167, ;
Top = 225, ;
Width = 71, ;
TabIndex = 10, ;
ForeColor = RGB(0,0,255), ;
Name = "lbl收费"
ADD OBJECT container1 AS container WITH ;
Top = 25, ;
Left = 72, ;
Width = 337, ;
Height = 183, ;
SpecialEffect = 0, ;
TabIndex = 11, ;
Name = "Container1"
ADD OBJECT txt序号 AS textbox WITH ;
Comment = "", ;
FontSize = 11, ;
ControlSource = "sfxh", ;
Enabled = .F., ;
Height = 25, ;
Left = 155, ;
TabIndex = 3, ;
Top = 40, ;
Width = 61, ;
DisabledBackColor = RGB(156,226,193), ;
DisabledForeColor = RGB(255,0,0), ;
Name = "txt序号"
ADD OBJECT lbl序号 AS label WITH ;
AutoSize = .T., ;
FontBold = .T., ;
FontSize = 12, ;
WordWrap = .F., ;
BackStyle = 0, ;
Caption = "序号", ;
Left = 110, ;
Top = 42, ;
Width = 37, ;
TabIndex = 2, ;
ForeColor = RGB(0,0,255), ;
Name = "lbl序号"
ADD OBJECT txt日期 AS textbox WITH ;
Comment = "", ;
FontSize = 11, ;
ControlSource = "", ;
Enabled = .F., ;
Height = 25, ;
Left = 155, ;
TabIndex = 5, ;
Top = 79, ;
Width = 90, ;
DisabledBackColor = RGB(156,226,193), ;
DisabledForeColor = RGB(255,0,0), ;
Name = "txt日期"
ADD OBJECT lbl日期 AS label WITH ;
AutoSize = .T., ;
FontBold = .T., ;
FontSize = 12, ;
WordWrap = .F., ;
BackStyle = 0, ;
Caption = "日期", ;
Left = 109, ;
Top = 83, ;
Width = 37, ;
TabIndex = 4, ;
ForeColor = RGB(0,0,255), ;
Name = "lbl日期"
ADD OBJECT txt时间 AS textbox WITH ;
Comment = "", ;
FontSize = 11, ;
ControlSource = "", ;
Enabled = .F., ;
Height = 25, ;
Left = 306, ;
TabIndex = 7, ;
Top = 79, ;
Width = 87, ;
DisabledBackColor = RGB(156,226,193), ;
DisabledForeColor = RGB(255,0,0), ;
Name = "txt时间"
ADD OBJECT lbl时间 AS label WITH ;
AutoSize = .T., ;
FontBold = .T., ;
FontSize = 12, ;
WordWrap = .F., ;
BackStyle = 0, ;
Caption = "时间", ;
Left = 261, ;
Top = 81, ;
Width = 37, ;
TabIndex = 6, ;
ForeColor = RGB(0,0,255), ;
Name = "lbl时间"
ADD OBJECT txt收费编号 AS textbox WITH ;
Comment = "", ;
FontSize = 11, ;
ControlSource = "", ;
Enabled = .F., ;
Height = 25, ;
Left = 156, ;
TabIndex = 9, ;
Top = 119, ;
Width = 30, ;
DisabledBackColor = RGB(156,226,193), ;
DisabledForeColor = RGB(255,0,0), ;
Name = "txt收费编号"
ADD OBJECT lbl收费编号 AS label WITH ;
AutoSize = .T., ;
FontBold = .T., ;
FontSize = 12, ;
WordWrap = .F., ;
BackStyle = 0, ;
Caption = "收费编号", ;
Left = 80, ;
Top = 123, ;
Width = 71, ;
TabIndex = 8, ;
ForeColor = RGB(0,0,255), ;
Name = "lbl收费编号"
ADD OBJECT txt站台 AS textbox WITH ;
Comment = "", ;
FontSize = 11, ;
Value = "", ;
ControlSource = "zd", ;
Enabled = .F., ;
Format = "", ;
Height = 25, ;
InputMask = "", ;
Left = 310, ;
TabIndex = 13, ;
Top = 121, ;
Width = 36, ;
DisabledBackColor = RGB(156,226,193), ;
DisabledForeColor = RGB(255,0,0), ;
Name = "txt站台"
ADD OBJECT lbl站台 AS label WITH ;
AutoSize = .T., ;
FontBold = .T., ;
FontSize = 12, ;
WordWrap = .F., ;
BackStyle = 0, ;
Caption = "站台", ;
Left = 264, ;
Top = 125, ;
Width = 37, ;
TabIndex = 12, ;
ForeColor = RGB(0,0,255), ;
Name = "lbl站台"
ADD OBJECT txt操作员 AS textbox WITH ;
Comment = "", ;
FontSize = 11, ;
ControlSource = "opno", ;
Enabled = .F., ;
Height = 25, ;
Left = 155, ;
TabIndex = 15, ;
Top = 157, ;
Width = 56, ;
DisabledBackColor = RGB(156,226,193), ;
DisabledForeColor = RGB(255,0,0), ;
Name = "txt操作员"
ADD OBJECT lbl操作员 AS label WITH ;
AutoSize = .T., ;
FontBold = .T., ;
FontSize = 12, ;
WordWrap = .F., ;
BackStyle = 0, ;
Caption = "操作员", ;
Left = 95, ;
Top = 160, ;
Width = 54, ;
TabIndex = 14, ;
ForeColor = RGB(0,0,255), ;
Name = "lbl操作员"
ADD OBJECT label1 AS label WITH ;
AutoSize = .T., ;
FontBold = .T., ;
FontItalic = .T., ;
FontSize = 12, ;
FontUnderline = .T., ;
Caption = "", ;
Height = 20, ;
Left = 144, ;
Top = 264, ;
Width = 2, ;
TabIndex = 16, ;
ForeColor = RGB(0,0,255), ;
Name = "Label1"
ADD OBJECT command1 AS commandbutton WITH ;
Top = 264, ;
Left = 379, ;
Height = 37, ;
Width = 86, ;
FontBold = .T., ;
FontSize = 14, ;
Caption = "交接班", ;
TabIndex = 17, ;
TabStop = .F., ;
ForeColor = RGB(255,0,0), ;
Name = "Command1"
ADD OBJECT command2 AS commandbutton WITH ;
Top = 312, ;
Left = 379, ;
Height = 37, ;
Width = 86, ;
FontBold = .T., ;
FontSize = 14, ;
Caption = "退出", ;
TabIndex = 18, ;
TabStop = .F., ;
ForeColor = RGB(255,0,0), ;
Name = "Command2"
ADD OBJECT timer1 AS timer WITH ;
Top = 192, ;
Left = 432, ;
Height = 23, ;
Width = 23, ;
Interval = 400, ;
Name = "Timer1"
ADD OBJECT command3 AS commandbutton WITH ;
Top = 308, ;
Left = 47, ;
Height = 37, ;
Width = 132, ;
FontBold = .T., ;
FontSize = 11, ;
Caption = "入库/打印收费单", ;
TabIndex = 17, ;
TabStop = .T., ;
ForeColor = RGB(255,0,0), ;
Name = "Command3"
ADD OBJECT command4 AS commandbutton WITH ;
Top = 308, ;
Left = 200, ;
Height = 37, ;
Width = 112, ;
FontBold = .T., ;
FontSize = 12, ;
Caption = "打印收费单", ;
TabIndex = 17, ;
TabStop = .F., ;
ToolTipText = "在选择[入库/打印收费单]打坏后再选择本项,这里不将当前记录入库", ;
ForeColor = RGB(255,0,0), ;
Name = "Command4"
PROCEDURE Init
public zsf,optype
zsf=0
thisform.label1.caption="本班次收费总金额为:"+alltrim(str(zsf))+"元"
ENDPROC
PROCEDURE Unload
return optype
ENDPROC
PROCEDURE command1.Click
optype=1
thisform.release
ENDPROC
PROCEDURE command2.Click
optype=2
thisform.release
ENDPROC
PROCEDURE timer1.Timer
thisform.txt日期.value=date()
thisform.txt时间.value=time()
ENDPROC
PROCEDURE command3.Click
select sfbz
locate for 收费=thisform.txt收费.value
if found()
restore from nofile additive
no=no+1
thisform.txt序号.value=no
thisform.txt收费编号.value=sfbz.收费编号
select sfjl
append blank
if lock()
repl 序号 with thisform.txt序号.value,日期 with thisform.txt日期.value
repl 计算日期 with compdate,收费编号 with thisform.txt收费编号.value
repl 收费 with thisform.txt收费.value,站台 with thisform.txt站台.value
repl 操作员 with thisform.txt操作员.value
save to nofile all like no
zsf=zsf+thisform.txt收费.value
unlock
endif
thisform.label1.caption="本班次收费总金额为:"+alltrim(str(zsf))+"元"
currec=recno()
report form rep for recno()=currec to printer
else
select sfjl
=messagebox("输入的收费不正确,重新输入",48,"信息提示")
endif
thisform.txt收费.setfocus
ENDPROC
PROCEDURE command4.Click
select sfbz
locate for 收费=thisform.txt收费.value
if found()
select sfjl
currec=recno()
report form rep for recno()=currec to printer
else
select sfjl
=messagebox("输入的收费不正确,重新输入",48,"信息提示")
endif
thisform.txt收费.setfocus
ENDPROC
ENDDEFINE
*
*-- 结束定义: main1
**************************************************
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -