⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 unit32.~pas

📁 本系统是SQL SERVER的管理系统
💻 ~PAS
📖 第 1 页 / 共 2 页
字号:
end;
end;
if flatcombobox1.text='联系电话' then
begin
if flatedit1.text='' then
begin
showmessage('请输入联系电话');
end
else
begin
s1:=flatedit1.text;
with data.profitquery do
begin
close;
sql.clear;
sql.add('select profit.* from profit,sale,repsa,repertory');
sql.add('where profit.comno=sale.comno and sale.comno=repsa.comno and repsa.number=repertory.number and tel like'+''''+s1+'''');
prepare;
open;
end;

end;
end;
if flatcombobox1.text='车辆序列号' then
begin
if flatedit1.text='' then
begin
showmessage('请输入车辆序列号');
end
else
begin
s1:=flatedit1.text;
with data.profitquery do
begin
close;
sql.clear;
sql.add('select profit.* from profit,sale,repsa,repertory');
sql.add('where profit.comno=sale.comno and sale.comno=repsa.comno and repsa.number=repertory.number and  repertory.number like'+''''+s1+'''');
prepare;
open;
end;

end;
end;
if flatcombobox1.text='合同序列号' then
begin
if flatedit1.text='' then
begin
showmessage('请输入合同序列号');
end
else
begin
s1:=flatedit1.text;
with data.profitquery do
begin
close;
sql.clear;
sql.add('select profit.* from profit,sale,repsa,repertory');
sql.add('where profit.comno=sale.comno and sale.comno=repsa.comno and repsa.number=repertory.number and  profit.comno like'+''''+s1+'''');
prepare;
open;
end;

end;
end;
if flatcombobox1.text='到车日期段' then
begin
d1:= datetimepicker1.Date ;
d2:=datetimepicker2.Date;
if d1>d2 then
begin
showmessage('前日期不能大于后日期');
end
else
begin
with data.profitquery do
begin
close;
sql.clear;
sql.add('select profit.* from profit,sale,repsa,repertory');
sql.add('where profit.comno=sale.comno and sale.comno=repsa.comno and repsa.number=repertory.number and cdate between :adate and :bdate');
parambyname('adate').asdatetime:=d1;
parambyname('bdate').asdatetime:=d2;
prepare;
open;
end;

end;
end;
if flatcombobox1.text='销售时间段' then
begin
d1:= datetimepicker1.Date ;
d2:=datetimepicker2.Date;
if d1>d2 then
begin
showmessage('前日期不能大于后日期');
end
else
begin
with data.profitquery do
begin
close;
sql.clear;
sql.add('select profit.* from profit,sale,repsa,repertory');
sql.add('where profit.comno=sale.comno and sale.comno=repsa.comno and repsa.number=repertory.number and saledate between :adate and :bdate');
parambyname('adate').asdatetime:=d1;
parambyname('bdate').asdatetime:=d2;
prepare;
open;
end;

end;
end;
if flatcombobox1.text='车主身份证号' then
begin
i1:=length(flatedit1.text);
 for i2:=1 to i1 do
 begin
 if not((flatedit1.text[i2]>='0') and (flatedit1.text[i2]<='9')) then
 i3:=1;
 end;
if flatedit1.text='' then
begin
showmessage('请输入车主身份证号');
end
else
if i3=1 then
    begin
    showmessage('身份证输入错误,请检查');
     end
     else
     if not((i1=15)or(i1=18)) then
        begin
       showmessage('身份证输入的长度错误');
         end
     else
     begin
     s1:=flatedit1.text;
with data.profitquery do
begin
close;
sql.clear;
sql.add('select profit.* from profit,sale,repsa,repertory');
sql.add('where profit.comno=sale.comno and sale.comno=repsa.comno and repsa.number=repertory.number and nameno='+''''+s1+'''');
prepare;
open;
end;


     end;
end;
if flatcombobox1.text='销售总价格段' then
begin
r1:=snccurrencyedit1.value;
r2:=snccurrencyedit2.value;
if r1>r2 then
begin
showmessage('输入销售总价格金额一大于金额二');
end
else
begin
 with data.profitquery do
begin
close;
sql.clear;
sql.add('select profit.* from profit,sale,repsa,repertory');
sql.add('where profit.comno=sale.comno and sale.comno=repsa.comno and repsa.number=repertory.number and salepr between :ar1 and :br2');
parambyname('ar1').value:=r1;
parambyname('br2').value:=r2;
prepare;
open;
end;

end;
end;
if flatcombobox1.text='入户费用段' then
begin
r1:=snccurrencyedit1.value;
r2:=snccurrencyedit2.value;
if r1>r2 then
begin
showmessage('输入入户费用金额一大于金额二');
end
else
begin
 with data.profitquery do
begin
close;
sql.clear;
sql.add('select profit.* from profit,sale,repsa,repertory');
sql.add('where profit.comno=sale.comno and sale.comno=repsa.comno and repsa.number=repertory.number and putpr between :ar1 and :br2');
parambyname('ar1').value:=r1;
parambyname('br2').value:=r2;
prepare;
open;
end;

end;
end;
if flatcombobox1.text='车辆装修费用段' then
begin
r1:=snccurrencyedit1.value;
r2:=snccurrencyedit2.value;
if r1>r2 then
begin
showmessage('输入车辆装修费用金额一大于金额二');
end
else
begin
 with data.profitquery do
begin
close;
sql.clear;
sql.add('select profit.* from profit,sale,repsa,repertory');
sql.add('where profit.comno=sale.comno and sale.comno=repsa.comno and repsa.number=repertory.number and loadpr between :ar1 and :br2');
parambyname('ar1').value:=r1;
parambyname('br2').value:=r2;
prepare;
open;
end;

end;
end;
if flatcombobox1.text='其它费用段' then
begin
r1:=snccurrencyedit1.value;
r2:=snccurrencyedit2.value;
if r1>r2 then
begin
showmessage('输入其它费用金额一大于金额二');
end
else
begin
 with data.profitquery do
begin
close;
sql.clear;
sql.add('select profit.* from profit,sale,repsa,repertory');
sql.add('where profit.comno=sale.comno and sale.comno=repsa.comno and repsa.number=repertory.number and otherpr between :ar1 and :br2');
parambyname('ar1').value:=r1;
parambyname('br2').value:=r2;
prepare;
open;
end;

end;
end;
if flatcombobox1.text='汇款金额段' then
begin
r1:=snccurrencyedit1.value;
r2:=snccurrencyedit2.value;
if r1>r2 then
begin
showmessage('输入汇款金额一大于金额二');
end
else
begin
 with data.profitquery do
begin
close;
sql.clear;
sql.add('select profit.* from profit,sale,repsa,repertory');
sql.add('where profit.comno=sale.comno and sale.comno=repsa.comno and repsa.number=repertory.number and passmon between :ar1 and :br2');
parambyname('ar1').value:=r1;
parambyname('br2').value:=r2;
prepare;
open;
end;

end;
end;
if flatcombobox1.text='销售利润段' then
begin
r1:=snccurrencyedit1.value;
r2:=snccurrencyedit2.value;
if r1>r2 then
begin
showmessage('输入销售利润金额一大于金额二');
end
else
begin
 with data.profitquery do
begin
close;
sql.clear;
sql.add('select profit.* from profit,sale,repsa,repertory');
sql.add('where profit.comno=sale.comno and sale.comno=repsa.comno and repsa.number=repertory.number and salemon between :ar1 and :br2');
parambyname('ar1').value:=r1;
parambyname('br2').value:=r2;
prepare;
open;
end;

end;
end;
groupbox1.hide;
dbgrid1.height:=521;
epefbutton1.show;
epefbutton2.show;
epefbutton3.show;
epefbutton4.show;
epefbutton5.show;
epeftrbtn1.Show;
epeftrbtn2.show;
epeftrbtn3.show;
epeftrbtn4.show;
epeftrbtn5.show;
epeftrbtn6.show;
end;

end;

procedure TForm32.FlatComboBox1Change(Sender: TObject);
begin
  if flatcombobox1.text='车型' then
 begin
 flatcombobox2.text:='';
 flatedit1.text:='';
 flatcombobox2.show;
 flatedit1.Hide;
 datetimepicker1.hide;
 datetimepicker2.hide;
 label3.hide;
 snccurrencyedit1.hide;
 snccurrencyedit2.hide;
 end;
 if flatcombobox1.text='颜色' then
 begin
 flatcombobox2.text:='';
 flatedit1.text:='';
 flatcombobox2.show;
 flatedit1.Hide;
 datetimepicker1.hide;
 datetimepicker2.hide;
 label3.hide;
 snccurrencyedit1.hide;
 snccurrencyedit2.hide;
 end;
 if flatcombobox1.text='车辆来源' then
 begin
 flatcombobox2.text:='';
 flatedit1.text:='';
 flatcombobox2.show;
 flatedit1.Hide;
 datetimepicker1.hide;
 datetimepicker2.hide;
 label3.hide;
  snccurrencyedit1.hide;
 snccurrencyedit2.hide;
 end;
 if flatcombobox1.text='底盘号' then
 begin
 flatcombobox2.text:='';
 flatedit1.text:='';
 flatcombobox2.hide;
 flatedit1.show;
 datetimepicker1.hide;
 datetimepicker2.hide;
 label3.hide;
 snccurrencyedit1.hide;
 snccurrencyedit2.hide;
 end;
 if flatcombobox1.text='发动机号' then
 begin
 flatcombobox2.text:='';
 flatedit1.text:='';
 flatcombobox2.hide;
 flatedit1.show;
 datetimepicker1.hide;
 datetimepicker2.hide;
 label3.hide;
 snccurrencyedit1.hide;
 snccurrencyedit2.hide;
 end;

 if flatcombobox1.text='车牌号' then
 begin
 flatcombobox2.text:='';
 flatedit1.text:='';
 flatcombobox2.hide;
 flatedit1.show;
 datetimepicker1.hide;
 datetimepicker2.hide;
 label3.hide;
 snccurrencyedit1.hide;
 snccurrencyedit2.hide;
 end;
 if flatcombobox1.text='车主姓名' then
 begin
 flatcombobox2.text:='';
 flatedit1.text:='';
 flatcombobox2.hide;
 flatedit1.show;
 datetimepicker1.hide;
 datetimepicker2.hide;
 label3.hide;
 snccurrencyedit1.hide;
 snccurrencyedit2.hide;
 end;
 if flatcombobox1.text='联系电话' then
 begin
 flatcombobox2.text:='';
 flatedit1.text:='';
 flatcombobox2.hide;
 flatedit1.show;
 datetimepicker1.hide;
 datetimepicker2.hide;
 label3.hide;
 snccurrencyedit1.hide;
 snccurrencyedit2.hide;
 end;
 if flatcombobox1.text='车辆序列号' then
 begin
 flatcombobox2.text:='';
 flatedit1.text:='';
 flatcombobox2.hide;
 flatedit1.show;
 datetimepicker1.hide;
 datetimepicker2.hide;
 label3.hide;
 snccurrencyedit1.hide;
 snccurrencyedit2.hide;
 end;
 if flatcombobox1.text='合同序列号' then
 begin
 flatcombobox2.text:='';
 flatedit1.text:='';
 flatcombobox2.hide;
 flatedit1.show;
 datetimepicker1.hide;
 datetimepicker2.hide;
 label3.hide;
  snccurrencyedit1.hide;
 snccurrencyedit2.hide;
 end;
 if flatcombobox1.text='到车日期段' then
 begin
 flatcombobox2.text:='';
 flatedit1.text:='';
 flatcombobox2.hide;
 flatedit1.hide;
 datetimepicker1.show;
 datetimepicker2.show;
 label3.show;
  snccurrencyedit1.hide;
 snccurrencyedit2.hide;
 end;
 if flatcombobox1.text='销售时间段' then
 begin
 flatcombobox2.text:='';
 flatedit1.text:='';
 flatcombobox2.hide;
 flatedit1.hide;
 datetimepicker1.show;
 datetimepicker2.show;
 label3.show;
 snccurrencyedit1.hide;
 snccurrencyedit2.hide;
 end;
 if flatcombobox1.text='车主身份证号' then
 begin
 flatcombobox2.text:='';
 flatedit1.text:='';
 flatcombobox2.hide;
 flatedit1.show;
 datetimepicker1.hide;
 datetimepicker2.hide;
 label3.hide;
  snccurrencyedit1.hide;
 snccurrencyedit2.hide;
 end;
 if flatcombobox1.text='销售总价格段' then
 begin
 flatcombobox2.text:='';
 flatedit1.text:='';
 snccurrencyedit1.value:=0;
 snccurrencyedit2.value:=0;
 flatcombobox2.hide;
 flatedit1.hide;
 datetimepicker1.hide;
 datetimepicker2.hide;
 label3.show;
 snccurrencyedit1.show;
 snccurrencyedit2.show;
 end;
 if flatcombobox1.text='入户费用段' then
 begin
 flatcombobox2.text:='';
 flatedit1.text:='';
 snccurrencyedit1.value:=0;
 snccurrencyedit2.value:=0;
 flatcombobox2.hide;
 flatedit1.hide;
 datetimepicker1.hide;
 datetimepicker2.hide;
 label3.show;
 snccurrencyedit1.show;
 snccurrencyedit2.show;
 end;
 if flatcombobox1.text='车辆装修费用段' then
 begin
 flatcombobox2.text:='';
 flatedit1.text:='';
 snccurrencyedit1.value:=0;
 snccurrencyedit2.value:=0;
 flatcombobox2.hide;
 flatedit1.hide;
 datetimepicker1.hide;
 datetimepicker2.hide;
 label3.show;
 snccurrencyedit1.show;
 snccurrencyedit2.show;
 end;
 if flatcombobox1.text='其它费用段' then
 begin
 flatcombobox2.text:='';
 flatedit1.text:='';
 snccurrencyedit1.value:=0;
 snccurrencyedit2.value:=0;
 flatcombobox2.hide;
 flatedit1.hide;
 datetimepicker1.hide;
 datetimepicker2.hide;
 label3.show;
 snccurrencyedit1.show;
 snccurrencyedit2.show;
 end;
 if flatcombobox1.text='汇款金额段' then
 begin
 flatcombobox2.text:='';
 flatedit1.text:='';
 snccurrencyedit1.value:=0;
 snccurrencyedit2.value:=0;
 flatcombobox2.hide;
 flatedit1.hide;
 datetimepicker1.hide;
 datetimepicker2.hide;
 label3.show;
 snccurrencyedit1.show;
 snccurrencyedit2.show;
 end;
 if flatcombobox1.text='销售利润段' then
 begin
 flatcombobox2.text:='';
 flatedit1.text:='';
 snccurrencyedit1.value:=0;
 snccurrencyedit2.value:=0;
 flatcombobox2.hide;
 flatedit1.hide;
 datetimepicker1.hide;
 datetimepicker2.hide;
 label3.show;
 snccurrencyedit1.show;
 snccurrencyedit2.show;
 end;
 if flatcombobox1.text='资料修改记录' then
 begin
 flatcombobox2.text:='';
 flatedit1.text:='';
 snccurrencyedit1.value:=0;
 snccurrencyedit2.value:=0;
 flatcombobox2.hide;
 flatedit1.hide;
 datetimepicker1.hide;
 datetimepicker2.hide;
 label3.hide;
 snccurrencyedit1.hide;
 snccurrencyedit2.hide;
 with data.profitquery do
begin
close;
sql.clear;
sql.add('select profit.* from profit,sale,repsa,repertory');
sql.add('where profit.comno=sale.comno and sale.comno=repsa.comno and repsa.number=repertory.number and salesell=true and sell=true');
prepare;
open;
end;
groupbox1.hide;
dbgrid1.height:=521;
epefbutton1.show;
epefbutton2.show;
epefbutton3.show;
epefbutton4.show;
epefbutton5.show;
epeftrbtn1.Show;
epeftrbtn2.show;
epeftrbtn3.show;
epeftrbtn4.show;
epeftrbtn5.show;
epeftrbtn6.show;

end;
end;

procedure TForm32.epEfTrBtn5Click(Sender: TObject);
begin
form323.quickrep1.preview;

end;

procedure TForm32.FormKeyDown(Sender: TObject; var Key: Word;
  Shift: TShiftState);
begin
helpcarsale(key);
end;

end.

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -