551 lines
14 KiB
ObjectPascal
551 lines
14 KiB
ObjectPascal
unit U_CP_YDang_BJ;
|
||
|
||
interface
|
||
|
||
uses
|
||
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
|
||
Dialogs, ComCtrls, ToolWin, ExtCtrls, StdCtrls, DBClient, DB, ADODB,
|
||
cxStyles, cxCustomData, cxGraphics, cxFilter, cxData, cxDataStorage,
|
||
cxEdit, cxDBData, cxGridLevel, cxClasses, cxControls, cxGridCustomView,
|
||
cxGridCustomTableView, cxGridTableView, cxGridDBTableView, cxGrid,
|
||
cxGridCustomPopupMenu, cxGridPopupMenu, cxPC, cxCalendar, cxButtonEdit,
|
||
RM_System, RM_Common, RM_Class, RM_GridReport, RM_Dataset, RM_e_Xls;
|
||
|
||
type
|
||
TfrmCP_YDang_BJ = class(TForm)
|
||
Panel1: TPanel;
|
||
Label1: TLabel;
|
||
BegDate: TDateTimePicker;
|
||
EndDate: TDateTimePicker;
|
||
ADOQueryTmp: TADOQuery;
|
||
DataSource1: TDataSource;
|
||
contract_Main: TClientDataSet;
|
||
ADOQueryCmd: TADOQuery;
|
||
TV1: TcxGridDBTableView;
|
||
cxGrid1Level1: TcxGridLevel;
|
||
cxGrid1: TcxGrid;
|
||
ToolBar1: TToolBar;
|
||
TINIT: TToolButton;
|
||
Tglv: TToolButton;
|
||
Tadd: TToolButton;
|
||
Tupdate: TToolButton;
|
||
Tdel: TToolButton;
|
||
TSel: TToolButton;
|
||
Tchk: TToolButton;
|
||
TNochk: TToolButton;
|
||
TClose: TToolButton;
|
||
cxGridPopupMenu1: TcxGridPopupMenu;
|
||
cxTabControl1: TcxTabControl;
|
||
Label2: TLabel;
|
||
CustomerNoName: TEdit;
|
||
Label4: TLabel;
|
||
ConPerson1: TEdit;
|
||
V1PRTCodeName: TcxGridDBColumn;
|
||
V1PRTSpec: TcxGridDBColumn;
|
||
V1MFQty: TcxGridDBColumn;
|
||
V1KZQty: TcxGridDBColumn;
|
||
V1PRTOrderQty: TcxGridDBColumn;
|
||
V1OrderUnit: TcxGridDBColumn;
|
||
V1Note: TcxGridDBColumn;
|
||
TPrint: TToolButton;
|
||
RMReport: TRMGridReport;
|
||
RMDBMAIN: TRMDBDataSet;
|
||
order_print: TClientDataSet;
|
||
Label3: TLabel;
|
||
Label5: TLabel;
|
||
PRTCodeName: TEdit;
|
||
PRTSpec: TEdit;
|
||
V1CustomerNoName: TcxGridDBColumn;
|
||
V1ConPerson1: TcxGridDBColumn;
|
||
V1PRTCF: TcxGridDBColumn;
|
||
V1SOrdQty1: TcxGridDBColumn;
|
||
V1BJtime: TcxGridDBColumn;
|
||
V1SOrdQty5: TcxGridDBColumn;
|
||
V1SOrdQty6: TcxGridDBColumn;
|
||
V1SOrdQty7: TcxGridDBColumn;
|
||
V1SOrdQty8: TcxGridDBColumn;
|
||
V1SOrdQty9: TcxGridDBColumn;
|
||
V1SOrdQty10: TcxGridDBColumn;
|
||
V1SOrdQty11: TcxGridDBColumn;
|
||
V1SOrdQty12: TcxGridDBColumn;
|
||
V1SOrdQty13: TcxGridDBColumn;
|
||
V1SOrdQty2: TcxGridDBColumn;
|
||
V1BJPrice: TcxGridDBColumn;
|
||
V1PriceUnit: TcxGridDBColumn;
|
||
V1CBPrice: TcxGridDBColumn;
|
||
V1PBSPEC: TcxGridDBColumn;
|
||
V1PBMF: TcxGridDBColumn;
|
||
V1PBKZ: TcxGridDBColumn;
|
||
V1PRTCode: TcxGridDBColumn;
|
||
V1BJXS: TcxGridDBColumn;
|
||
V1CustomerNo: TcxGridDBColumn;
|
||
Panel4: TPanel;
|
||
Label14: TLabel;
|
||
Panel10: TPanel;
|
||
Image2: TImage;
|
||
Button1: TButton;
|
||
RadioGroup1: TRadioGroup;
|
||
V1QDLQty: TcxGridDBColumn;
|
||
RMXLSExport1: TRMXLSExport;
|
||
Label6: TLabel;
|
||
PRTCode: TEdit;
|
||
procedure TSelClick(Sender: TObject);
|
||
procedure TCloseClick(Sender: TObject);
|
||
procedure FormCreate(Sender: TObject);
|
||
procedure FormDestroy(Sender: TObject);
|
||
procedure FormClose(Sender: TObject; var Action: TCloseAction);
|
||
procedure TaddClick(Sender: TObject);
|
||
procedure TupdateClick(Sender: TObject);
|
||
procedure TdelClick(Sender: TObject);
|
||
procedure TglvClick(Sender: TObject);
|
||
procedure TINITClick(Sender: TObject);
|
||
procedure TchkClick(Sender: TObject);
|
||
procedure FormShow(Sender: TObject);
|
||
procedure CustomerNoNameChange(Sender: TObject);
|
||
procedure TNochkClick(Sender: TObject);
|
||
procedure TV1CellDblClick(Sender: TcxCustomGridTableView;
|
||
ACellViewInfo: TcxGridTableDataCellViewInfo; AButton: TMouseButton;
|
||
AShift: TShiftState; var AHandled: Boolean);
|
||
procedure TPrintClick(Sender: TObject);
|
||
procedure cxTabControl1Change(Sender: TObject);
|
||
procedure Button1Click(Sender: TObject);
|
||
procedure Image2Click(Sender: TObject);
|
||
procedure PRTCodeKeyPress(Sender: TObject; var Key: Char);
|
||
procedure CustomerNoNameKeyPress(Sender: TObject; var Key: Char);
|
||
private
|
||
procedure INITDATa();
|
||
procedure SetStatus();
|
||
{ Private declarations }
|
||
public
|
||
ftype,fDParameters1:string;
|
||
{ Public declarations }
|
||
end;
|
||
|
||
var
|
||
frmCP_YDang_BJ: TfrmCP_YDang_BJ;
|
||
|
||
implementation
|
||
|
||
uses U_Fun,U_DataLink, U_ZDYHelp, U_CP_YDang_BJ_Sub;
|
||
|
||
{$R *.dfm}
|
||
procedure TfrmCP_YDang_BJ.SetStatus();
|
||
begin
|
||
tchk.Visible:=false;
|
||
tnochk.Visible:=false;
|
||
Tupdate.Visible:=false;
|
||
tdel.Visible:=false;
|
||
V1BJPrice.Visible:=False;
|
||
V1SOrdQty1.Visible:=False;
|
||
V1CBPrice.Visible:=False;
|
||
V1SOrdQty2.Visible:=False;
|
||
V1SOrdQty5.Visible:=false;
|
||
V1SOrdQty6.Visible:=false;
|
||
V1SOrdQty7.Visible:=false;
|
||
V1SOrdQty8.Visible:=false;
|
||
V1SOrdQty9.Visible:=false;
|
||
V1SOrdQty10.Visible:=false;
|
||
V1SOrdQty11.Visible:=false;
|
||
V1SOrdQty12.Visible:=false;
|
||
V1SOrdQty13.Visible:=false;
|
||
V1PBSPEC.Visible:=False;
|
||
V1PBMF.Visible:=False;
|
||
V1PBKZ.Visible:=False;
|
||
V1BJXS.visible:=False;
|
||
if Trim(fDParameters1)='' then
|
||
begin
|
||
case cxTabControl1.TabIndex of
|
||
0:begin
|
||
Tupdate.Visible:=true;
|
||
tdel.Visible:=true;
|
||
end;
|
||
1:begin
|
||
V1BJPrice.Visible:=True;
|
||
end;
|
||
2:begin
|
||
//V1BJPrice.Visible:=True;
|
||
end;
|
||
end;
|
||
|
||
end;
|
||
if Trim(fDParameters1)='<27><>Ȩ<EFBFBD><C8A8>' then
|
||
begin
|
||
cxTabControl1.Visible:=True;
|
||
V1SOrdQty1.Visible:=True;
|
||
V1SOrdQty5.Visible:=True;
|
||
V1SOrdQty6.Visible:=True;
|
||
V1SOrdQty7.Visible:=True;
|
||
V1SOrdQty8.Visible:=True;
|
||
V1SOrdQty9.Visible:=True;
|
||
V1BJPrice.Visible:=True;
|
||
V1SOrdQty10.Visible:=True;
|
||
V1SOrdQty11.Visible:=True;
|
||
V1SOrdQty12.Visible:=True;
|
||
V1SOrdQty13.Visible:=True;
|
||
V1CBPrice.Visible:=True;
|
||
V1SOrdQty2.Visible:=True;
|
||
V1PBSPEC.Visible:=True;
|
||
V1PBMF.Visible:=True;
|
||
V1PBKZ.Visible:=True;
|
||
V1BJXS.visible:=True;
|
||
case cxTabControl1.TabIndex of
|
||
0:begin
|
||
tchk.Visible:=true;
|
||
Tupdate.Visible:=true;
|
||
tdel.Visible:=true;
|
||
|
||
end;
|
||
1:begin
|
||
tnochk.Visible:=true;
|
||
|
||
end;
|
||
2:begin
|
||
|
||
end;
|
||
end;
|
||
end;
|
||
{if Trim(fDParameters1)='<27><>ѯ' then
|
||
begin
|
||
Tadd.Visible:=False;
|
||
TPrint.visible:=False;
|
||
V1SOrdQty5.Visible:=False;
|
||
V1SOrdQty6.Visible:=False;
|
||
V1SOrdQty7.Visible:=False;
|
||
V1SOrdQty8.Visible:=False;
|
||
V1SOrdQty9.Visible:=False;
|
||
V1SOrdQty10.Visible:=False;
|
||
V1SOrdQty11.Visible:=False;
|
||
V1SOrdQty12.Visible:=False;
|
||
V1SOrdQty13.Visible:=False;
|
||
end;}
|
||
end;
|
||
|
||
procedure TfrmCP_YDang_BJ.INITDATa();
|
||
begin
|
||
with ADOQueryTmp do
|
||
begin
|
||
close;
|
||
sql.Clear;
|
||
sql.Add('select a.*,b.* from CP_YDang_BJ_Main a ');
|
||
sql.Add('inner join CP_YDang_BJ_Sub b on b.Mainid=a.Mainid ');
|
||
sql.Add('where a.filltime>='''+formatdatetime('yyyy-MM-dd',begdate.datetime)+'''' );
|
||
sql.Add('and a.filltime<'''+formatdatetime('yyyy-MM-dd',Enddate.datetime+1)+'''' );
|
||
if Trim(fDParameters1)<>'<27><>Ȩ<EFBFBD><C8A8>' then
|
||
Begin
|
||
sql.add('and A.ConPerson1='''+trim(DName)+''' ');
|
||
end;
|
||
if cxTabControl1.TabIndex=0 then
|
||
sql.Add('and isnull(a.status,''0'')=''0'' ');
|
||
if cxTabControl1.TabIndex=1 then
|
||
sql.Add('and isnull(a.status,''0'')=''1'' ');
|
||
open;
|
||
end;
|
||
SCreateCDS20(ADOQueryTmp,contract_Main);
|
||
SInitCDSData20(ADOQueryTmp,contract_Main);
|
||
end;
|
||
|
||
procedure TfrmCP_YDang_BJ.TSelClick(Sender: TObject);
|
||
begin
|
||
if contract_Main.IsEmpty then exit;
|
||
try
|
||
frmCP_YDang_BJ_Sub:=TfrmCP_YDang_BJ_Sub.create(self);
|
||
with frmCP_YDang_BJ_Sub do
|
||
begin
|
||
formid:=2;
|
||
FMainid:=trim(self.contract_Main.fieldbyname('Mainid').asstring);
|
||
Tsave.Visible:=False;
|
||
ToolBar2.Visible:=False;
|
||
Panel1.Enabled:=False;
|
||
TV1.OptionsData.Editing:=False;
|
||
TV1.OptionsData.Deleting:=False;
|
||
if showmodal=1 then
|
||
begin
|
||
INITDATa();
|
||
end;
|
||
end;
|
||
finally
|
||
frmCP_YDang_BJ_Sub.Free;
|
||
end;
|
||
end;
|
||
|
||
procedure TfrmCP_YDang_BJ.TCloseClick(Sender: TObject);
|
||
begin
|
||
close;
|
||
WriteCxGrid(self.Caption+tv1.Name,Tv1);
|
||
end;
|
||
|
||
procedure TfrmCP_YDang_BJ.FormCreate(Sender: TObject);
|
||
begin
|
||
cxgrid1.Align:=alclient;
|
||
end;
|
||
|
||
procedure TfrmCP_YDang_BJ.FormDestroy(Sender: TObject);
|
||
begin
|
||
frmCP_YDang_BJ:=nil;
|
||
end;
|
||
|
||
procedure TfrmCP_YDang_BJ.FormClose(Sender: TObject;
|
||
var Action: TCloseAction);
|
||
begin
|
||
action:=cafree;
|
||
end;
|
||
|
||
procedure TfrmCP_YDang_BJ.TaddClick(Sender: TObject);
|
||
begin
|
||
try
|
||
frmCP_YDang_BJ_Sub:=TfrmCP_YDang_BJ_Sub.create(self);
|
||
with frmCP_YDang_BJ_Sub do
|
||
begin
|
||
formid:=0;
|
||
FMainid:='';
|
||
if showmodal=1 then
|
||
begin
|
||
INITDATa();
|
||
end;
|
||
end;
|
||
finally
|
||
frmCP_YDang_BJ_Sub.Free;
|
||
end;
|
||
end;
|
||
|
||
procedure TfrmCP_YDang_BJ.TupdateClick(Sender: TObject);
|
||
begin
|
||
if contract_Main.IsEmpty then exit;
|
||
with ADOQueryTmp do
|
||
begin
|
||
close;
|
||
sql.Clear;
|
||
sql.add('select Status from CP_YDang_BJ_Main ');
|
||
sql.add(' where Mainid='''+trim(contract_Main.fieldbyname('Mainid').asstring)+''' ');
|
||
open;
|
||
if fieldbyname('status').asstring='2' then
|
||
begin
|
||
application.MessageBox('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>','');
|
||
exit;
|
||
end;
|
||
end;
|
||
try
|
||
frmCP_YDang_BJ_Sub:=TfrmCP_YDang_BJ_Sub.create(self);
|
||
with frmCP_YDang_BJ_Sub do
|
||
begin
|
||
formid:=1;
|
||
FMainid:=trim(self.contract_Main.fieldbyname('Mainid').asstring);
|
||
if showmodal=1 then
|
||
begin
|
||
INITDATa();
|
||
end;
|
||
end;
|
||
finally
|
||
frmCP_YDang_BJ_Sub.Free;
|
||
end;
|
||
end;
|
||
|
||
procedure TfrmCP_YDang_BJ.TdelClick(Sender: TObject);
|
||
begin
|
||
if contract_Main.IsEmpty then exit;
|
||
with ADOQueryTmp do
|
||
begin
|
||
close;
|
||
sql.Clear;
|
||
sql.add('select Status from CP_YDang_BJ_Main ');
|
||
sql.add(' where Mainid='''+trim(contract_Main.fieldbyname('Mainid').asstring)+''' ');
|
||
open;
|
||
if fieldbyname('status').asstring='2' then
|
||
begin
|
||
application.MessageBox('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>','');
|
||
exit;
|
||
end;
|
||
end;
|
||
if Application.MessageBox('ȷ<><C8B7>Ҫɾ<D2AA><C9BE><EFBFBD><EFBFBD>','<27><>ʾ',1)=2 then Exit;
|
||
with ADOQueryTmp do
|
||
begin
|
||
close;
|
||
sql.Clear;
|
||
sql.add('delete from CP_YDang_BJ_Main where Mainid='''+trim(contract_Main.fieldbyname('Mainid').AsString)+'''');
|
||
execsql;
|
||
end;
|
||
INITDATa();
|
||
end;
|
||
|
||
procedure TfrmCP_YDang_BJ.TglvClick(Sender: TObject);
|
||
begin
|
||
SDofilter(ADOQueryTMP,SGetFilters(Panel1,1,2));
|
||
SCreateCDS20(ADOQueryTMP,CONTRACT_Main);
|
||
SInitCDSData20(ADOQueryTMP,contract_Main);
|
||
end;
|
||
|
||
procedure TfrmCP_YDang_BJ.TINITClick(Sender: TObject);
|
||
begin
|
||
INITDATa();
|
||
end;
|
||
|
||
procedure TfrmCP_YDang_BJ.TchkClick(Sender: TObject);
|
||
begin
|
||
if contract_Main.IsEmpty then exit;
|
||
try
|
||
with ADOQueryTmp do
|
||
begin
|
||
close;
|
||
sql.Clear;
|
||
sql.Add('update CP_YDang_BJ_Main set status=''2'',chktime=getdate(),chker='+quotedstr(trim(Dname)) );
|
||
sql.Add(' where Mainid='''+trim(contract_Main.fieldbyname('Mainid').asstring)+'''');
|
||
execsql;
|
||
end;
|
||
application.MessageBox('<27><><EFBFBD>˳ɹ<CBB3>','<27><>ʾ');
|
||
initdata();
|
||
except
|
||
application.messagebox('<27><><EFBFBD><EFBFBD>ʧ<EFBFBD><CAA7>','<27><>ʾ');
|
||
end;
|
||
end;
|
||
|
||
procedure TfrmCP_YDang_BJ.FormShow(Sender: TObject);
|
||
begin
|
||
ReadCxGrid(self.Caption+tv1.Name,Tv1);
|
||
enddate.datetime:=SGetServerDateTime(ADOQueryTmp);
|
||
begdate.datetime:=enddate.datetime-7;
|
||
SetStatus();
|
||
initdata();
|
||
end;
|
||
|
||
procedure TfrmCP_YDang_BJ.CustomerNoNameChange(Sender: TObject);
|
||
begin
|
||
SDofilter(ADOQueryTMP,SGetFilters(Panel1,1,2));
|
||
SCreateCDS20(ADOQueryTMP,CONTRACT_Main);
|
||
SInitCDSData20(ADOQueryTMP,contract_Main);
|
||
end;
|
||
|
||
procedure TfrmCP_YDang_BJ.TNochkClick(Sender: TObject);
|
||
begin
|
||
if contract_Main.IsEmpty then exit;
|
||
try
|
||
with ADOQueryTmp do
|
||
begin
|
||
close;
|
||
sql.Clear;
|
||
sql.Add('update CP_YDang_BJ_Main set status=''1'',chktime=null,chker=null ');
|
||
sql.Add(' where Mainid='''+trim(contract_Main.fieldbyname('Mainid').asstring)+'''');
|
||
execsql;
|
||
end;
|
||
application.MessageBox('<27><><EFBFBD><EFBFBD><EFBFBD>ɹ<EFBFBD>','<27><>ʾ');
|
||
initdata();
|
||
except
|
||
application.messagebox('<27><><EFBFBD><EFBFBD>ʧ<EFBFBD><CAA7>','<27><>ʾ');
|
||
end;
|
||
end;
|
||
|
||
procedure TfrmCP_YDang_BJ.TV1CellDblClick(
|
||
Sender: TcxCustomGridTableView;
|
||
ACellViewInfo: TcxGridTableDataCellViewInfo; AButton: TMouseButton;
|
||
AShift: TShiftState; var AHandled: Boolean);
|
||
begin
|
||
Tsel.Click;
|
||
end;
|
||
|
||
procedure TfrmCP_YDang_BJ.TPrintClick(Sender: TObject);
|
||
begin
|
||
if contract_Main.IsEmpty then exit;
|
||
Panel4.Visible:=True;
|
||
end;
|
||
|
||
procedure TfrmCP_YDang_BJ.cxTabControl1Change(Sender: TObject);
|
||
begin
|
||
SetStatus();
|
||
initdata();
|
||
end;
|
||
|
||
procedure TfrmCP_YDang_BJ.Button1Click(Sender: TObject);
|
||
begin
|
||
try
|
||
with ADOQueryTmp do
|
||
begin
|
||
close;
|
||
sql.Clear;
|
||
sql.Add('select a.*,b.*,TP.FilesOther from CP_YDang_BJ_Main a ');
|
||
sql.Add('inner join CP_YDang_BJ_Sub b on b.Mainid=a.Mainid ');
|
||
sql.add('left join TP_File TP on TP.WBID=B.SOrddefstr1 ');
|
||
sql.Add('where a.Mainid='''+trim(contract_Main.fieldbyname('Mainid').AsString)+'''');
|
||
open;
|
||
end;
|
||
SCreateCDS20(ADOQueryTmp,order_print);
|
||
SInitCDSData20(ADOQueryTmp,order_print);
|
||
if RadioGroup1.ItemIndex=0 then
|
||
RMReport.LoadFromFile(ExtractFilePath(Application.ExeName) + 'Report\<5C><>Ʒ<EFBFBD><C6B7><EFBFBD>۵<EFBFBD>(<28><><EFBFBD><EFBFBD>).rmf')
|
||
else
|
||
RMReport.LoadFromFile(ExtractFilePath(Application.ExeName) + 'Report\<5C><>Ʒ<EFBFBD><C6B7><EFBFBD>۵<EFBFBD>(Ӣ<><D3A2>).rmf');
|
||
RMReport.ShowReport;
|
||
except
|
||
application.MessageBox('<27><>ʾ<EFBFBD><CABE><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ӡʧ<D3A1><CAA7>','<27><>ʾ');
|
||
exit;
|
||
end;
|
||
end;
|
||
|
||
procedure TfrmCP_YDang_BJ.Image2Click(Sender: TObject);
|
||
begin
|
||
Panel4.Visible:=False;
|
||
end;
|
||
|
||
procedure TfrmCP_YDang_BJ.PRTCodeKeyPress(Sender: TObject; var Key: Char);
|
||
begin
|
||
if key=#13 then
|
||
begin
|
||
with ADOQueryTmp do
|
||
begin
|
||
close;
|
||
sql.Clear;
|
||
sql.Add('select a.*,b.* from CP_YDang_BJ_Main a ');
|
||
sql.Add('inner join CP_YDang_BJ_Sub b on b.Mainid=a.Mainid ');
|
||
sql.Add('where B.PRTCode like '''+'%'+Trim(PRTCode.Text)+'%'+''' ');
|
||
if Trim(fDParameters1)<>'<27><>Ȩ<EFBFBD><C8A8>' then
|
||
Begin
|
||
sql.add('and A.ConPerson1='''+trim(DName)+''' ');
|
||
if cxTabControl1.TabIndex=0 then
|
||
sql.Add('and a.status<>2 ');
|
||
end
|
||
else
|
||
begin
|
||
if cxTabControl1.TabIndex=0 then
|
||
sql.Add('and a.status=1 ');
|
||
end;
|
||
if cxTabControl1.TabIndex=1 then
|
||
sql.Add('and a.status=2 ');
|
||
open;
|
||
end;
|
||
SCreateCDS20(ADOQueryTmp,contract_Main);
|
||
SInitCDSData20(ADOQueryTmp,contract_Main);
|
||
end;
|
||
end;
|
||
|
||
procedure TfrmCP_YDang_BJ.CustomerNoNameKeyPress(Sender: TObject;
|
||
var Key: Char);
|
||
begin
|
||
if key=#13 then
|
||
begin
|
||
with ADOQueryTmp do
|
||
begin
|
||
close;
|
||
sql.Clear;
|
||
sql.Add('select a.*,b.* from CP_YDang_BJ_Main a ');
|
||
sql.Add('inner join CP_YDang_BJ_Sub b on b.Mainid=a.Mainid ');
|
||
sql.Add('where A.CustomerNoName like '''+'%'+Trim(CustomerNoName.Text)+'%'+''' ');
|
||
if Trim(fDParameters1)<>'<27><>Ȩ<EFBFBD><C8A8>' then
|
||
Begin
|
||
sql.add('and A.ConPerson1='''+trim(DName)+''' ');
|
||
if cxTabControl1.TabIndex=0 then
|
||
sql.Add('and a.status<>2 ');
|
||
end
|
||
else
|
||
begin
|
||
if cxTabControl1.TabIndex=0 then
|
||
sql.Add('and a.status=1 ');
|
||
end;
|
||
if cxTabControl1.TabIndex=1 then
|
||
sql.Add('and a.status=2 ');
|
||
open;
|
||
end;
|
||
SCreateCDS20(ADOQueryTmp,contract_Main);
|
||
SInitCDSData20(ADOQueryTmp,contract_Main);
|
||
end;
|
||
end;
|
||
|
||
end.
|