456 lines
13 KiB
ObjectPascal
456 lines
13 KiB
ObjectPascal
|
|
unit U_JYOrderCon_CX;
|
|||
|
|
|
|||
|
|
interface
|
|||
|
|
|
|||
|
|
uses
|
|||
|
|
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
|
|||
|
|
Dialogs, StdCtrls, ExtCtrls, ComCtrls, ToolWin, cxStyles, cxCustomData,
|
|||
|
|
cxGraphics, cxFilter, cxData, cxDataStorage, cxEdit, DB, cxDBData, ADODB,
|
|||
|
|
cxGridCustomPopupMenu, cxGridPopupMenu, cxGridLevel, cxClasses,
|
|||
|
|
cxControls, cxGridCustomView, cxGridCustomTableView, cxGridTableView,
|
|||
|
|
cxGridDBTableView, cxGrid, DBClient, cxCheckBox, cxCalendar, cxSplitter,
|
|||
|
|
RM_Dataset, RM_System, RM_Common, RM_Class, RM_GridReport, RM_e_Xls,
|
|||
|
|
Menus, cxLookAndFeels, cxLookAndFeelPainters, cxNavigator;
|
|||
|
|
|
|||
|
|
type
|
|||
|
|
TfrmJYorderConCX = class(TForm)
|
|||
|
|
ToolBar1: TToolBar;
|
|||
|
|
TBRafresh: TToolButton;
|
|||
|
|
TBFind: TToolButton;
|
|||
|
|
TBClose: TToolButton;
|
|||
|
|
Panel1: TPanel;
|
|||
|
|
BegDate: TDateTimePicker;
|
|||
|
|
EndDate: TDateTimePicker;
|
|||
|
|
Label1: TLabel;
|
|||
|
|
cxGridPopupMenu1: TcxGridPopupMenu;
|
|||
|
|
ADOQueryCmd: TADOQuery;
|
|||
|
|
ADOQueryMain: TADOQuery;
|
|||
|
|
ADOQueryTemp: TADOQuery;
|
|||
|
|
DataSource1: TDataSource;
|
|||
|
|
Order_Main: TClientDataSet;
|
|||
|
|
RM1: TRMGridReport;
|
|||
|
|
RMDBMain: TRMDBDataSet;
|
|||
|
|
RMXLSExport1: TRMXLSExport;
|
|||
|
|
Label4: TLabel;
|
|||
|
|
CustomerNoName: TEdit;
|
|||
|
|
PopupMenu1: TPopupMenu;
|
|||
|
|
N2: TMenuItem;
|
|||
|
|
Label7: TLabel;
|
|||
|
|
BNo: TEdit;
|
|||
|
|
Label8: TLabel;
|
|||
|
|
GCName: TEdit;
|
|||
|
|
Label9: TLabel;
|
|||
|
|
ConNo: TEdit;
|
|||
|
|
ADOQueryPrint: TADOQuery;
|
|||
|
|
CDS_Print: TClientDataSet;
|
|||
|
|
ToolButton3: TToolButton;
|
|||
|
|
TSsel: TToolButton;
|
|||
|
|
cxGrid1: TcxGrid;
|
|||
|
|
Tv1: TcxGridDBTableView;
|
|||
|
|
v1OrdDate: TcxGridDBColumn;
|
|||
|
|
v1ConNo: TcxGridDBColumn;
|
|||
|
|
v1YWY: TcxGridDBColumn;
|
|||
|
|
v1CustomerNoName: TcxGridDBColumn;
|
|||
|
|
v1GCName: TcxGridDBColumn;
|
|||
|
|
v1FLQty: TcxGridDBColumn;
|
|||
|
|
v1GLQty: TcxGridDBColumn;
|
|||
|
|
cxGrid1Level1: TcxGridLevel;
|
|||
|
|
v1BNo: TcxGridDBColumn;
|
|||
|
|
v1Ssel: TcxGridDBColumn;
|
|||
|
|
procedure FormDestroy(Sender: TObject);
|
|||
|
|
procedure FormClose(Sender: TObject; var Action: TCloseAction);
|
|||
|
|
procedure FormCreate(Sender: TObject);
|
|||
|
|
procedure TBCloseClick(Sender: TObject);
|
|||
|
|
procedure TBFindClick(Sender: TObject);
|
|||
|
|
procedure TBRafreshClick(Sender: TObject);
|
|||
|
|
procedure OrderNoMChange(Sender: TObject);
|
|||
|
|
procedure FormShow(Sender: TObject);
|
|||
|
|
procedure TBTPClick(Sender: TObject);
|
|||
|
|
procedure CheckBox1Click(Sender: TObject);
|
|||
|
|
procedure CheckBox2Click(Sender: TObject);
|
|||
|
|
procedure Tv1StylesGetContentStyle(Sender: TcxCustomGridTableView;
|
|||
|
|
ARecord: TcxCustomGridRecord; AItem: TcxCustomGridTableItem;
|
|||
|
|
out AStyle: TcxStyle);
|
|||
|
|
procedure v1DeliveryDateCustomDrawCell(Sender: TcxCustomGridTableView;
|
|||
|
|
ACanvas: TcxCanvas; AViewInfo: TcxGridTableDataCellViewInfo;
|
|||
|
|
var ADone: Boolean);
|
|||
|
|
procedure N1Click(Sender: TObject);
|
|||
|
|
procedure N2Click(Sender: TObject);
|
|||
|
|
procedure ToolButton3Click(Sender: TObject);
|
|||
|
|
procedure Tv1CellDblClick(Sender: TcxCustomGridTableView;
|
|||
|
|
ACellViewInfo: TcxGridTableDataCellViewInfo; AButton: TMouseButton;
|
|||
|
|
AShift: TShiftState; var AHandled: Boolean);
|
|||
|
|
procedure ConNoKeyPress(Sender: TObject; var Key: Char);
|
|||
|
|
procedure TSselClick(Sender: TObject);
|
|||
|
|
procedure GCNameKeyPress(Sender: TObject; var Key: Char);
|
|||
|
|
private
|
|||
|
|
DQdate:TDateTime;
|
|||
|
|
procedure InitGrid();
|
|||
|
|
procedure InitForm();
|
|||
|
|
function DelData():Boolean;
|
|||
|
|
procedure InitGridFH();
|
|||
|
|
{ Private declarations }
|
|||
|
|
public
|
|||
|
|
FFInt,FCloth:Integer;
|
|||
|
|
fsyrName,canshu3,formid,canshu1,FConNO:string;
|
|||
|
|
|
|||
|
|
{ Public declarations }
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
var
|
|||
|
|
frmJYorderConCX: TfrmJYorderConCX;
|
|||
|
|
|
|||
|
|
implementation
|
|||
|
|
uses
|
|||
|
|
U_DataLink,U_Fun, U_ConInPut_CX;
|
|||
|
|
|
|||
|
|
{$R *.dfm}
|
|||
|
|
|
|||
|
|
procedure TfrmJYorderConCX.FormDestroy(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
frmJYorderConCX:=nil;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmJYorderConCX.FormClose(Sender: TObject;
|
|||
|
|
var Action: TCloseAction);
|
|||
|
|
begin
|
|||
|
|
Action:=caFree;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmJYorderConCX.FormCreate(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
cxgrid1.Align:=alClient;
|
|||
|
|
//BegDate.DateTime:=SGetServerDateTime(ADOQueryTemp)-7;
|
|||
|
|
//EndDate.DateTime:=SGetServerDateTime(ADOQueryTemp);
|
|||
|
|
DQdate:=SGetServerDate(ADOQueryTemp);
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmJYorderConCX.TBCloseClick(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
Close;
|
|||
|
|
WriteCxGrid('<27><>ͬ<EFBFBD>б<EFBFBD>ѡ<EFBFBD><D1A1>1sf',Tv1,'<27><>ͬ<EFBFBD><CDAC><EFBFBD><EFBFBD>');
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmJYorderConCX.InitGrid();
|
|||
|
|
begin
|
|||
|
|
|
|||
|
|
try
|
|||
|
|
ADOQueryMain.DisableControls;
|
|||
|
|
with ADOQueryMain do
|
|||
|
|
begin
|
|||
|
|
Filtered:=False;
|
|||
|
|
Close;
|
|||
|
|
sql.Clear;
|
|||
|
|
sql.add('select A.*,B.* ') ;
|
|||
|
|
sql.add('from JYorderCon_Main A ');
|
|||
|
|
sql.add('inner join JYOrderCon_Sub B on B.Mainid=A.Mainid ');
|
|||
|
|
sql.add('where 1=1 ');
|
|||
|
|
if formid<>'3' then
|
|||
|
|
begin
|
|||
|
|
SQL.ADD('and A.filltime>='''+trim(formatdatetime('yyyy-MM-dd',begdate.DateTime))+''' ');
|
|||
|
|
sql.add('and A.filltime<'''+trim(formatdatetime('yyyy-MM-dd',Enddate.DateTime+1))+''' ');
|
|||
|
|
end;
|
|||
|
|
if Trim(FConNO)<>'' then
|
|||
|
|
begin
|
|||
|
|
sql.add(' and A.ConNO='''+trim(FConNO)+'''');
|
|||
|
|
end;
|
|||
|
|
Open;
|
|||
|
|
end;
|
|||
|
|
SCreateCDS20(ADOQueryMain,Order_Main);
|
|||
|
|
SInitCDSData20(ADOQueryMain,Order_Main);
|
|||
|
|
finally;
|
|||
|
|
ADOQueryMain.EnableControls;
|
|||
|
|
//TBFind.Click;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmJYorderConCX.InitGridFH();
|
|||
|
|
begin
|
|||
|
|
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmJYorderConCX.InitForm();
|
|||
|
|
begin
|
|||
|
|
ReadCxGrid('<27><>ͬ<EFBFBD>б<EFBFBD>ѡ<EFBFBD><D1A1>1sf',Tv1,'<27><>ͬ<EFBFBD><CDAC><EFBFBD><EFBFBD>');
|
|||
|
|
BegDate.DateTime:=SGetServerDate10(ADOQueryTemp)-7;
|
|||
|
|
EndDate.DateTime:=SGetServerDate10(ADOQueryTemp);
|
|||
|
|
v1Ssel.Visible:=true;
|
|||
|
|
ToolButton3.Visible:=true;
|
|||
|
|
if formid='3' then
|
|||
|
|
begin
|
|||
|
|
v1Ssel.Visible:=false;
|
|||
|
|
ToolButton3.Visible:=false;
|
|||
|
|
end;
|
|||
|
|
InitGrid();
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmJYorderConCX.TBFindClick(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
if ADOQueryMain.Active=False then Exit;
|
|||
|
|
SDofilter(ADOQueryMain,SGetFilters(Panel1,1,2));
|
|||
|
|
SCreateCDS20(ADOQueryMain,Order_Main);
|
|||
|
|
SInitCDSData20(ADOQueryMain,Order_Main);
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
function TfrmJYorderConCX.DelData():Boolean;
|
|||
|
|
begin
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmJYorderConCX.TBRafreshClick(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
FConNO:='';
|
|||
|
|
InitGrid();
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmJYorderConCX.OrderNoMChange(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
if ADOQueryMain.Active=False then Exit;
|
|||
|
|
SDofilter(ADOQueryMain,SGetFilters(Panel1,1,2));
|
|||
|
|
SCreateCDS20(ADOQueryMain,Order_Main);
|
|||
|
|
SInitCDSData20(ADOQueryMain,Order_Main);
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmJYorderConCX.FormShow(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
InitForm();
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmJYorderConCX.TBTPClick(Sender: TObject);
|
|||
|
|
var
|
|||
|
|
FQty,FQty1,FMxQty,FPQty,FMxQtyS,FPQtyS:String;
|
|||
|
|
begin
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmJYorderConCX.CheckBox1Click(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
InitGrid();
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmJYorderConCX.CheckBox2Click(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
TBRafresh.Click;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmJYorderConCX.Tv1StylesGetContentStyle(
|
|||
|
|
Sender: TcxCustomGridTableView; ARecord: TcxCustomGridRecord;
|
|||
|
|
AItem: TcxCustomGridTableItem; out AStyle: TcxStyle);
|
|||
|
|
var
|
|||
|
|
id,id10:Integer;
|
|||
|
|
begin
|
|||
|
|
{try
|
|||
|
|
if Tv1.GroupedItemCount=0 then
|
|||
|
|
begin
|
|||
|
|
Id:=Tv1.GetColumnByFieldName('DeliveryDate').Index-tv1.GroupedItemCount;
|
|||
|
|
Id10:=Tv1.GetColumnByFieldName('SubStatus').Index-tv1.GroupedItemCount;
|
|||
|
|
if Trim(VarToStr(ARecord.Values[id]))='' then Exit;
|
|||
|
|
if Id<0 then Exit;
|
|||
|
|
if ARecord.Values[id10]='<27><><EFBFBD><EFBFBD>' then exit;
|
|||
|
|
if (ARecord.Values[id]-DQdate)>=4 then Exit;
|
|||
|
|
if ((ARecord.Values[id]-DQdate)>=0) and ((ARecord.Values[id]-DQdate)<4) then
|
|||
|
|
AStyle:=DataLink_.QHuangSe
|
|||
|
|
else
|
|||
|
|
if ARecord.Values[id]-DQdate<0 then
|
|||
|
|
begin
|
|||
|
|
AStyle:=DataLink_OrderManage.FenHongS;
|
|||
|
|
end;
|
|||
|
|
end else
|
|||
|
|
begin
|
|||
|
|
|
|||
|
|
end;
|
|||
|
|
except
|
|||
|
|
end; }
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmJYorderConCX.v1DeliveryDateCustomDrawCell(
|
|||
|
|
Sender: TcxCustomGridTableView; ACanvas: TcxCanvas;
|
|||
|
|
AViewInfo: TcxGridTableDataCellViewInfo; var ADone: Boolean);
|
|||
|
|
begin
|
|||
|
|
{ Id:=TV1.GetColumnByFieldName('DeliveryDate').Index;//;-TV1.GroupedItemCount;
|
|||
|
|
Id10:=TV1.GetColumnByFieldName('SubStatus').Index;
|
|||
|
|
if Id<0 then Exit;
|
|||
|
|
if AViewInfo.GridRecord.Values[Id10]='<27><><EFBFBD><EFBFBD>' then Exit;
|
|||
|
|
if AViewInfo.GridRecord.Values[Id]-SGetServerDate(ADOQueryTemp)>=4 then Exit;
|
|||
|
|
if ((AViewInfo.GridRecord.Values[id]-SGetServerDate10(ADOQueryTemp))>=0) and ((AViewInfo.GridRecord.Values[id]-SGetServerDate(ADOQueryTemp))<4) then
|
|||
|
|
ACanvas.Brush.Color:=clYellow
|
|||
|
|
else
|
|||
|
|
if (AViewInfo.GridRecord.Values[id])-(SGetServerDate10(ADOQueryTemp)<0) then
|
|||
|
|
begin
|
|||
|
|
ACanvas.Brush.Color:=clRed;
|
|||
|
|
end;
|
|||
|
|
begin
|
|||
|
|
ACanvas.Brush.Color:=clRed;
|
|||
|
|
end else
|
|||
|
|
if AViewInfo.GridRecord.Values[Id]='Purple' then
|
|||
|
|
begin
|
|||
|
|
ACanvas.Brush.Color:=clPurple;
|
|||
|
|
end else
|
|||
|
|
if AViewInfo.GridRecord.Values[Id]='Olive' then
|
|||
|
|
begin
|
|||
|
|
ACanvas.Brush.Color:=clOlive;
|
|||
|
|
end else
|
|||
|
|
if AViewInfo.GridRecord.Values[Id]='Teal' then
|
|||
|
|
begin
|
|||
|
|
ACanvas.Brush.Color:=clTeal;
|
|||
|
|
end else
|
|||
|
|
if AViewInfo.GridRecord.Values[Id]='Background' then
|
|||
|
|
begin
|
|||
|
|
ACanvas.Brush.Color:=clBackground;
|
|||
|
|
end; }
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmJYorderConCX.N1Click(Sender: TObject);
|
|||
|
|
var
|
|||
|
|
fPrintFile:string;
|
|||
|
|
Porderno:string;
|
|||
|
|
begin
|
|||
|
|
if Order_Main.IsEmpty then Exit;
|
|||
|
|
fPrintFile:= ExtractFilePath(Application.ExeName) + 'Report\<5C><><EFBFBD><EFBFBD>ָʾ<D6B8><CABE>10.rmf' ;
|
|||
|
|
SDofilter(ADOQueryMain,' OrderNoM='''+Trim(Order_Main.fieldbyname('OrderNoM').AsString)+'''');
|
|||
|
|
SCreateCDS20(ADOQueryMain,Order_Main);
|
|||
|
|
SInitCDSData20(ADOQueryMain,Order_Main);
|
|||
|
|
Porderno:=Trim(Order_Main.fieldbyname('OrderNoM').AsString);
|
|||
|
|
if FileExists(fPrintFile) then
|
|||
|
|
begin
|
|||
|
|
//RMVariables['begindate']:=begindate.DateTime;
|
|||
|
|
//RMVariables['enddate']:=enddate.DateTime;
|
|||
|
|
//RMVariables['printtime']:=Now;
|
|||
|
|
//RMVariables['printer']:=Trim(gUserName);
|
|||
|
|
RM1.LoadFromFile(fPrintFile);
|
|||
|
|
RM1.ShowReport;
|
|||
|
|
end else
|
|||
|
|
begin
|
|||
|
|
Application.MessageBox(PChar('û<><C3BB><EFBFBD><EFBFBD>'+ExtractFilePath(Application.ExeName)+'Report\<5C><><EFBFBD><EFBFBD>ָʾ<D6B8><CABE>10.rmf'),'<27><>ʾ',0);
|
|||
|
|
end;
|
|||
|
|
SDofilter(ADOQueryMain,'');
|
|||
|
|
SCreateCDS20(ADOQueryMain,Order_Main);
|
|||
|
|
SInitCDSData20(ADOQueryMain,Order_Main);
|
|||
|
|
Order_Main.Locate('ordernoM',Porderno,[]);
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmJYorderConCX.N2Click(Sender: TObject);
|
|||
|
|
var
|
|||
|
|
fPrintFile:string;
|
|||
|
|
Porderno:string;
|
|||
|
|
begin
|
|||
|
|
if Order_Main.IsEmpty then Exit;
|
|||
|
|
fPrintFile:= ExtractFilePath(Application.ExeName) + 'Report\<5C><><EFBFBD><EFBFBD>ָʾ<D6B8><CABE>.rmf' ;
|
|||
|
|
SDofilter(ADOQueryMain,' OrderNoM='''+Trim(Order_Main.fieldbyname('OrderNoM').AsString)+'''');
|
|||
|
|
SCreateCDS20(ADOQueryMain,Order_Main);
|
|||
|
|
SInitCDSData20(ADOQueryMain,Order_Main);
|
|||
|
|
Porderno:=Trim(Order_Main.fieldbyname('OrderNoM').AsString);
|
|||
|
|
if FileExists(fPrintFile) then
|
|||
|
|
begin
|
|||
|
|
//RMVariables['begindate']:=begindate.DateTime;
|
|||
|
|
//RMVariables['enddate']:=enddate.DateTime;
|
|||
|
|
//RMVariables['printtime']:=Now;
|
|||
|
|
//RMVariables['printer']:=Trim(gUserName);
|
|||
|
|
RM1.LoadFromFile(fPrintFile);
|
|||
|
|
RM1.ShowReport;
|
|||
|
|
end else
|
|||
|
|
begin
|
|||
|
|
Application.MessageBox(PChar('û<><C3BB><EFBFBD><EFBFBD>'+ExtractFilePath(Application.ExeName)+'Report\<5C><><EFBFBD><EFBFBD>ָʾ<D6B8><CABE>.rmf'),'<27><>ʾ',0);
|
|||
|
|
end;
|
|||
|
|
SDofilter(ADOQueryMain,'');
|
|||
|
|
SCreateCDS20(ADOQueryMain,Order_Main);
|
|||
|
|
SInitCDSData20(ADOQueryMain,Order_Main);
|
|||
|
|
Order_Main.Locate('ordernoM',Porderno,[]);
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmJYorderConCX.ToolButton3Click(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
if Order_Main.IsEmpty then exit;
|
|||
|
|
ModalResult:=1;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmJYorderConCX.Tv1CellDblClick(
|
|||
|
|
Sender: TcxCustomGridTableView;
|
|||
|
|
ACellViewInfo: TcxGridTableDataCellViewInfo; AButton: TMouseButton;
|
|||
|
|
AShift: TShiftState; var AHandled: Boolean);
|
|||
|
|
begin
|
|||
|
|
if formid<>'3' then
|
|||
|
|
begin
|
|||
|
|
|
|||
|
|
ToolButton3.Click;
|
|||
|
|
end else
|
|||
|
|
begin
|
|||
|
|
if Application.MessageBox('ȷ<><C8B7>Ҫ<EFBFBD><D2AA><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ݲ<EFBFBD><DDB2><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>','<27><>ʾ',32+4)<>IDYES then Exit;
|
|||
|
|
ModalResult:=1;
|
|||
|
|
end;
|
|||
|
|
{else
|
|||
|
|
TSsel.Click};
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmJYorderConCX.ConNoKeyPress(Sender: TObject; var Key: Char);
|
|||
|
|
begin
|
|||
|
|
if Key=#13 then
|
|||
|
|
begin
|
|||
|
|
if Length(Trim(ConNo.Text))<4 then Exit;
|
|||
|
|
try
|
|||
|
|
ADOQueryMain.DisableControls;
|
|||
|
|
with ADOQueryMain do
|
|||
|
|
begin
|
|||
|
|
Close;
|
|||
|
|
sql.Clear;
|
|||
|
|
sql.add('select A.*,B.* ');
|
|||
|
|
sql.add('from JYorderCon_Main A ');
|
|||
|
|
sql.add('inner join JYOrderCon_Sub B on B.Mainid=A.Mainid ');
|
|||
|
|
sql.add('where A.ConNo like '''+'%'+trim(ConNo.Text)+'%'+'''');
|
|||
|
|
Open;
|
|||
|
|
end;
|
|||
|
|
SCreateCDS20(ADOQueryMain,Order_Main);
|
|||
|
|
SInitCDSData20(ADOQueryMain,Order_Main);
|
|||
|
|
finally
|
|||
|
|
ADOQueryMain.EnableControls;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmJYorderConCX.TSselClick(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
{if Order_Main.IsEmpty then Exit;
|
|||
|
|
try
|
|||
|
|
frmConInPut:=TfrmConInPut.Create(Application);
|
|||
|
|
with frmConInPut do
|
|||
|
|
begin
|
|||
|
|
PState:=1;
|
|||
|
|
FMainId:=Trim(Self.Order_Main.fieldbyname('MainId').AsString);
|
|||
|
|
ToolBar2.Visible:=False;
|
|||
|
|
TBSave.Visible:=False;
|
|||
|
|
ScrollBox1.Enabled:=False;
|
|||
|
|
Tv1.OptionsSelection.CellSelect:=False;
|
|||
|
|
if ShowModal=1 then
|
|||
|
|
begin
|
|||
|
|
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
finally
|
|||
|
|
frmConInPut.Free;
|
|||
|
|
end;}
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmJYorderConCX.GCNameKeyPress(Sender: TObject; var Key: Char);
|
|||
|
|
begin
|
|||
|
|
if Key=#13 then
|
|||
|
|
begin
|
|||
|
|
try
|
|||
|
|
ADOQueryMain.DisableControls;
|
|||
|
|
with ADOQueryMain do
|
|||
|
|
begin
|
|||
|
|
Close;
|
|||
|
|
sql.Clear;
|
|||
|
|
sql.add('select A.*,B.* ');
|
|||
|
|
sql.add('from JYorderCon_Main A ');
|
|||
|
|
sql.add('inner join JYOrderCon_Sub B on B.Mainid=A.Mainid ');
|
|||
|
|
sql.add('where A.GCName like '''+'%'+trim(GCName.Text)+'%'+'''');
|
|||
|
|
Open;
|
|||
|
|
end;
|
|||
|
|
SCreateCDS20(ADOQueryMain,Order_Main);
|
|||
|
|
SInitCDSData20(ADOQueryMain,Order_Main);
|
|||
|
|
finally
|
|||
|
|
ADOQueryMain.EnableControls;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
end.
|