📄 qtdj.~pas
字号:
mainform.typequery.first;
while not mainform.typeQuery.Eof do
begin
xpcombobox4.Items.Add(mainform.typeQuerytype_id.Value+trim(mainform.typeQuerytype_name.Value)+':'+trim(mainform.typeQuerymodel.Value));
mainform.typeQuery.Next;
end;
xpCOMBOBOX3.Items.Clear;
xpcombobox3.Text:='<无团人员>';
xpcombobox3.Items.Add('<无团人员>');
mainform.group.Active :=true;
mainform.group.First;
while not mainform.group.Eof do
begin
xpcombobox3.Items.Add(mainform.groupgroup_id.Value+mainform.groupgroup_name.Value);
mainform.group.Next;
end;
xpcombobox5.Items.Clear;
mainform.code.Close;
mainform.code.Parameters.ParamByName('gpid').Value:='A';
mainform.code.Open;
mainform.code.First;
while not mainform.code.Eof do
begin
xpcombobox5.Items.Add(trim(mainform.codeyw_id.Value)+trim(mainform.codeyw_name.Value));
mainform.code.Next;
end;
mainform.code.Close;
xpCOMBOBOX6.Items.Clear;
mainform.code.Parameters.ParamByName('gpid').Value:='b';
mainform.code.Open;
mainform.code.First;
while not mainform.code.Eof do
begin
xpcombobox6.Items.Add(trim(mainform.codeyw_id.Value)+trim(mainform.codeyw_name.Value));
mainform.code.Next;
end;
mainform.code.Close;
xpCOMBOBOX7.Items.Clear;
mainform.code.Parameters.ParamByName('gpid').Value:='c';
mainform.code.Open;
mainform.code.First;
while not mainform.code.Eof do
begin
xpcombobox7.Items.Add(mainform.codeyw_id.Value+mainform.codeyw_name.Value);
mainform.code.Next;
end;
mainform.code.Close;
xpCOMBOBOX8.Items.Clear;
mainform.code.Parameters.ParamByName('gpid').Value:='d';
mainform.code.Open;
mainform.code.First;
while not mainform.code.Eof do
begin
xpcombobox8.Items.Add(trim(mainform.codeyw_id.Value)+trim(mainform.codeyw_name.Value));
mainform.code.Next;
end;
mainform.code.Close;
xpCOMBOBOX9.Items.Clear;
mainform.code.Parameters.ParamByName('gpid').Value:='e';
mainform.code.Open;
mainform.code.First;
while not mainform.code.Eof do
begin
xpcombobox9.Items.Add(trim(mainform.codeyw_id.Value)+trim(mainform.codeyw_name.Value));
mainform.code.Next;
end;
end;
procedure TqtForm.xpComboBox4Change(Sender: TObject);
begin
if trim(xpcombobox4.Text)<>'' then
begin
mainform.model2.Close;
mainform.model2.Parameters.ParamByName('m_id').Value:=copy(xpcombobox4.Text,length(xpcombobox4.text)-4,3);
mainform.model2.Open;
//image2.Picture :=dbimage1.Picture ;
mainform.ty2.Close;
mainform.ty2.Parameters.ParamByName('t_id').Value:=copy(xpcombobox4.Text,1,3);
mainform.ty2.Open;
end;
if xpedit1.Text='' then showmessage('请输入姓名!')
else
begin
g_id:=trim(mainform.ty2kjm.Value);
if xpcombobox1.Text='中国' then g_id:=g_id+'C' else g_id:=g_id+'F';
g_id:=g_id+getid(mainform.ty2max_id.Value+1);
end;
label13.Caption:=g_id;
barcode1.bar_Caption:=g_id;
end;
procedure TqtForm.RadioButton1KeyPress(Sender: TObject; var Key: Char);
begin
if radiobutton1.Checked then
begin
radiobutton1.Checked:=true;
radiobutton2.Checked:=false;
end;
end;
procedure TqtForm.xpBitBtn2Click(Sender: TObject);
var
istream:tmemorystream;
begin
mainform.ty2.Active:=false;
mainform.ty2.Active:=true;
mainform.ty2.Edit;
mainform.ty2max_id.Value:=mainform.ty2max_id.Value+1;
mainform.ty2.Post;
g_id:=copy(g_id,1,2)+getid(mainform.ty2max_id.Value);
label13.Caption:=g_id;
barcode1.Bar_Caption:=label13.Caption;
//以下保存数据
istream:=Tmemorystream.Create;
image1.Picture.Bitmap.SaveToStream(istream);
try
mainform.ry.Insert;
mainform.ryguest_id.Value:=trim(label13.Caption);
mainform.ryguest_name.Value:=trim(xpedit1.Text);
//ryguest_en_name.value:=trim(edit8.Text);
if radiobutton1.Checked then mainform.ryxb.Value:='男' else mainform.ryxb.Value:='女';
mainform.rygj.Value:=trim(xpcombobox1.Text);
mainform.ryco_name.Value:=trim(xpedit3.Text);
mainform.ryaddress.Value:=trim(xpedit2.Text);
mainform.ryweb_add.Value:=trim(xpedit4.Text);
mainform.rye_mail.Value:=trim(xpedit6.Text);
mainform.rytel.Value:=trim(xpedit7.Text);
mainform.ryfax.Value:=trim(xpedit8.Text);
mainform.ryywxz.Value:=copy(xpcombobox5.Text,1,5);
mainform.ryhy.Value:=copy(xpcombobox7.Text,1,5);
mainform.rymd.Value:=copy(xpcombobox6.Text,1,5);
mainform.rygm.Value:=copy(xpcombobox8.Text,1,5);
mainform.ryqd.Value:=COPY(xpcombobox9.Text,1,5);
mainform.rysfzz.Value:=0;
mainform.ryzt1.Value:=0;
mainform.ryzt2.Value:=0;
mainform.rylx.Value:=copy(xpcombobox4.Text,1,3);
mainform.ryzj_name.Value:=trim(xpcombobox2.Text);
mainform.ryzj_NO.Value:=trim(xpedit5.Text);
mainform.ryphoto.LoadFromStream(istream);
mainform.ryztbh.Value:='';
mainform.rydjrq.Value:=now();
mainform.ry.Post;
except
showmessage('数据有误,检查后请再试一次!');
end;
istream.Free;
//
xpbitbtn1.Enabled:=true;
xpbitbtn2.Enabled:=false;
end;
procedure TqtForm.RadioButton6Click(Sender: TObject);
begin
zjzl.Close;
zjzl.Parameters.ParamByName('ifno').Value:=0;
zjzl.Open;
end;
procedure TqtForm.RadioButton7Click(Sender: TObject);
begin
zjzl.Close;
zjzl.Parameters.ParamByName('ifno').Value:=1;
zjzl.Open;
end;
procedure TqtForm.RzDBGrid1DblClick(Sender: TObject);
begin
//
end;
procedure TqtForm.xpBitBtn5Click(Sender: TObject);
begin
if not zjzl.IsEmpty then
begin
zjzl.Edit;
zjzlsfzz.Value:=1;
zjzl.Post;
zjzl.Active:=false;
zjzl.Active:=true;
zjzl2.Active:=false;
zjzl2.Active:=true;
end else
showmessage('无还原目标!请选择!');
end;
procedure TqtForm.xpBitBtn4Click(Sender: TObject);
begin
rzpagecontrol1.ActivePageIndex:=1;
showmessage('请接通打印机并放好纸张。按下OK开始打印!');
//以下打印
Application.CreateForm(ta4page,a4page);
//调试用
//a4page.show;
//
a4page.QuickRep1.Prepare;
makebmp;
printtoA4(0);
if rzcheckbox1.Checked then a4page.quickrep1.Preview else
begin
a4page.QuickRep1.Print;
//打印结束
zjzl2.Edit;
zjzl2sfzz.Value:=2;
zjzl2.Post;
zjzl2.Active:=false;
zjzl2.Active:=true;
zjzl3.Active:=false;
zjzl3.Active:=true;
end;
end;
procedure TqtForm.FormCreate(Sender: TObject);
begin
img1:=timage.Create(self);
img1.Visible:=true;
img1.Stretch:=true;
img2:=timage.Create(self);
img2.Visible:=true;
img2.Stretch:=true;
//abitmap.Free;
//abitmap.Create;
end;
procedure TqtForm.xpBitBtn6Click(Sender: TObject);
begin
if not zjzl3.IsEmpty then
begin
zjzl3.Edit;
zjzl3sfzz.Value:=1;
zjzl3.Post;
zjzl3.Active:=false;
zjzl3.Active:=true;
zjzl2.Active:=false;
zjzl2.Active:=true;
end else
showmessage('无还原目标!请选择!');
end;
procedure TqtForm.xpBitBtn1Click(Sender: TObject);
begin
label13.Caption:='<自动编号>';
xpedit1.Text:='';xpedit1.SetFocus;
xpcombobox1.Text:='中国';
xpcombobox1.Text:='身份证';
xpedit5.Text:='';
xpcombobox5.Text:='<无团人员>';
xpedit2.Text:=''; xpedit3.Text:='';xpedit4.Text:='Http://';xpedit6.Text:='';xpedit7.Text:='';xpedit8.Text:='';
xpcombobox5.Text:='';xpcombobox6.text:='';xpcombobox7.text:=''; xpcombobox8.text:='';xpcombobox9.text:='';
end;
procedure TqtForm.xpBitBtn7Click(Sender: TObject);
var
i,j:integer;
begin
Application.CreateForm(ta4page,a4page);
i:=0;
j:=0;
rzpagecontrol1.ActivePageIndex:=1;
showmessage('请接通打印机并放好纸张。按下OK开始预览或打印!');
zjzl2.First;
if not zjzl2.IsEmpty then
begin
Application.CreateForm(ta4page,a4page);
a4page.QuickRep1.Prepare;
while not zjzl2.Eof do
begin
makebmp;
printtoA4(i mod 4);
if (i mod 4)=3 then
begin
if rzcheckbox1.Checked then
begin
a4page.quickrep1.Preview ;
j:=j+1;
a4page.QRImage1.Picture.Bitmap:=nil;
a4page.QRImage2.Picture.Bitmap:=nil;
a4page.QRImage3.Picture.Bitmap:=nil;
a4page.QRImage4.Picture.Bitmap:=nil;
end
else
begin
a4page.QuickRep1.Print;
j:=j+1;
a4page.QRImage1.Picture.Bitmap:=nil;
a4page.QRImage2.Picture.Bitmap:=nil;
a4page.QRImage3.Picture.Bitmap:=nil;
a4page.QRImage4.Picture.Bitmap:=nil;
end;
end;
i:=i+1;
zjzl2.Next;
end;
zjzl3.Active:=false;
zjzl3.Active :=true;
if not (((i-1) mod 4)=3) then if rzcheckbox1.Checked then begin a4page.quickrep1.Preview;j:=j+1;end else begin a4page.QuickRep1.Print;j:=j+1;end;
showmessage('共计'+inttostr(i)+'人,合'+inttostr(j)+'页。');
end;
zjzl2.Active:=false;
zjzl2.Active :=true;
end;
procedure TqtForm.xpBitBtn3Click(Sender: TObject);
begin
if not zjzl2.IsEmpty then
begin
zjzl2.Edit;
zjzl2sfzz.Value:=0;
zjzl2.Post;
zjzl2.Active:=false;
zjzl2.Active:=true;
zjzl.Active:=false;
zjzl.Active:=true;
end else
showmessage('无还原目标!请选择!');
end;
procedure TqtForm.RzPanel7DblClick(Sender: TObject);
begin
if passworddialog.Execute then if (passworddialog.Password='12131415') and (passworddialog.Login='111') then begin xpbitbtn6.Enabled:=true;checkbox1.Enabled:=true;end;
end;
procedure TqtForm.xpBitBtn9Click(Sender: TObject);
begin
printdialog.Execute;
end;
end.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -