📄 jdcprg.prg
字号:
*************jdcprg.prg************
*SET DEFAULT TO a:
use jdc in 2 alias "b"
PUBLIC oform1
oform1=CREATEOBJECT("form1")
oform1.Show(1)
RETURN
*************************************************
*
DEFINE CLASS form1 AS form
DataSession = 1
Height = 454
Width = 633
Desktop = .f.
DoCreate = .T.
AutoCenter = .T.
Caption = "机 动 车 信 息 登 记 表"
FontSize = 12
Icon = "..\samples\graphics\icons\computer\cdrom01.ico"
WindowType = 1
WindowState = 2
Name = "FORM1"
ADD OBJECT label1 AS label WITH ;
FontSize = 12, ;
Caption = "车牌号", ;
Height = 25, ;
Left = 24, ;
Top = 24, ;
Width = 60, ;
Name = "Label1"
ADD OBJECT text1 AS textbox WITH ;
ControlSource = "b.cph", ;
Height = 25, ;
Left = 96, ;
Top = 24, ;
Width = 121, ;
Name = "Text1"
ADD OBJECT label2 AS label WITH ;
FontSize = 12, ;
Caption = "发动机号", ;
Height = 25, ;
Left = 264, ;
Top = 24, ;
Width = 72, ;
Name = "Label2"
ADD OBJECT text2 AS textbox WITH ;
ControlSource = "b.fdjh", ;
Height = 25, ;
Left = 348, ;
Top = 24, ;
Width = 121, ;
Name = "Text2"
ADD OBJECT label3 AS label WITH ;
FontSize = 12, ;
Caption = "车架号", ;
Height = 25, ;
Left = 528, ;
Top = 24, ;
Width = 60, ;
Name = "Label3"
ADD OBJECT text3 AS textbox WITH ;
ControlSource = "b.cjh", ;
Height = 25, ;
Left = 600, ;
Top = 24, ;
Width = 133, ;
Name = "Text3"
ADD OBJECT label4 AS label WITH ;
FontSize = 12, ;
Caption = "车 型", ;
Height = 25, ;
Left = 24, ;
Top = 84, ;
Width = 49, ;
Name = "Label4"
ADD OBJECT text4 AS textbox WITH ;
ControlSource = "b.cx", ;
Height = 25, ;
Left = 96, ;
Top = 84, ;
Width = 121, ;
Name = "Text4"
ADD OBJECT label5 AS label WITH ;
FontSize = 12, ;
Caption = "厂牌型号", ;
Height = 25, ;
Left = 264, ;
Top = 84, ;
Width = 73, ;
Name = "Label5"
ADD OBJECT text5 AS textbox WITH ;
ControlSource = "b.cpxh", ;
Height = 25, ;
Left = 348, ;
Top = 84, ;
Width = 121, ;
Name = "Text5"
ADD OBJECT label6 AS label WITH ;
FontSize = 12, ;
Caption = "制造国", ;
Height = 25, ;
Left = 528, ;
Top = 84, ;
Width = 49, ;
Name = "Label6"
ADD OBJECT text6 AS textbox WITH ;
ControlSource = "b.zzg", ;
Height = 25, ;
Left = 600, ;
Top = 84, ;
Width = 121, ;
Name = "Text6"
ADD OBJECT label7 AS label WITH ;
FontSize = 12, ;
Caption = "出厂日期", ;
Height = 25, ;
Left = 24, ;
Top = 144, ;
Width = 72, ;
Name = "Label7"
ADD OBJECT text7 AS textbox WITH ;
ControlSource = "b.ccrq", ;
Height = 25, ;
Left = 96, ;
Top = 144, ;
Width = 121, ;
Name = "Text7"
ADD OBJECT label8 AS label WITH ;
FontSize = 12, ;
Caption = "发牌证日期", ;
Height = 25, ;
Left = 264, ;
Top = 144, ;
Width = 84, ;
Name = "Label8"
ADD OBJECT text8 AS textbox WITH ;
ControlSource = "b.fpzrq", ;
Height = 25, ;
Left = 348, ;
Top = 144, ;
Width = 121, ;
Name = "Text8"
ADD OBJECT label9 AS label WITH ;
FontSize = 12, ;
Caption = "报废日期", ;
Height = 25, ;
Left = 528, ;
Top = 144, ;
Width = 72, ;
Name = "Label9"
ADD OBJECT text9 AS textbox WITH ;
ControlSource = "b.bfrq", ;
Height = 25, ;
Left = 600, ;
Top = 144, ;
Width = 121, ;
Name = "Text9"
ADD OBJECT label10 AS label WITH ;
Caption = "Label10", ;
Height = 13, ;
Left = 132, ;
Top = 144, ;
Width = 1, ;
Name = "Label10"
ADD OBJECT label11 AS label WITH ;
FontSize = 12, ;
Caption = "车身颜色", ;
Height = 25, ;
Left = 24, ;
Top = 204, ;
Width = 73, ;
Name = "Label11"
ADD OBJECT text10 AS textbox WITH ;
ControlSource = "b.csys", ;
Height = 25, ;
Left = 96, ;
Top = 204, ;
Width = 121, ;
Name = "Text10"
ADD OBJECT label12 AS label WITH ;
FontSize = 12, ;
Caption = "功 率", ;
Height = 25, ;
Left = 264, ;
Top = 204, ;
Width = 85, ;
Name = "Label12"
ADD OBJECT text11 AS textbox WITH ;
ControlSource = "b.gl", ;
Height = 25, ;
Left = 348, ;
Top = 204, ;
Width = 121, ;
Name = "Text11"
ADD OBJECT label13 AS label WITH ;
FontSize = 12, ;
Caption = "燃料种类", ;
Height = 25, ;
Left = 528, ;
Top = 204, ;
Width = 73, ;
Name = "Label13"
ADD OBJECT text12 AS textbox WITH ;
ControlSource = "b.rlzl", ;
Height = 25, ;
Left = 600, ;
Top = 204, ;
Width = 109, ;
Name = "Text12"
ADD OBJECT label14 AS label WITH ;
FontSize = 12, ;
Caption = "排 量", ;
Height = 25, ;
Left = 24, ;
Top = 264, ;
Width = 73, ;
Name = "Label14"
ADD OBJECT text13 AS textbox WITH ;
ControlSource = "b.pl", ;
Height = 25, ;
Left = 96, ;
Top = 264, ;
Width = 121, ;
Name = "Text13"
ADD OBJECT label15 AS label WITH ;
FontSize = 12, ;
Caption = "总 质 量", ;
Height = 25, ;
Left = 264, ;
Top = 264, ;
Width = 73, ;
Name = "Label15"
ADD OBJECT text14 AS textbox WITH ;
ControlSource = "b.zzl", ;
Height = 25, ;
Left = 348, ;
Top = 264, ;
Width = 121, ;
Name = "Text14"
ADD OBJECT label16 AS label WITH ;
FontSize = 12, ;
Caption = "核定载质量", ;
Height = 25, ;
Left = 528, ;
Top = 264, ;
Width = 84, ;
Name = "Label16"
ADD OBJECT text15 AS textbox WITH ;
ControlSource = "b.dzzl", ;
Height = 25, ;
Left = 612, ;
Top = 264, ;
Width = 145, ;
Name = "Text15"
ADD OBJECT label18 AS label WITH ;
FontSize = 12, ;
Caption = "使用情况", ;
Height = 25, ;
Left = 36, ;
Top = 320, ;
Width = 72, ;
Name = "Label18"
ADD OBJECT text17 AS textbox WITH ;
ControlSource = "b.syqk", ;
Height = 73, ;
Left = 108, ;
Top = 320, ;
Width = 624, ;
Name = "Text17"
ADD OBJECT line1 AS line WITH ;
BorderWidth = 2, ;
Height = 410, ;
Left = 12, ;
Top = 12, ;
Width = 0, ;
BorderColor = RGB(80,80,80), ;
Name = "Line1"
ADD OBJECT line2 AS line WITH ;
BorderWidth = 2, ;
Height = 0, ;
Left = 12, ;
Top = 12, ;
Width = 765, ;
BorderColor = RGB(80,80,80), ;
Name = "Line2"
ADD OBJECT line3 AS line WITH ;
BorderWidth = 2, ;
Height = 0, ;
Left = 12, ;
Top = 422, ;
Width = 765, ;
BorderColor = RGB(228,228,228), ;
Name = "Line3"
ADD OBJECT line4 AS line WITH ;
BorderWidth = 2, ;
Height = 410, ;
Left = 777, ;
Top = 12, ;
Width = 0, ;
BorderColor = RGB(228,228,228), ;
Name = "Line4"
ADD OBJECT command1 AS commandbutton WITH ;
Top = 450, ;
Left = 85, ;
Height = 25, ;
Width = 50, ;
Caption = "上一条", ;
Name = "Command1"
ADD OBJECT command2 AS commandbutton WITH ;
Top = 450, ;
Left = 165, ;
Height = 25, ;
Width = 50, ;
FontSize = 9, ;
Caption = "下一条", ;
Name = "Command2"
ADD OBJECT command3 AS commandbutton WITH ;
Top = 450, ;
Left = 245, ;
Height = 25, ;
Width = 50, ;
Caption = "修改", ;
Name = "Command3"
ADD OBJECT command4 AS commandbutton WITH ;
Top = 450, ;
Left = 325, ;
Height = 25, ;
Width = 50, ;
Caption = "追加", ;
Name = "Command4"
ADD OBJECT command5 AS commandbutton WITH ;
Top = 450, ;
Left = 405, ;
Height = 25, ;
Width = 50, ;
Caption = "删除", ;
Name = "Command5"
ADD OBJECT command6 AS commandbutton WITH ;
Top = 450, ;
Left = 485, ;
Height = 25, ;
Width = 50, ;
Caption = "查询", ;
Name = "Command6"
ADD OBJECT command7 AS commandbutton WITH ;
Top = 450, ;
Left = 565, ;
Height = 25, ;
Width = 50, ;
Caption = "打印", ;
Name = "Command7"
ADD OBJECT command8 AS commandbutton WITH ;
Top = 450, ;
Left = 645, ;
Height = 25, ;
Width = 50, ;
Caption = "退出"
Name = "Command8"
PROCEDURE Activate
sele 2
ENDPROC
PROCEDURE Init
set cursor off
thisform.setall("readonly",.t.,"textbox")
ENDPROC
PROCEDURE command1.Click
skip -1
if bof()
go top
this.enabled=.f.
endif
if thisform.command2.enabled=.f.
thisform.command2.enabled=.t.
endif
thisform.refresh
ENDPROC
PROCEDURE command2.Click
skip 1
if eof()
go bottom
this.enabled=.f.
endif
if thisform.command1.enabled=.f.
thisform.command1.enabled=.t.
endif
thisform.refresh
ENDPROC
PROCEDURE command3.Click
if this.caption="修改"
thisform.setall("readonly",.f.,"textbox")
set cursor on
thisform.text1.setfocus
this.caption="还原"
thisform.setall("enabled",.f.,"commandbutton")
thisform.command3.enabled=.t.
thisform.refresh
else
this.caption="修改"
thisform.setall("readonly",.t.,"textbox")
set cursor off
thisform.setall("enabled",.t.,"commandbutton")
thisform.refresh
endif
ENDPROC
PROCEDURE command4.Click
if this.caption="追加"
set cursor on
append blank
thisform.setall("readonly",.f.,"textbox")
thisform.text1.setfocus
this.caption="保存"
thisform.setall("enabled",.f.,"commandbutton")
thisform.command4.enabled=.t.
thisform.refresh
else
go top
set cursor off
thisform.setall("readonly",.t.,"textbox")
this.caption="追加"
thisform.setall("enabled",.t.,"commandbutton")
thisform.refresh
endif
ENDPROC
PROCEDURE command5.Click
if this.caption="删除"
thisform.setall("readonly",.f.,"texbox")
set cursor off thisform.text1.setfocus
yhid.vspyion="还原"
thisform.setall("enabled",.f."commandbutton")
thisform.command5.enabled=.t.
thisform.refresh
else
this.caption="删除"
thisform.setall("readonly",.t."textbox")
set cursor off
thisform.setall("enabled",.t."commandbutton")
thisform.refresh
endif
ENDPROC
PROCEDURE command6.Click
oform3=createobject('form3')
oform3.show(1)
ENDPROC
PROCEDURE command7.Click
set device to printer
set printer on prompt
set device to screen
set printer off
ENDPROC
PROCEDURE command8.Click
release thisform
ENDPROC
ENDDEFINE
*
*-- EndDefine: form1
**************************************************
DEFINE CLASS form3 AS form
Height = 220
Width = 420
AutoCenter = .T.
BorderStyle = 3
Caption = "机动车信息查询"
ControlBox = .F.
Closable = .F.
MaxButton = .F.
MinButton = .F.
Movable = .F.
Name = "FORM3"
ADD OBJECT command1 AS commandbutton WITH ;
Top = 156, ;
Left = 84, ;
Height = 37, ;
Width = 73, ;
Caption = "确 定", ;
Name = "Command1"
ADD OBJECT command2 AS commandbutton WITH ;
Top = 156, ;
Left = 240, ;
Height = 37, ;
Width = 73, ;
Caption = "取 消", ;
Name = "Command2"
ADD OBJECT label1 AS label WITH ;
FontSize = 14, ;
Caption = "请选择要查询字段:", ;
Height = 25, ;
Left = 24, ;
Top = 12, ;
Width = 168, ;
Name = "Label1"
ADD OBJECT label2 AS label WITH ;
FontSize = 12, ;
Caption = "请输入要查找内容:", ;
Height = 25, ;
Left = 24, ;
Top = 60, ;
Width = 217, ;
Name = "Label2"
ADD OBJECT text1 AS textbox WITH ;
FontSize = 14, ;
Value = "", ;
Height = 37, ;
Left = 72, ;
Top = 96, ;
Width = 264, ;
Name = "Text1"
ADD OBJECT combo1 AS combobox WITH ;
RowSourceType = 1, ;
RowSource = " 车 牌 号, 发动机号, 车架号, 功 率",;
Value = 1, ;
Height = 25, ;
Left = 204, ;
Top = 12, ;
Width = 96, ;
Name = "Combo1"
PROCEDURE activate
set cursor on
thisform.text1.setfocus
ENDPROC
PROCEDURE command1.Click
sele 2
if not empty(thisform.text1.value)
oldrecn=recn()
do case
case thisform.Combo1.listitemid=1
locate for alltrim(cph) $ alltrim(thisform.text1.value)
case thisform.Combo1.listitemid=2
locate for alltrim(fdjh)$ alltrim(thisform.text1.value)
case thisform.Combo1.listitemid=3
locate for alltrim(cjh)$ alltrim(thisform.text1.value)
case thisform.Combo1.listitemid=4
locate for alltrim(gl)$ alltrim(thisform.text1.value)
endcase
if found()
release thisform
oform1.visible=.t.
oform1.refresh
else
go oldrecn
=messagebox('欲搜索的数据未能找到',16,'搜索')
thisform.text1.value=''
endif
endif
ENDPROC
PROCEDURE command2.Click
release thisform
oform1.visible=.t.
ENDPROC
PROCEDURE combo1.GotFocus
set cursor off
ENDPROC
PROCEDURE combo1.LostFocus
set cursor on
ENDPROC
PROCEDURE combo1.InteractiveChange
thisform.text1.setfocus
ENDPROC
ENDDEFINE
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -