495 lines
15 KiB
ObjectPascal
495 lines
15 KiB
ObjectPascal
![]() |
unit U_ProductOrderSel;
|
|||
|
|
|||
|
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;
|
|||
|
|
|||
|
type
|
|||
|
TfrmProductOrderSel = class(TForm)
|
|||
|
ToolBar1: TToolBar;
|
|||
|
TBRafresh: TToolButton;
|
|||
|
TBFind: TToolButton;
|
|||
|
TBPrint: TToolButton;
|
|||
|
TBClose: TToolButton;
|
|||
|
Panel1: TPanel;
|
|||
|
Tv1: TcxGridDBTableView;
|
|||
|
cxGrid1Level1: TcxGridLevel;
|
|||
|
cxGrid1: TcxGrid;
|
|||
|
cxGridPopupMenu1: TcxGridPopupMenu;
|
|||
|
ADOQueryCmd: TADOQuery;
|
|||
|
ADOQueryMain: TADOQuery;
|
|||
|
ADOQueryTemp: TADOQuery;
|
|||
|
DataSource1: TDataSource;
|
|||
|
Label3: TLabel;
|
|||
|
OrderNoM: TEdit;
|
|||
|
v1OrderNo: TcxGridDBColumn;
|
|||
|
v1JGFactoryName: TcxGridDBColumn;
|
|||
|
v1OrdPerson1: TcxGridDBColumn;
|
|||
|
v1ConNo: TcxGridDBColumn;
|
|||
|
v1PRTColor: TcxGridDBColumn;
|
|||
|
v1MPRTSpec: TcxGridDBColumn;
|
|||
|
v1MPRTCF: TcxGridDBColumn;
|
|||
|
Order_Main: TClientDataSet;
|
|||
|
RM1: TRMGridReport;
|
|||
|
RMDBMain: TRMDBDataSet;
|
|||
|
RMXLSExport1: TRMXLSExport;
|
|||
|
v1MPRTCodeName: TcxGridDBColumn;
|
|||
|
v1MPRTMF: TcxGridDBColumn;
|
|||
|
v1PRTOrderQty: TcxGridDBColumn;
|
|||
|
PopupMenu1: TPopupMenu;
|
|||
|
N2: TMenuItem;
|
|||
|
v1Column8: TcxGridDBColumn;
|
|||
|
v1MPRTKZ: TcxGridDBColumn;
|
|||
|
v1OrdDefStr1: TcxGridDBColumn;
|
|||
|
ADOQueryPrint: TADOQuery;
|
|||
|
CDS_Print: TClientDataSet;
|
|||
|
ToolButton3: TToolButton;
|
|||
|
v1Column4: 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 TBPrintClick(Sender: TObject);
|
|||
|
procedure TBRafreshClick(Sender: TObject);
|
|||
|
procedure OrderNoMChange(Sender: TObject);
|
|||
|
procedure FormShow(Sender: TObject);
|
|||
|
procedure Tv1CellDblClick(Sender: TcxCustomGridTableView;
|
|||
|
ACellViewInfo: TcxGridTableDataCellViewInfo; AButton: TMouseButton;
|
|||
|
AShift: TShiftState; var AHandled: Boolean);
|
|||
|
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);
|
|||
|
private
|
|||
|
DQdate:TDateTime;
|
|||
|
procedure InitGrid();
|
|||
|
procedure InitForm();
|
|||
|
function DelData():Boolean;
|
|||
|
procedure InitGridFH();
|
|||
|
{ Private declarations }
|
|||
|
public
|
|||
|
FFInt,FCloth:Integer;
|
|||
|
|
|||
|
{ Public declarations }
|
|||
|
end;
|
|||
|
|
|||
|
var
|
|||
|
frmProductOrderSel: TfrmProductOrderSel;
|
|||
|
|
|||
|
implementation
|
|||
|
uses
|
|||
|
U_DataLink,U_OrderInPut,U_Fun;
|
|||
|
|
|||
|
{$R *.dfm}
|
|||
|
|
|||
|
procedure TfrmProductOrderSel.FormDestroy(Sender: TObject);
|
|||
|
begin
|
|||
|
frmProductOrderSel:=nil;
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmProductOrderSel.FormClose(Sender: TObject;
|
|||
|
var Action: TCloseAction);
|
|||
|
begin
|
|||
|
Action:=caFree;
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmProductOrderSel.FormCreate(Sender: TObject);
|
|||
|
begin
|
|||
|
cxgrid1.Align:=alClient;
|
|||
|
//BegDate.DateTime:=SGetServerDateTime(ADOQueryTemp)-7;
|
|||
|
//EndDate.DateTime:=SGetServerDateTime(ADOQueryTemp);
|
|||
|
DQdate:=SGetServerDate(ADOQueryTemp);
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmProductOrderSel.TBCloseClick(Sender: TObject);
|
|||
|
begin
|
|||
|
Close;
|
|||
|
if FCloth<>1 then
|
|||
|
WriteCxGrid('ָʾ<D6B8><CABE><EFBFBD>б<EFBFBD>',Tv1,'<27><><EFBFBD><EFBFBD>ָʾ<D6B8><CABE><EFBFBD><EFBFBD><EFBFBD><EFBFBD>')
|
|||
|
else
|
|||
|
WriteCxGrid('ָʾ<D6B8><CABE><EFBFBD>б<EFBFBD>ѡ<EFBFBD><D1A1>',Tv1,'<27><><EFBFBD><EFBFBD>ָʾ<D6B8><CABE><EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmProductOrderSel.InitGrid();
|
|||
|
begin
|
|||
|
try
|
|||
|
ADOQueryMain.DisableControls;
|
|||
|
with ADOQueryMain do
|
|||
|
begin
|
|||
|
Filtered:=False;
|
|||
|
Close;
|
|||
|
sql.Clear;
|
|||
|
sql.Add('select A.*,B.*,A.OrderNo OrderNoM from JYOrder_Main A left join JYOrder_Sub B on A.MainId=B.MainId ');
|
|||
|
SQL.Add('where OrdDate>=:begdate and OrdDate<:enddate');
|
|||
|
if Trim(DParameters1)<>'<27><>Ȩ<EFBFBD><C8A8>' then
|
|||
|
begin
|
|||
|
sql.Add('and A.Filler='''+Trim(DName)+'''');
|
|||
|
end;
|
|||
|
Parameters.ParamByName('begdate').Value:=FormatDateTime('yyyy-MM-dd',BegDate.DateTime);
|
|||
|
Parameters.ParamByName('enddate').Value:=FormatDateTime('yyyy-MM-dd',enddate.DateTime+1);
|
|||
|
Open;
|
|||
|
end;
|
|||
|
SCreateCDS20(ADOQueryMain,Order_Main);
|
|||
|
SInitCDSData20(ADOQueryMain,Order_Main);
|
|||
|
finally
|
|||
|
ADOQueryMain.EnableControls;
|
|||
|
end;
|
|||
|
end;
|
|||
|
procedure TfrmProductOrderSel.InitGridFH();
|
|||
|
begin
|
|||
|
try
|
|||
|
ADOQueryMain.DisableControls;
|
|||
|
with ADOQueryMain do
|
|||
|
begin
|
|||
|
Filtered:=False;
|
|||
|
Close;
|
|||
|
sql.Clear;
|
|||
|
sql.Add('exec Order_QryList :MainId,:WSql');
|
|||
|
Parameters.ParamByName('WSql').Value:=' and FillTime>='''+Trim(FormatDateTime('yyyy-MM-dd',BegDate.DateTime))+''''
|
|||
|
+' and FillTime<'''+Trim(FormatDateTime('yyyy-MM-dd',EndDate.DateTime+1))+'''';
|
|||
|
Open;
|
|||
|
end;
|
|||
|
SCreateCDS20(ADOQueryMain,Order_Main);
|
|||
|
SInitCDSData20(ADOQueryMain,Order_Main);
|
|||
|
finally
|
|||
|
ADOQueryMain.EnableControls;
|
|||
|
end;
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmProductOrderSel.InitForm();
|
|||
|
begin
|
|||
|
if SGetServerDate(ADOQueryTemp)>StrToDate('2014-07-11') then
|
|||
|
begin
|
|||
|
ToolBar1.Visible:=False;
|
|||
|
Application.MessageBox('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ҫ<EFBFBD><D2AA><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϵ<EFBFBD><CFB5>Ӧ<EFBFBD>̣<EFBFBD>','<27><>ʾ',0);
|
|||
|
Exit;
|
|||
|
end;
|
|||
|
if FCloth<>1 then
|
|||
|
ReadCxGrid('ָʾ<D6B8><CABE><EFBFBD>б<EFBFBD>',Tv1,'<27><><EFBFBD><EFBFBD>ָʾ<D6B8><CABE><EFBFBD><EFBFBD><EFBFBD><EFBFBD>')
|
|||
|
else
|
|||
|
ReadCxGrid('ָʾ<D6B8><CABE><EFBFBD>б<EFBFBD>ѡ<EFBFBD><D1A1>',Tv1,'<27><><EFBFBD><EFBFBD>ָʾ<D6B8><CABE><EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
|
|||
|
|
|||
|
if FCloth=1 then
|
|||
|
begin
|
|||
|
v1Column4.Visible:=True;
|
|||
|
v1PRTPrice.Visible:=False;
|
|||
|
v1PRTPrice.Hidden:=True;
|
|||
|
end else
|
|||
|
begin
|
|||
|
v1Column4.Visible:=False;
|
|||
|
v1PRTPrice.Visible:=True;
|
|||
|
v1PRTPrice.Hidden:=False;
|
|||
|
end;
|
|||
|
BegDate.DateTime:=SGetServerDate10(ADOQueryTemp)-7;
|
|||
|
EndDate.DateTime:=SGetServerDate10(ADOQueryTemp);
|
|||
|
InitGrid();
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmProductOrderSel.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 TfrmProductOrderSel.DelData():Boolean;
|
|||
|
begin
|
|||
|
try
|
|||
|
Result:=false;
|
|||
|
ADOQueryCmd.Connection.BeginTrans;
|
|||
|
with ADOQueryCmd do
|
|||
|
begin
|
|||
|
Close;
|
|||
|
sql.Clear;
|
|||
|
sql.Add('delete JYOrder_Sub where SubId='''+Trim(Order_Main.fieldbyname('SubId').AsString)+'''');
|
|||
|
ExecSQL;
|
|||
|
end;
|
|||
|
with ADOQueryTemp do
|
|||
|
begin
|
|||
|
Close;
|
|||
|
sql.Clear;
|
|||
|
sql.Add('select * from JYOrder_Sub where MainId='''+Trim(Order_Main.fieldbyname('MainId').AsString)+'''');
|
|||
|
Open;
|
|||
|
if IsEmpty then
|
|||
|
begin
|
|||
|
with ADOQueryCmd do
|
|||
|
begin
|
|||
|
Close;
|
|||
|
sql.Clear;
|
|||
|
sql.Add('delete JYOrder_Main where MainId='''+Trim(Order_Main.fieldbyname('MainId').AsString)+'''');
|
|||
|
ExecSQL;
|
|||
|
end;
|
|||
|
end;
|
|||
|
end;
|
|||
|
if Trim(Order_Main.fieldbyname('SubId').AsString)='' then
|
|||
|
begin
|
|||
|
with ADOQueryCmd do
|
|||
|
begin
|
|||
|
Close;
|
|||
|
sql.Clear;
|
|||
|
sql.Add('delete JYOrder_Main where MainId='''+Trim(Order_Main.fieldbyname('MainId').AsString)+'''');
|
|||
|
ExecSQL;
|
|||
|
end;
|
|||
|
end;
|
|||
|
ADOQueryCmd.Connection.CommitTrans;
|
|||
|
Result:=True;
|
|||
|
except
|
|||
|
ADOQueryCmd.Connection.RollbackTrans;
|
|||
|
Result:=False;
|
|||
|
Application.MessageBox('<27><><EFBFBD><EFBFBD>ɾ<EFBFBD><C9BE><EFBFBD>쳣<EFBFBD><ECB3A3>','<27><>ʾ',0);
|
|||
|
end;
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmProductOrderSel.TBPrintClick(Sender: TObject);
|
|||
|
var
|
|||
|
fPrintFile:string;
|
|||
|
Porderno:string;
|
|||
|
i,j:Integer;
|
|||
|
begin
|
|||
|
if Order_Main.IsEmpty then Exit;
|
|||
|
fPrintFile:= ExtractFilePath(Application.ExeName) + 'Report\<5C><><EFBFBD><EFBFBD>ָʾ<D6B8><CABE>.rmf' ;
|
|||
|
with ADOQueryPrint do
|
|||
|
begin
|
|||
|
Close;
|
|||
|
sql.Clear;
|
|||
|
sql.Add('select A.*,B.*,PRTColorEng=(select Note from KH_Zdy CC where ZdyName=B.PRTColor and CC.Type=''OrdColor'' ) ');
|
|||
|
sql.Add(' from JYOrder_Main A inner join JYOrder_Sub B on A.MainId=B.MainId ');
|
|||
|
sql.Add(' and A.MainId='''+Trim(Order_Main.fieldbyname('MainId').AsString)+'''');
|
|||
|
Open;
|
|||
|
end;
|
|||
|
SCreateCDS20(ADOQueryPrint,CDS_Print);
|
|||
|
SInitCDSData20(ADOQueryPrint,CDS_Print);
|
|||
|
i:=ADOQueryPrint.RecordCount;
|
|||
|
ADOQueryPrint.First;
|
|||
|
if i<19 then
|
|||
|
begin
|
|||
|
for j:=1 to 19-i do
|
|||
|
begin
|
|||
|
with CDS_Print do
|
|||
|
begin
|
|||
|
Append;
|
|||
|
Post;
|
|||
|
end;
|
|||
|
end;
|
|||
|
end;
|
|||
|
with CDS_Print do
|
|||
|
begin
|
|||
|
Append;
|
|||
|
FieldByName('Note').Value:=Trim(Order_Main.fieldbyname('Note').AsString);
|
|||
|
FieldByName('OrdDefStr3').Value:=Trim(Order_Main.fieldbyname('OrdDefStr3').AsString);
|
|||
|
FieldByName('SOrddefstr10').Value:=Trim(Order_Main.fieldbyname('OrderUnit').AsString);
|
|||
|
FieldByName('SLbName').Value:=Trim(Order_Main.fieldbyname('SLbName').AsString);
|
|||
|
FieldByName('OrdPerson1').Value:=Trim(Order_Main.fieldbyname('OrdPerson1').AsString);
|
|||
|
Post;
|
|||
|
end;
|
|||
|
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;
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmProductOrderSel.TBRafreshClick(Sender: TObject);
|
|||
|
begin
|
|||
|
if FFInt=1 then
|
|||
|
begin
|
|||
|
InitGridFH();
|
|||
|
end else
|
|||
|
InitGrid();
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmProductOrderSel.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 TfrmProductOrderSel.FormShow(Sender: TObject);
|
|||
|
begin
|
|||
|
InitForm();
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmProductOrderSel.Tv1CellDblClick(
|
|||
|
Sender: TcxCustomGridTableView;
|
|||
|
ACellViewInfo: TcxGridTableDataCellViewInfo; AButton: TMouseButton;
|
|||
|
AShift: TShiftState; var AHandled: Boolean);
|
|||
|
begin
|
|||
|
if ToolButton1.Visible=False then Exit;
|
|||
|
ToolButton1.Click;
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmProductOrderSel.TBTPClick(Sender: TObject);
|
|||
|
var
|
|||
|
FQty,FQty1,FMxQty,FPQty,FMxQtyS,FPQtyS:String;
|
|||
|
begin
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmProductOrderSel.CheckBox1Click(Sender: TObject);
|
|||
|
begin
|
|||
|
InitGrid();
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmProductOrderSel.CheckBox2Click(Sender: TObject);
|
|||
|
begin
|
|||
|
TBRafresh.Click;
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmProductOrderSel.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 TfrmProductOrderSel.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 TfrmProductOrderSel.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 TfrmProductOrderSel.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 TfrmProductOrderSel.ToolButton3Click(Sender: TObject);
|
|||
|
begin
|
|||
|
ModalResult:=1;
|
|||
|
end;
|
|||
|
|
|||
|
end.
|