|
|
unit u_rp_ch_out_query;
|
|
|
|
|
|
interface
|
|
|
|
|
|
uses
|
|
|
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
|
|
|
Dialogs, BusinessSkinForm, bsSkinCtrls, StdCtrls, RxLookup,inifiles,
|
|
|
wwdbdatetimepicker, Mask, wwdbedit, Wwdotdot, Wwdbcomb;
|
|
|
|
|
|
type
|
|
|
Tfrm_rp_ch_Out_query = class(TForm)
|
|
|
bsSkinGroupBox1: TbsSkinGroupBox;
|
|
|
Label10: TLabel;
|
|
|
Label5: TLabel;
|
|
|
Label8: TLabel;
|
|
|
Label11: TLabel;
|
|
|
Label9: TLabel;
|
|
|
Label22: TLabel;
|
|
|
Label23: TLabel;
|
|
|
Label14: TLabel;
|
|
|
Label16: TLabel;
|
|
|
Label15: TLabel;
|
|
|
Label1: TLabel;
|
|
|
Label32: TLabel;
|
|
|
Label39: TLabel;
|
|
|
Label40: TLabel;
|
|
|
wwDBComboBox18: TwwDBComboBox;
|
|
|
wwDBDateTimePicker1: TwwDBDateTimePicker;
|
|
|
wwDBComboBox6: TwwDBComboBox;
|
|
|
wwDBDateTimePicker2: TwwDBDateTimePicker;
|
|
|
wwDBComboBox19: TwwDBComboBox;
|
|
|
wwDBDateTimePicker3: TwwDBDateTimePicker;
|
|
|
wwDBComboBox11: TwwDBComboBox;
|
|
|
wwDBDateTimePicker4: TwwDBDateTimePicker;
|
|
|
wwDBComboBox21: TwwDBComboBox;
|
|
|
RxDBLookupCombo2: TRxDBLookupCombo;
|
|
|
wwDBComboBox28: TwwDBComboBox;
|
|
|
RxDBLookupCombo10: TRxDBLookupCombo;
|
|
|
RxDBLookupCombo12: TRxDBLookupCombo;
|
|
|
wwDBComboBox29: TwwDBComboBox;
|
|
|
wwDBComboBox14: TwwDBComboBox;
|
|
|
RxDBLookupCombo3: TRxDBLookupCombo;
|
|
|
wwDBComboBox25: TwwDBComboBox;
|
|
|
RxDBLookupCombo6: TRxDBLookupCombo;
|
|
|
wwDBComboBox24: TwwDBComboBox;
|
|
|
RxDBLookupCombo4: TRxDBLookupCombo;
|
|
|
wwDBComboBox3: TwwDBComboBox;
|
|
|
Edit1: TEdit;
|
|
|
wwDBComboBox38: TwwDBComboBox;
|
|
|
Edit9: TEdit;
|
|
|
wwDBComboBox43: TwwDBComboBox;
|
|
|
wwDBComboBox44: TwwDBComboBox;
|
|
|
wwDBComboBox45: TwwDBComboBox;
|
|
|
RxDBLookupCombo15: TRxDBLookupCombo;
|
|
|
bsSkinGroupBox4: TbsSkinGroupBox;
|
|
|
Label13: TLabel;
|
|
|
Label37: TLabel;
|
|
|
Label38: TLabel;
|
|
|
wwDBComboBox13: TwwDBComboBox;
|
|
|
RxDBLookupCombo5: TRxDBLookupCombo;
|
|
|
RxDBLookupCombo1: TRxDBLookupCombo;
|
|
|
wwDBComboBox41: TwwDBComboBox;
|
|
|
wwDBComboBox42: TwwDBComboBox;
|
|
|
RxDBLookupCombo16: TRxDBLookupCombo;
|
|
|
bsSkinButton1: TbsSkinButton;
|
|
|
bsSkinButton10: TbsSkinButton;
|
|
|
bsSkinButton5: TbsSkinButton;
|
|
|
bsBusinessSkinForm1: TbsBusinessSkinForm;
|
|
|
bsSkinGroupBox2: TbsSkinGroupBox;
|
|
|
chkoutamt: TbsSkinCheckRadioBox;
|
|
|
chkoutdate: TbsSkinCheckRadioBox;
|
|
|
chkoutPort: TbsSkinCheckRadioBox;
|
|
|
Label43: TLabel;
|
|
|
wwDBComboBox48: TwwDBComboBox;
|
|
|
wwDBComboBox49: TwwDBComboBox;
|
|
|
bsSkinCheckRadioBox1: TbsSkinCheckRadioBox;
|
|
|
procedure bsSkinButton5Click(Sender: TObject);
|
|
|
procedure FormShow(Sender: TObject);
|
|
|
procedure bsSkinButton10Click(Sender: TObject);
|
|
|
procedure bsSkinButton1Click(Sender: TObject);
|
|
|
private
|
|
|
{ Private declarations }
|
|
|
procedure loadFindIni ;
|
|
|
procedure writeFindIni ;
|
|
|
|
|
|
public
|
|
|
{ Public declarations }
|
|
|
function get_outstrwhere:widestring;
|
|
|
end;
|
|
|
|
|
|
var
|
|
|
frm_rp_ch_Out_query: Tfrm_rp_ch_Out_query;
|
|
|
|
|
|
implementation
|
|
|
|
|
|
uses u_data_share,u_main ,my_sys_function;
|
|
|
|
|
|
{$R *.dfm}
|
|
|
|
|
|
procedure Tfrm_rp_ch_Out_query.bsSkinButton5Click(Sender: TObject);
|
|
|
begin
|
|
|
modalresult:=mrcancel ;
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_rp_ch_Out_query.FormShow(Sender: TObject);
|
|
|
begin
|
|
|
|
|
|
loadFindIni;
|
|
|
frm_data_share.t_crm_client_all.requery;
|
|
|
frm_data_share.t_sys_employee.requery;
|
|
|
frm_data_share.t_sys_department.requery;
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_rp_ch_Out_query.bsSkinButton10Click(Sender: TObject);
|
|
|
begin
|
|
|
wwDBDateTimePicker1.Clear;
|
|
|
wwDBDateTimePicker2.Clear;
|
|
|
wwDBDateTimePicker3.Clear;
|
|
|
wwDBDateTimePicker4.Clear;
|
|
|
RxDBLookupCombo4.ClearValue;
|
|
|
RxDBLookupCombo3.ClearValue;
|
|
|
RxDBLookupCombo6.ClearValue;
|
|
|
RxDBLookupCombo2.ClearValue;
|
|
|
RxDBLookupCombo10.ClearValue;
|
|
|
RxDBLookupCombo12.ClearValue;
|
|
|
RxDBLookupCombo15.ClearValue;
|
|
|
|
|
|
RxDBLookupCombo5.ClearValue;
|
|
|
RxDBLookupCombo1.ClearValue;
|
|
|
RxDBLookupCombo16.ClearValue;
|
|
|
wwDBComboBox44.Clear ;
|
|
|
wwDBComboBox49.Clear ;
|
|
|
edit1.Text:='';
|
|
|
edit9.Text:='';
|
|
|
end;
|
|
|
|
|
|
function Tfrm_rp_ch_Out_query.get_outstrwhere: widestring;
|
|
|
var
|
|
|
str_bill:widestring;
|
|
|
begin
|
|
|
writeFindIni;
|
|
|
str_bill:='where (1=1)' ;
|
|
|
str_bill:=query_tiaojian(1,str_bill,'v_op_bscard.<2E><><EFBFBD><EFBFBD><EFBFBD>ڼ<EFBFBD>',wwDBComboBox19.text,wwDBDateTimePicker3.text);
|
|
|
str_bill:=query_tiaojian(1,str_bill,'v_op_bscard.<2E><><EFBFBD><EFBFBD><EFBFBD>ڼ<EFBFBD>',wwDBComboBox11.text,wwDBDateTimePicker4.text);
|
|
|
str_bill:=query_tiaojian(1,str_bill,'v_op_bscard.<2E>ͷ<EFBFBD>Ա',wwDBComboBox24.text,RxDBLookupCombo4.DisplayValue);
|
|
|
str_bill:=query_tiaojian(1,str_bill,'v_op_bscard.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>',wwDBComboBox14.text,RxDBLookupCombo3.DisplayValue);
|
|
|
str_bill:=query_tiaojian(1,str_bill,'v_op_bscard.<2E><><EFBFBD><EFBFBD>Ա',wwDBComboBox25.text,RxDBLookupCombo6.DisplayValue);
|
|
|
str_bill:=query_tiaojian(1,str_bill,'v_op_bscard.<2E><><EFBFBD>۲<EFBFBD><DBB2><EFBFBD>',wwDBComboBox28.text,RxDBLookupCombo10.DisplayValue);
|
|
|
str_bill:=query_tiaojian(1,str_bill,'v_op_bscard.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>',wwDBComboBox29.text,RxDBLookupCombo12.DisplayValue);
|
|
|
str_bill:=query_tiaojian(2,str_bill,'v_op_bscard.<2E>ܴ<EFBFBD>',wwDBComboBox3.text,Edit1.text);
|
|
|
str_bill:=query_tiaojian(2,str_bill,'v_op_bscard.<2E>ܴ<EFBFBD>',wwDBComboBox38.text,Edit9.text);
|
|
|
str_bill:=query_tiaojian(1,str_bill,'v_op_bscard.ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>',wwDBComboBox43.text,wwDBComboBox44.text);
|
|
|
str_bill:=query_tiaojian(1,str_bill,'v_op_bscard.<2E>ֲ<EFBFBD><D6B2><EFBFBD><EFBFBD><EFBFBD>',wwDBComboBox45.text,RxDBLookupCombo15.DisplayValue);
|
|
|
str_bill:=query_tiaojian(1,str_bill,'v_op_bscard.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>',wwDBComboBox18.text,wwDBDateTimePicker1.text);
|
|
|
str_bill:=query_tiaojian(1,str_bill,'v_op_bscard.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>',wwDBComboBox6.text,wwDBDateTimePicker2.text);
|
|
|
str_bill:=query_tiaojian(1,str_bill,'v_op_bscard.ί<>е<EFBFBD>λ',wwDBComboBox21.text,RxDBLookupCombo2.DisplayValues[1]);
|
|
|
str_bill:=query_tiaojian(1,str_bill,'t_ch_fee.<2E>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>',wwDBComboBox13.text,RxDBLookupCombo5.DisplayValues[1]);
|
|
|
str_bill:=query_tiaojian(1,str_bill,'t_ch_fee.<2E>ұ<EFBFBD>',wwDBComboBox41.text,RxDBLookupCombo1.DisplayValues[0]);
|
|
|
str_bill:=query_tiaojian(1,str_bill,'t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>',wwDBComboBox42.text,RxDBLookupCombo16.DisplayValues[1]);
|
|
|
str_bill:=query_tiaojian(3,str_bill,'t_ch_fee.<2E>Ƿ<EFBFBD><C7B7>渶',wwDBComboBox48.text,wwDBComboBox49.text);
|
|
|
result:=str_bill ;
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_rp_ch_Out_query.bsSkinButton1Click(Sender: TObject);
|
|
|
begin
|
|
|
if (not chkoutamt.Checked) and (not chkoutdate.Checked)
|
|
|
and (not chkoutport.Checked) then
|
|
|
begin
|
|
|
showmessage('<27><><EFBFBD><EFBFBD>ѡ<EFBFBD><D1A1>һ<EFBFBD><D2BB>ͳ<EFBFBD>Ʒ<EFBFBD>Χ!');
|
|
|
exit ;
|
|
|
end ;
|
|
|
modalresult:=mrok ;
|
|
|
end;
|
|
|
procedure Tfrm_rp_ch_Out_query.loadFindIni;
|
|
|
var
|
|
|
findini:tinifile ;
|
|
|
mysec,tmpname:string;
|
|
|
canload:boolean ; //<2F>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD>
|
|
|
i:integer ;
|
|
|
begin
|
|
|
mysec:='1' ;
|
|
|
findini:=Tinifile.Create(ExtractFilePath(application.ExeName)+'rpoutquery.ini');
|
|
|
try
|
|
|
canload:=findini.ReadBool(mysec,mysec,false);
|
|
|
bsSkinCheckRadioBox1.Checked:=canload ;
|
|
|
if canload then
|
|
|
begin
|
|
|
with bsSkinGroupBox1 do
|
|
|
for i:=0 to ControlCount-1 do
|
|
|
begin
|
|
|
tmpname:=Controls[i].Name ;
|
|
|
if Controls[i] is TwwDBComboBox then
|
|
|
(Controls[i] as TwwDBComboBox).Text:=findini.ReadString(mysec,TmpName,'') else
|
|
|
if Controls[i] is TEdit then
|
|
|
(Controls[i] as TEdit).Text:=findini.ReadString(mysec,TmpName,'') else
|
|
|
if Controls[i] is TwwDBDateTimePicker then
|
|
|
(Controls[i] as TwwDBDateTimePicker).Date:=strtodate(findini.ReadString(mysec,TmpName,'')) else
|
|
|
if Controls[i] is TRxDBLookupCombo then
|
|
|
(Controls[i] as TRxDBLookupCombo).Value:=findini.ReadString(mysec,TmpName,'') ;
|
|
|
end ;
|
|
|
with bsSkinGroupBox4 do
|
|
|
for i:=0 to ControlCount-1 do
|
|
|
begin
|
|
|
tmpname:=Controls[i].Name ;
|
|
|
if Controls[i] is TwwDBComboBox then
|
|
|
(Controls[i] as TwwDBComboBox).Text:=findini.ReadString(mysec,TmpName,'') else
|
|
|
if Controls[i] is TEdit then
|
|
|
(Controls[i] as TEdit).Text:=findini.ReadString(mysec,TmpName,'') else
|
|
|
if Controls[i] is TwwDBDateTimePicker then
|
|
|
(Controls[i] as TwwDBDateTimePicker).Date:=strtodate(findini.ReadString(mysec,TmpName,'')) else
|
|
|
if Controls[i] is TRxDBLookupCombo then
|
|
|
(Controls[i] as TRxDBLookupCombo).Value:=findini.ReadString(mysec,TmpName,'') ;
|
|
|
end ;
|
|
|
|
|
|
end else
|
|
|
begin
|
|
|
wwDBComboBox18.text:='<27><><EFBFBD><EFBFBD>';
|
|
|
wwDBComboBox6.text:='С<><D0A1>';
|
|
|
wwDBComboBox11.text:='С<><D0A1>';
|
|
|
wwDBComboBox19.text:='<27><><EFBFBD><EFBFBD>';
|
|
|
wwDBComboBox21.text:='<27><><EFBFBD><EFBFBD>';
|
|
|
wwDBComboBox24.text:='<27><><EFBFBD><EFBFBD>';
|
|
|
wwDBComboBox25.text:='<27><><EFBFBD><EFBFBD>';
|
|
|
wwDBComboBox28.text:='<27><><EFBFBD><EFBFBD>';
|
|
|
wwDBComboBox29.text:='<27><><EFBFBD><EFBFBD>';
|
|
|
wwDBComboBox14.text:='<27><><EFBFBD><EFBFBD>';
|
|
|
wwDBComboBox3.text:='<27><><EFBFBD><EFBFBD>';
|
|
|
wwDBComboBox38.text:='<27><><EFBFBD><EFBFBD>';
|
|
|
|
|
|
wwDBComboBox13.text:='<27><><EFBFBD><EFBFBD>';
|
|
|
wwDBComboBox41.text:='<27><><EFBFBD><EFBFBD>';
|
|
|
wwDBComboBox42.text:='<27><><EFBFBD><EFBFBD>';
|
|
|
wwDBComboBox43.text:='<27><><EFBFBD><EFBFBD>';
|
|
|
wwDBComboBox45.text:='<27><><EFBFBD><EFBFBD>';
|
|
|
wwDBComboBox48.text:='<27><><EFBFBD><EFBFBD>';
|
|
|
end ;
|
|
|
finally
|
|
|
findini.free;
|
|
|
end ;
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_rp_ch_Out_query.writeFindIni;
|
|
|
var
|
|
|
findini:tinifile ;
|
|
|
mysec,tmpname:string;
|
|
|
canload:boolean ; //<2F>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD>
|
|
|
i:integer ;
|
|
|
begin
|
|
|
canload:=bsSkinCheckRadioBox1.Checked ;
|
|
|
mysec:='1' ;
|
|
|
findini:=Tinifile.Create(ExtractFilePath(application.ExeName)+'rpoutquery.ini');
|
|
|
try
|
|
|
findini.WriteBool(mysec,mysec,canload);
|
|
|
|
|
|
if canload then
|
|
|
begin
|
|
|
with bsSkinGroupBox1 do
|
|
|
for i:=0 to ControlCount-1 do
|
|
|
begin
|
|
|
tmpname:=Controls[i].Name ;
|
|
|
if Controls[i] is TwwDBComboBox then
|
|
|
findini.WriteString(mysec,TmpName,(Controls[i] as TwwDBComboBox).Text) else
|
|
|
if Controls[i] is TEdit then
|
|
|
findini.WriteString(mysec,TmpName,(Controls[i] as TEdit).Text) else
|
|
|
if Controls[i] is TwwDBDateTimePicker then
|
|
|
findini.WriteString(mysec,TmpName,datetostr((Controls[i] as TwwDBDateTimePicker).Date)) else
|
|
|
if Controls[i] is TRxDBLookupCombo then
|
|
|
findini.writeString(mysec,TmpName,(Controls[i] as TRxDBLookupCombo).Value) ;
|
|
|
end ;
|
|
|
with bsSkinGroupBox4 do
|
|
|
for i:=0 to ControlCount-1 do
|
|
|
begin
|
|
|
tmpname:=Controls[i].Name ;
|
|
|
if Controls[i] is TwwDBComboBox then
|
|
|
findini.WriteString(mysec,TmpName,(Controls[i] as TwwDBComboBox).Text) else
|
|
|
if Controls[i] is TEdit then
|
|
|
findini.WriteString(mysec,TmpName,(Controls[i] as TEdit).Text) else
|
|
|
if Controls[i] is TwwDBDateTimePicker then
|
|
|
findini.WriteString(mysec,TmpName,datetostr((Controls[i] as TwwDBDateTimePicker).Date)) else
|
|
|
if Controls[i] is TRxDBLookupCombo then
|
|
|
findini.writeString(mysec,TmpName,(Controls[i] as TRxDBLookupCombo).Value) ;
|
|
|
end ;
|
|
|
|
|
|
end ;
|
|
|
finally
|
|
|
findini.free;
|
|
|
end ;
|
|
|
end;
|
|
|
|
|
|
end.
|