D7wmguihua/样品仓库/U_BpRk.pas
DESKTOP-E401PHE\Administrator bbe0d4e993 ~
2025-08-07 13:12:35 +08:00

1213 lines
37 KiB
ObjectPascal
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

unit U_BpRk;
interface
uses
Windows, Messages, SysUtils, StrUtils, Variants, Classes, Graphics, Controls,
Forms, Dialogs, cxStyles, cxCustomData, cxGraphics, cxFilter, cxData,
cxDataStorage, cxEdit, DB, cxDBData, cxGridCustomTableView, cxGridTableView,
cxGridDBTableView, cxGridLevel, cxClasses, cxControls, cxGridCustomView,
cxGrid, StdCtrls, ComCtrls, ExtCtrls, ToolWin, cxButtonEdit, cxDropDownEdit,
DBClient, ADODB, cxGridCustomPopupMenu, cxGridPopupMenu, cxTextEdit, BtnEdit,
RM_Common, RM_Class, RM_e_Xls, RM_GridReport, RM_System, RM_Dataset,
cxLookAndFeels, cxLookAndFeelPainters, cxNavigator, dxSkinsCore, dxSkinBlack,
dxSkinBlue, dxSkinBlueprint, dxSkinCaramel, dxSkinCoffee, dxSkinDarkRoom,
dxSkinDarkSide, dxSkinDevExpressDarkStyle, dxSkinDevExpressStyle, dxSkinFoggy,
dxSkinGlassOceans, dxSkinHighContrast, dxSkiniMaginary, dxSkinLilian,
dxSkinLiquidSky, dxSkinLondonLiquidSky, dxSkinMcSkin, dxSkinMetropolis,
dxSkinMetropolisDark, dxSkinMoneyTwins, dxSkinOffice2007Black,
dxSkinOffice2007Blue, dxSkinOffice2007Green, dxSkinOffice2007Pink,
dxSkinOffice2007Silver, dxSkinOffice2010Black, dxSkinOffice2010Blue,
dxSkinOffice2010Silver, dxSkinOffice2013DarkGray, dxSkinOffice2013LightGray,
dxSkinOffice2013White, dxSkinPumpkin, dxSkinSeven, dxSkinSevenClassic,
dxSkinSharp, dxSkinSharpPlus, dxSkinSilver, dxSkinSpringTime, dxSkinStardust,
dxSkinSummer2008, dxSkinTheAsphaltWorld, dxSkinsDefaultPainters,
dxSkinValentine, dxSkinVS2010, dxSkinWhiteprint, dxSkinXmas2008Blue,
dxSkinscxPCPainter, cxContainer, cxMaskEdit;
type
TfrmbpRk = class(TForm)
ToolBar1: TToolBar;
TBSave: TToolButton;
TBClose: TToolButton;
Panel1: TPanel;
Label1: TLabel;
CRTime: TDateTimePicker;
Label2: TLabel;
CRType: TComboBox;
cxGrid1: TcxGrid;
Tv1: TcxGridDBTableView;
v1P_CodeName: TcxGridDBColumn;
v1PRTSpec: TcxGridDBColumn;
v1P_MF: TcxGridDBColumn;
v1P_KZ: TcxGridDBColumn;
v1RollNum: TcxGridDBColumn;
v1Qty: TcxGridDBColumn;
v1QtyUnit: TcxGridDBColumn;
cxGrid1Level1: TcxGridLevel;
ADOQueryCmd: TADOQuery;
ADOQueryTmp: TADOQuery;
DataSource1: TDataSource;
CDS_Main: TClientDataSet;
ToolBar2: TToolBar;
ToolButton1: TToolButton;
ToolButton2: TToolButton;
cxGridPopupMenu1: TcxGridPopupMenu;
Label3: TLabel;
ckName: TComboBox;
v1MJXH: TcxGridDBColumn;
v1MJId: TcxGridDBColumn;
v1CPType: TcxGridDBColumn;
v1P_Color: TcxGridDBColumn;
note: TEdit;
Label4: TLabel;
cust: TBtnEditA;
Label9: TLabel;
ADOQuery1: TADOQuery;
v1Column1: TcxGridDBColumn;
v1Column2: TcxGridDBColumn;
Edit1: TEdit;
Label5: TLabel;
Label6: TLabel;
Edit2: TEdit;
TBPrint: TToolButton;
ADOPrint: TADOQuery;
RMDB_MD: TRMDBDataSet;
RMGridReport1: TRMGridReport;
RMXLSExport1: TRMXLSExport;
custaddress: TEdit;
Label7: TLabel;
SYRName: TComboBox;
Label25: TLabel;
Label8: TLabel;
FactoryNoName: TEdit;
procedure FormDestroy(Sender: TObject);
procedure FormCreate(Sender: TObject);
procedure FormClose(Sender: TObject; var Action: TCloseAction);
procedure FormShow(Sender: TObject);
procedure TBSaveClick(Sender: TObject);
procedure v1P_CodeNamePropertiesButtonClick(Sender: TObject; AButtonIndex: Integer);
procedure ToolButton1Click(Sender: TObject);
procedure ToolButton2Click(Sender: TObject);
procedure TBCloseClick(Sender: TObject);
procedure v1P_CodeNamePropertiesEditValueChanged(Sender: TObject);
procedure v1P_ColorPropertiesEditValueChanged(Sender: TObject);
procedure v1P_ColorPropertiesButtonClick(Sender: TObject; AButtonIndex: Integer);
procedure custBtnClick(Sender: TObject);
procedure v1QtyPropertiesEditValueChanged(Sender: TObject);
procedure Edit1KeyPress(Sender: TObject; var Key: Char);
procedure Edit2KeyPress(Sender: TObject; var Key: Char);
procedure TBPrintClick(Sender: TObject);
procedure FactoryNoNamePropertiesButtonClick(Sender: TObject; AButtonIndex: Integer);
private
procedure InitGrid();
function savedate(): Boolean;
procedure SetComboBox();
function YFData(ckNo, CkID: string; Order_Main10: TClientDataSet): Boolean;
function YSData_gd(ckNo, CkID: string; Order_Main10: TClientDataSet): Boolean;
function YSData_YP(ckNo, CkID: string; Order_Main10: TClientDataSet): Boolean;
{ Private declarations }
public
fkeyNO: string;
FType: integer;
fCKName: string;
{ Public declarations }
end;
var
frmbpRk: TfrmbpRk;
implementation
uses
U_DataLink, U_Fun10, U_ZDYHelp, U_ZdyAttachCP, U_ZdyAttachment, U_ZdyAttachGYS;
{$R *.dfm}
function TfrmbpRk.YFData(ckNo, CkID: string; Order_Main10: TClientDataSet): Boolean;
var
CRID, YFID, Price, PriceUnit, OrderUnit, FComTaiTou: string;
begin
Result := False;
with Order_Main10 do
begin
with ADOQuery1 do
begin
Close;
SQL.Clear;
sql.Add('select * from YF_Money_KC where FactoryName=''' + Trim(FactoryNoName.text) + '''');
sql.Add('and YFDefFlag1=0 ');
Open;
end;
if not ADOQuery1.IsEmpty then
begin
CRID := ADOQuery1.fieldbyname('CRID').AsString;
end
else
begin
with ADOQueryCmd do
begin
Close;
sql.Clear;
sql.Add('Update YF_Money_CRID set CRID=CRID+1');
sql.Add('select * from YF_Money_CRID ');
Open;
end;
CRID := ADOQueryCmd.fieldbyname('CRID').AsString;
with ADOQueryCmd do
begin
Close;
SQL.Clear;
sql.Add('select * from YF_Money_KC where 1<>1');
Open;
end;
with ADOQueryCmd do
begin
Append;
FieldByName('CRID').Value := StrToInt(CRID);
FieldByName('FactoryName').Value := Trim(cust.text);
FieldByName('ZdyStr1').Value := <><D3A6><EFBFBD><EFBFBD>';
FieldByName('YFDefFlag1').Value := 0;
Post;
end;
end;
with ADOQuery1 do
begin
Close;
sql.Clear;
sql.Add('delete from YF_Money_CR ');
sql.Add(' where MainID=''' + Trim(ckNo) + '''');
sql.Add(' and subID=''' + Trim(CkID) + '''');
sql.Add(' and YFName=''<27>ɹ<EFBFBD><C9B9><EFBFBD><EFBFBD><EFBFBD>'' ');
execsql;
end;
with ADOQuery1 do
begin
Close;
sql.Clear;
sql.Add('select * from YF_Money_CR ');
sql.Add(' where MainID=''' + Trim(ckNo) + '''');
sql.Add(' and subID=''' + Trim(CkID) + '''');
sql.Add(' and YFName=''<27>ɹ<EFBFBD><C9B9><EFBFBD><EFBFBD><EFBFBD>'' ');
Open;
end;
if ADOQuery1.IsEmpty then
begin
if GetLSNo(ADOQueryCmd, YFID, 'TF', 'YF_Money_CR', 4, 1) = False then
begin
Application.MessageBox(<><C8A1><EFBFBD><EFBFBD>Ӧ<EFBFBD><D3A6><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʧ<EFBFBD><CAA7>!', '<27><>ʾ', 0);
Exit;
end;
with ADOQueryCmd do
begin
Close;
sql.Clear;
sql.Add('select * from YF_Money_CR where 1<>1');
Open;
end;
with ADOQueryCmd do
begin
Append;
FieldByName('YFID').Value := Trim(YFID);
FieldByName('YFTypeId').Value := Trim(ckNo);
FieldByName('CRID').Value := StrToInt(CRID);
FieldByName('Filler').Value := Trim(DName);
FieldByName('CRType').Value := <><D3A6><EFBFBD><EFBFBD><EFBFBD>Ǽ<EFBFBD>';
FieldByName('CRFlag').Value := <><D3A6><EFBFBD><EFBFBD>';
FieldByName('QtyFlag').Value := 1;
FieldByName('FactoryName').Value := Trim(FactoryNoName.Text);
FieldByName('CRTime').Value := Trim(FormatDateTime('yyyy-MM-dd', CRTime.DateTime));
FieldByName('YFType').Value := '<27>Զ<EFBFBD><D4B6><EFBFBD><EFBFBD><EFBFBD>';
FieldByName('ps').Value := 1 * Order_Main10.fieldbyname('RollNum').AsFloat;
FieldByName('Qty').Value := 1 * Order_Main10.fieldbyname('Qty').AsFloat;
FieldByName('Price').Value := Order_Main10.fieldbyname('Price').AsFloat;
FieldByName('Money').Value := 1 * Order_Main10.fieldbyname('Money').AsFloat;
FieldByName('BBMoney').Value := 1 * Order_Main10.fieldbyname('Money').AsFloat;
//FieldByName('HuiLv').Value:=1;
FieldByName('HuiLv').Value := 1;
FieldByName('BZType').Value := '<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>';
FieldByName('QtyUnit').Value := Trim(Order_Main10.fieldbyname('QtyUnit').AsString);
FieldByName('ComTaiTou').Value := Trim(FactoryNoName.Text);
FieldByName('P_CodeName').Value := trim(Order_Main10.fieldbyname('P_CodeName').AsString);
FieldByName('P_Color').Value := trim(Order_Main10.fieldbyname('P_Color').AsString);
FieldByName('YFName').Value := '<27>ɹ<EFBFBD><C9B9><EFBFBD><EFBFBD><EFBFBD>';
FieldByName('MainId').Value := Trim(ckNo);
FieldByName('subID').Value := Trim(CkID);
FieldByName('YFDefFlag1').Value := 0;
Post;
end;
end
else
begin
YFID := Trim(ADOQuery1.fieldbyname('YFID').AsString);
end;
with ADOQueryCmd do
begin
Close;
sql.Clear;
sql.Add('Update YF_Money_KC Set KCMoney=(select isnull(Sum(Money*QtyFlag),0) from YF_Money_CR A where A.CRID=YF_Money_KC.CRID)');
sql.Add(',KCBBMoney=(select isnull(Sum(BBMoney*QtyFlag),0) from YF_Money_CR A where A.CRID=YF_Money_KC.CRID)');
sql.Add(' where CRID=' + CRID);
ExecSQL;
end;
end;
Result := True;
end;
function TfrmbpRk.YSData_gd(ckNo, CkID: string; Order_Main10: TClientDataSet): Boolean;
var
CRID, YFID, Price, PriceUnit, OrderUnit, FComTaiTou: string;
begin
Result := False;
with Order_Main10 do
begin
with ADOQuery1 do
begin
Close;
SQL.Clear;
sql.Add('select * from YF_Money_KC where FactoryName=''' + Trim(cust.text) + '''');
sql.Add('and YFDefFlag1=1 ');
Open;
end;
if not ADOQuery1.IsEmpty then
begin
CRID := ADOQuery1.fieldbyname('CRID').AsString;
end
else
begin
with ADOQueryCmd do
begin
Close;
sql.Clear;
sql.Add('Update YF_Money_CRID set CRID=CRID+1');
sql.Add('select * from YF_Money_CRID ');
Open;
end;
CRID := ADOQueryCmd.fieldbyname('CRID').AsString;
with ADOQueryCmd do
begin
Close;
SQL.Clear;
sql.Add('select * from YF_Money_KC where 1<>1');
Open;
end;
with ADOQueryCmd do
begin
Append;
FieldByName('CRID').Value := StrToInt(CRID);
FieldByName('FactoryName').Value := Trim(cust.text);
FieldByName('ZdyStr1').Value := <><D3A6><EFBFBD><EFBFBD>';
FieldByName('YFDefFlag1').Value := 1;
Post;
end;
end;
with ADOQuery1 do
begin
Close;
sql.Clear;
sql.Add('delete from YF_Money_CR ');
sql.Add(' where MainID=''' + Trim(ckNo) + '''');
sql.Add(' and subID=''' + Trim(CkID) + '''');
sql.Add(' and YFName=''<27><EFBFBD><E3B6AB><EFBFBD><EFBFBD><EFBFBD>˻<EFBFBD>'' ');
execsql;
end;
with ADOQuery1 do
begin
Close;
sql.Clear;
sql.Add('select * from YF_Money_CR ');
sql.Add(' where MainID=''' + Trim(ckNo) + '''');
sql.Add(' and subID=''' + Trim(CkID) + '''');
sql.Add(' and YFName=''<27><EFBFBD><E3B6AB><EFBFBD><EFBFBD><EFBFBD>˻<EFBFBD>'' ');
Open;
end;
if ADOQuery1.IsEmpty then
begin
if GetLSNo(ADOQueryCmd, YFID, 'TH', 'YF_Money_CR', 4, 1) = False then
begin
Application.MessageBox(<><C8A1><EFBFBD><EFBFBD>Ӧ<EFBFBD><D3A6><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʧ<EFBFBD><CAA7>!', '<27><>ʾ', 0);
Exit;
end;
with ADOQueryCmd do
begin
Close;
sql.Clear;
sql.Add('select * from YF_Money_CR where 1<>1');
Open;
end;
with ADOQueryCmd do
begin
Append;
FieldByName('YFID').Value := Trim(YFID);
FieldByName('YFTypeId').Value := Trim(ckNo);
FieldByName('CRID').Value := StrToInt(CRID);
FieldByName('Filler').Value := Trim(DName);
FieldByName('CRType').Value := <>տ<EFBFBD><D5BF>Ǽ<EFBFBD>';
FieldByName('CRFlag').Value := <><D3A6><EFBFBD><EFBFBD>';
FieldByName('QtyFlag').Value := 1;
FieldByName('FactoryName').Value := Trim(cust.Text);
FieldByName('CRTime').Value := Trim(FormatDateTime('yyyy-MM-dd', CRTime.DateTime));
FieldByName('YFType').Value := '<27>Զ<EFBFBD><D4B6><EFBFBD><EFBFBD><EFBFBD>';
FieldByName('ps').Value := -1 * Order_Main10.fieldbyname('RollNum').AsFloat;
FieldByName('Qty').Value := -1 * Order_Main10.fieldbyname('Qty').AsFloat;
FieldByName('Price').Value := Order_Main10.fieldbyname('Price').AsFloat;
FieldByName('Money').Value := -1 * Order_Main10.fieldbyname('Money').AsFloat;
FieldByName('BBMoney').Value := -1 * Order_Main10.fieldbyname('Money').AsFloat;
//FieldByName('HuiLv').Value:=1;
FieldByName('HuiLv').Value := 1;
FieldByName('BZType').Value := '<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>';
FieldByName('QtyUnit').Value := Trim(Order_Main10.fieldbyname('QtyUnit').AsString);
FieldByName('ComTaiTou').Value := Trim(cust.Text);
FieldByName('P_CodeName').Value := trim(Order_Main10.fieldbyname('P_CodeName').AsString);
FieldByName('P_Color').Value := trim(Order_Main10.fieldbyname('P_Color').AsString);
FieldByName('YFName').Value := '<27><EFBFBD><E3B6AB><EFBFBD><EFBFBD><EFBFBD>˻<EFBFBD>';
FieldByName('MainId').Value := Trim(ckNo);
FieldByName('subID').Value := Trim(CkID);
FieldByName('YFDefFlag1').Value := 1;
Post;
end;
end
else
begin
YFID := Trim(ADOQuery1.fieldbyname('YFID').AsString);
end;
with ADOQueryCmd do
begin
Close;
sql.Clear;
sql.Add('Update YF_Money_KC Set KCMoney=(select isnull(Sum(Money*QtyFlag),0) from YF_Money_CR A where A.CRID=YF_Money_KC.CRID)');
sql.Add(',KCBBMoney=(select isnull(Sum(BBMoney*QtyFlag),0) from YF_Money_CR A where A.CRID=YF_Money_KC.CRID)');
sql.Add(' where CRID=' + CRID);
ExecSQL;
end;
end;
Result := True;
end;
function TfrmbpRk.YSData_YP(ckNo, CkID: string; Order_Main10: TClientDataSet): Boolean;
var
CRID, YFID, Price, PriceUnit, OrderUnit, FComTaiTou: string;
begin
Result := False;
with Order_Main10 do
begin
with ADOQuery1 do
begin
Close;
SQL.Clear;
sql.Add('select * from YF_Money_KC where FactoryName=''' + Trim(cust.text) + '''');
sql.Add('and YFDefFlag1=0 ');
Open;
end;
if not ADOQuery1.IsEmpty then
begin
CRID := ADOQuery1.fieldbyname('CRID').AsString;
end
else
begin
with ADOQueryCmd do
begin
Close;
sql.Clear;
sql.Add('Update YF_Money_CRID set CRID=CRID+1');
sql.Add('select * from YF_Money_CRID ');
Open;
end;
CRID := ADOQueryCmd.fieldbyname('CRID').AsString;
with ADOQueryCmd do
begin
Close;
SQL.Clear;
sql.Add('select * from YF_Money_KC where 1<>1');
Open;
end;
with ADOQueryCmd do
begin
Append;
FieldByName('CRID').Value := StrToInt(CRID);
FieldByName('FactoryName').Value := Trim(cust.text);
FieldByName('ZdyStr1').Value := <><D3A6><EFBFBD><EFBFBD>';
FieldByName('YFDefFlag1').Value := 0;
Post;
end;
end;
with ADOQuery1 do
begin
Close;
sql.Clear;
sql.Add('delete from YF_Money_CR ');
sql.Add(' where MainID=''' + Trim(ckNo) + '''');
sql.Add(' and subID=''' + Trim(CkID) + '''');
sql.Add(' and YFName=''<27><>Ʒ<EFBFBD>˻<EFBFBD>'' ');
execsql;
end;
with ADOQuery1 do
begin
Close;
sql.Clear;
sql.Add('select * from YF_Money_CR ');
sql.Add(' where MainID=''' + Trim(ckNo) + '''');
sql.Add(' and subID=''' + Trim(CkID) + '''');
sql.Add(' and YFName=''<27><>Ʒ<EFBFBD>˻<EFBFBD>'' ');
Open;
end;
if ADOQuery1.IsEmpty then
begin
if GetLSNo(ADOQueryCmd, YFID, 'TH', 'YF_Money_CR', 4, 1) = False then
begin
Application.MessageBox(<><C8A1><EFBFBD><EFBFBD>Ӧ<EFBFBD><D3A6><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʧ<EFBFBD><CAA7>!', '<27><>ʾ', 0);
Exit;
end;
with ADOQueryCmd do
begin
Close;
sql.Clear;
sql.Add('select * from YF_Money_CR where 1<>1');
Open;
end;
with ADOQueryCmd do
begin
Append;
FieldByName('YFID').Value := Trim(YFID);
FieldByName('YFTypeId').Value := Trim(ckNo);
FieldByName('CRID').Value := StrToInt(CRID);
FieldByName('Filler').Value := Trim(DName);
FieldByName('CRType').Value := <>տ<EFBFBD><D5BF>Ǽ<EFBFBD>';
FieldByName('CRFlag').Value := <><D3A6><EFBFBD><EFBFBD>';
FieldByName('QtyFlag').Value := 1;
FieldByName('FactoryName').Value := Trim(cust.Text);
FieldByName('CRTime').Value := Trim(FormatDateTime('yyyy-MM-dd', CRTime.DateTime));
FieldByName('YFType').Value := '<27>Զ<EFBFBD><D4B6><EFBFBD><EFBFBD><EFBFBD>';
FieldByName('ps').Value := -1 * Order_Main10.fieldbyname('RollNum').AsFloat;
FieldByName('Qty').Value := -1 * Order_Main10.fieldbyname('Qty').AsFloat;
FieldByName('Price').Value := Order_Main10.fieldbyname('Price').AsFloat;
FieldByName('Money').Value := -1 * Order_Main10.fieldbyname('Money').AsFloat;
FieldByName('BBMoney').Value := -1 * Order_Main10.fieldbyname('Money').AsFloat;
//FieldByName('HuiLv').Value:=1;
FieldByName('HuiLv').Value := 1;
FieldByName('BZType').Value := '<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>';
FieldByName('QtyUnit').Value := Trim(Order_Main10.fieldbyname('QtyUnit').AsString);
FieldByName('ComTaiTou').Value := Trim(cust.Text);
FieldByName('P_CodeName').Value := trim(Order_Main10.fieldbyname('P_CodeName').AsString);
FieldByName('P_Color').Value := trim(Order_Main10.fieldbyname('P_Color').AsString);
FieldByName('YFName').Value := '<27><>Ʒ<EFBFBD>˻<EFBFBD>';
FieldByName('MainId').Value := Trim(ckNo);
FieldByName('subID').Value := Trim(CkID);
FieldByName('fstr2').Value := '<27><>Ʒ';
FieldByName('SYRName').Value := trim(SYRName.Text);
FieldByName('YFDefFlag1').Value := 0;
Post;
end;
end
else
begin
YFID := Trim(ADOQuery1.fieldbyname('YFID').AsString);
end;
with ADOQueryCmd do
begin
Close;
sql.Clear;
sql.Add('Update YF_Money_KC Set KCMoney=(select isnull(Sum(Money*QtyFlag),0) from YF_Money_CR A where A.CRID=YF_Money_KC.CRID)');
sql.Add(',KCBBMoney=(select isnull(Sum(BBMoney*QtyFlag),0) from YF_Money_CR A where A.CRID=YF_Money_KC.CRID)');
sql.Add(' where CRID=' + CRID);
ExecSQL;
end;
end;
Result := True;
end;
procedure TfrmbpRk.SetComboBox();
begin
ckName.Items.Clear;
if fCkName = '<27><>Ʒ<EFBFBD>ֿ<EFBFBD>' then
begin
if fType = 1 then
begin
CRType.Enabled := False;
end;
SYRName.Items.Clear;
with adoQueryTmp do
begin
close;
sql.Clear;
sql.Add('select * from KH_ZDY where Type=''SYRNAME''');
open;
// SYRName.Items.Add(trim(''));
if not IsEmpty then
begin
while not eof do
begin
SYRName.Items.Add(trim(fieldbyname('zdyname').AsString));
next;
end;
SYRName.ItemIndex := 0;
end;
end;
end;
with adoQueryTmp do
begin
close;
sql.Clear;
sql.Add('select * from KH_ZDY where Type=''BPCK'' ');
if trim(fCKName) <> '' then
sql.Add('and zdyName=' + quotedstr(trim(fCKName)));
open;
while not eof do
begin
ckName.Items.Add(trim(fieldbyname('zdyName').AsString));
next;
end;
end;
if ckName.Items.Count > 0 then
ckName.ItemIndex := 0;
CRType.Items.Clear;
with adoQueryTmp do
begin
close;
sql.Clear;
sql.Add('select * from KH_ZDY where Type=''BPRKTYPE''');
if trim(fCKName) <> '' then
sql.Add('and note=' + quotedstr(trim(fCKName)));
sql.Add('and zdyName not like ''%<25><><EFBFBD><EFBFBD>%'' ');
open;
while not eof do
begin
CRType.Items.Add(trim(fieldbyname('zdyName').AsString));
next;
end;
end;
if CRType.Items.Count > 0 then
CRType.ItemIndex := 0;
end;
function TfrmbpRk.savedate(): Boolean;
var
fkcID: integer;
Filler: string;
FillTime: TdateTime;
begin
result := false;
try
ADOQueryCmd.Connection.BeginTrans;
if FType = 0 then
begin
if trim(CRType.Text) = '<27><EFBFBD>˻<EFBFBD><CBBB><EFBFBD><EFBFBD><EFBFBD>' then
begin
if GetLSNo(ADOQueryCmd, fkeyNO, 'TR', 'BP_InOut', 3, 1) = False then
begin
ADOQueryCmd.Connection.RollbackTrans;
Application.MessageBox(<><C8A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʧ<EFBFBD><CAA7>!', '<27><>ʾ', 0);
Exit;
end;
end
else
begin
if GetLSNo(ADOQueryCmd, fkeyNO, 'RK', 'BP_InOut', 3, 1) = False then
begin
ADOQueryCmd.Connection.RollbackTrans;
Application.MessageBox(<><C8A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʧ<EFBFBD><CAA7>!', '<27><>ʾ', 0);
Exit;
end;
end;
Filler := DName;
FillTime := SGetServerDateTime(adoqueryTmp);
end
else
begin
with adoqueryTmp do
begin
close;
sql.Clear;
sql.Add('select * from BP_InOut');
sql.Add('where CRNO=' + quotedstr(trim(fkeyNO)));
open;
Filler := adoqueryTmp.fieldbyname('Filler').AsString;
FillTime := adoqueryTmp.fieldbyname('FillTime').AsDateTime;
end;
end;
with ADOQueryCmd do
begin
close;
sql.Clear;
sql.Add('delete from BP_InOut');
sql.Add('where CRNO=' + quotedstr(trim(fkeyNO)));
execsql;
end;
with ADOQueryCmd do
begin
close;
sql.Clear;
sql.Add('delete from BP_kc');
sql.Add('where CRNO=' + quotedstr(trim(fkeyNO)));
execsql;
end;
CDS_Main.DisableControls;
CDS_Main.First;
with CDS_Main do
begin
while not eof do
begin
with ADOQueryCmd do
begin
Close;
sql.Clear;
SQL.add('Update BP_Kcid Set kcid=kcid+1');
sql.Add('select kcid from BP_Kcid');
Open;
end;
fkcID := ADOQueryCmd.fieldbyname('kcid').AsInteger;
with ADOQueryCmd do
begin
close;
sql.Clear;
sql.Add('select * from BP_InOut');
sql.Add('where 1=2 ');
open;
end;
// fkcID:=strtoint(RightBStr(trim(fkeyNO),length(fkeyNO)-3)+inttostr(recNo));
ADOQueryCmd.Append;
ADOQueryCmd.FieldByName('CRNO').Value := trim(fkeyNO);
ADOQueryCmd.FieldByName('CRID').Value := recNo;
ADOQueryCmd.FieldByName('CRTime').Value := formatdateTime('yyyy-MM-dd', CRTIme.Date);
ADOQueryCmd.FieldByName('CKName').Value := trim(CKName.Text);
ADOQueryCmd.FieldByName('CRType').Value := trim(CRType.Text);
ADOQueryCmd.FieldByName('CRFlag').Value := '<27><><EFBFBD><EFBFBD>';
ADOQueryCmd.FieldByName('MJID').Value := trim(fieldbyname('MJID').AsString);
ADOQueryCmd.FieldByName('MJXH').Value := trim(fieldbyname('MJXH').AsString);
ADOQueryCmd.FieldByName('CPTYPE').Value := trim(fieldbyname('CPTYPE').AsString);
ADOQueryCmd.FieldByName('P_Code').Value := trim(fieldbyname('P_Code').AsString);
ADOQueryCmd.FieldByName('P_CodeName').Value := trim(fieldbyname('P_CodeName').AsString);
ADOQueryCmd.FieldByName('P_spec').Value := trim(fieldbyname('P_spec').AsString);
ADOQueryCmd.FieldByName('P_Color').Value := trim(fieldbyname('P_Color').AsString);
ADOQueryCmd.FieldByName('P_MF').Value := fieldbyname('P_MF').AsFloat;
ADOQueryCmd.FieldByName('P_KZ').Value := fieldbyname('P_KZ').AsFloat;
ADOQueryCmd.FieldByName('RollNum').Value := fieldbyname('RollNum').AsFloat;
ADOQueryCmd.FieldByName('Qty').Value := fieldbyname('Qty').AsFloat;
ADOQueryCmd.FieldByName('QtyUnit').Value := trim(fieldbyname('QtyUnit').AsString);
ADOQueryCmd.FieldByName('price').Value := fieldbyname('price').AsFloat;
ADOQueryCmd.FieldByName('money').Value := fieldbyname('money').AsFloat;
ADOQueryCmd.FieldByName('note').Value := trim(note.Text);
ADOQueryCmd.FieldByName('cust').Value := trim(cust.Text);
ADOQueryCmd.FieldByName('FactoryNoName').Value := trim(FactoryNoName.Text);
ADOQueryCmd.FieldByName('SYRName').Value := trim(SYRName.Text);
ADOQueryCmd.FieldByName('custaddress').Value := trim(custaddress.Text);
ADOQueryCmd.FieldByName('Filler').Value := trim(Filler);
ADOQueryCmd.FieldByName('FillTime').Value := dateTimetostr(FillTime);
if FType = 1 then
begin
ADOQueryCmd.FieldByName('editer').Value := trim(dName);
ADOQueryCmd.FieldByName('editTime').Value := SGetServerDateTime(adoqueryTmp);
end;
ADOQueryCmd.FieldByName('kcID').Value := fkcID;
ADOQueryCmd.Post;
with ADOQueryCmd do
begin
close;
sql.Clear;
sql.Add('select * from BP_KC');
sql.Add('where 1=2 ');
open;
end;
ADOQueryCmd.Append;
ADOQueryCmd.FieldByName('kcID').Value := fkcID;
ADOQueryCmd.FieldByName('CKName').Value := trim(CKName.Text);
ADOQueryCmd.FieldByName('CRNO').Value := trim(fkeyNO);
ADOQueryCmd.FieldByName('CRID').Value := recNo;
ADOQueryCmd.FieldByName('CRTime').Value := formatdateTime('yyyy-MM-dd', CRTIme.Date);
ADOQueryCmd.FieldByName('CRType').Value := trim(CRType.Text);
ADOQueryCmd.FieldByName('CRFlag').Value := '<27><><EFBFBD><EFBFBD>';
ADOQueryCmd.FieldByName('MJXH').Value := trim(fieldbyname('MJXH').AsString);
ADOQueryCmd.FieldByName('MJID').Value := trim(fieldbyname('MJID').AsString);
ADOQueryCmd.FieldByName('CPType').Value := trim(fieldbyname('CPType').AsString);
ADOQueryCmd.FieldByName('P_Code').Value := trim(fieldbyname('P_Code').AsString);
ADOQueryCmd.FieldByName('P_CodeName').Value := trim(fieldbyname('P_CodeName').AsString);
ADOQueryCmd.FieldByName('P_spec').Value := trim(fieldbyname('P_spec').AsString);
ADOQueryCmd.FieldByName('P_Color').Value := trim(fieldbyname('P_Color').AsString);
ADOQueryCmd.FieldByName('P_MF').Value := fieldbyname('P_MF').AsFloat;
ADOQueryCmd.FieldByName('P_KZ').Value := fieldbyname('P_KZ').AsFloat;
ADOQueryCmd.FieldByName('RollNum').Value := fieldbyname('RollNum').AsFloat;
ADOQueryCmd.FieldByName('Qty').Value := fieldbyname('Qty').AsFloat;
ADOQueryCmd.FieldByName('QtyUnit').Value := trim(fieldbyname('QtyUnit').AsString);
ADOQueryCmd.FieldByName('kcID').Value := fkcID;
ADOQueryCmd.Post;
if trim(CRType.Text) = '<27>˻<EFBFBD><CBBB><EFBFBD><EFBFBD><EFBFBD>' then
begin
if not YSData_YP(fkeyNo, inttostr(CDS_Main.RecNo), CDS_Main) then
begin
CDS_Main.EnableControls;
ADOQueryCmd.Connection.RollbackTrans;
exit;
end;
end;
if trim(CRType.Text) = '<27><EFBFBD>˻<EFBFBD><CBBB><EFBFBD><EFBFBD><EFBFBD>' then
begin
if not YSData_GD(fkeyNo, inttostr(CDS_Main.RecNo), CDS_Main) then
begin
CDS_Main.EnableControls;
ADOQueryCmd.Connection.RollbackTrans;
exit;
end;
end;
if trim(CRType.Text) = '<27>ɹ<EFBFBD><C9B9><EFBFBD><EFBFBD><EFBFBD>' then
begin
if not YFData(fkeyNo, inttostr(CDS_Main.RecNo), CDS_Main) then
begin
CDS_Main.EnableControls;
ADOQueryCmd.Connection.RollbackTrans;
exit;
end;
end;
next;
end;
end;
CDS_Main.EnableControls;
ADOQueryCmd.Connection.CommitTrans;
result := true;
except
CDS_Main.EnableControls;
ADOQueryCmd.Connection.RollbackTrans;
end;
end;
procedure TfrmbpRk.InitGrid();
begin
try
with adoqueryTmp do
begin
close;
sql.Clear;
sql.Add('select * from BP_InOut A');
sql.Add('where CRNO=' + quotedstr(trim(fkeyNO)));
open;
end;
SCreateCDS20(adoqueryTmp, CDS_Main);
SInitCDSData20(adoqueryTmp, CDS_Main);
if not CDS_Main.IsEmpty then
begin
CRTime.Date := CDS_Main.fieldbyname('CRTime').AsDateTime;
CKName.ItemIndex := CKName.Items.IndexOf(trim(CDS_Main.fieldbyname('CKName').AsString));
CRType.ItemIndex := CRType.Items.IndexOf(trim(CDS_Main.fieldbyname('CRType').AsString));
// FirstName.TxtCode:=trim(CDS_Main.fieldbyname('FirstNo').AsString);
// FirstName.Text:=trim(CDS_Main.fieldbyname('FirstName').AsString);
note.Text := trim(CDS_Main.fieldbyname('note').AsString);
cust.Text := trim(CDS_Main.fieldbyname('cust').AsString);
FactoryNoName.Text := trim(CDS_Main.fieldbyname('FactoryNoName').AsString);
custaddress.Text := trim(CDS_Main.fieldbyname('custaddress').AsString);
if SYRName.Items.IndexOf(trim(CDS_Main.fieldbyname('SYRName').AsString)) > -1 then
SYRName.ItemIndex := SYRName.Items.IndexOf(trim(CDS_Main.fieldbyname('SYRName').AsString))
else
SYRName.ItemIndex := -1;
end;
finally
end;
end;
procedure TfrmbpRk.FormDestroy(Sender: TObject);
begin
frmbpRk := nil;
end;
procedure TfrmbpRk.FormCreate(Sender: TObject);
begin
CRTime.Date := DServerDate;
cxGrid1.Align := alclient;
readCxGrid(self.Caption, Tv1, '<27><>ƥ<EFBFBD>ֿ<EFBFBD>');
end;
procedure TfrmbpRk.FormClose(Sender: TObject; var Action: TCloseAction);
begin
writeCxGrid(self.Caption, Tv1, '<27><>ƥ<EFBFBD>ֿ<EFBFBD>');
Action := cahide;
end;
procedure TfrmbpRk.FormShow(Sender: TObject);
begin
SetComboBox();
InitGrid();
end;
procedure TfrmbpRk.TBSaveClick(Sender: TObject);
begin
if cds_main.IsEmpty then
exit;
CRTime.SetFocus;
if trim(CRType.Text) = '' then
begin
application.MessageBox('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ͳ<EFBFBD><CDB2><EFBFBD>Ϊ<EFBFBD>գ<EFBFBD>', '<27><>ʾ<EFBFBD><CABE>Ϣ', 0);
exit;
end;
if (trim(CRType.Text) = '<27>˻<EFBFBD><CBBB><EFBFBD><EFBFBD><EFBFBD>') or (trim(CRType.Text) = '<27><EFBFBD>˻<EFBFBD><CBBB><EFBFBD><EFBFBD><EFBFBD>') then
begin
if trim(cust.Text) = '' then
begin
application.MessageBox('<27>˻<EFBFBD><CBBB>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD>գ<EFBFBD>', '<27><>ʾ<EFBFBD><CABE>Ϣ', 0);
exit;
end;
end;
if (trim(CRType.Text) = '<27>ɹ<EFBFBD><C9B9><EFBFBD><EFBFBD><EFBFBD>') then
begin
if trim(FactoryNoName.Text) = '' then
begin
application.MessageBox('<27><>Ӧ<EFBFBD>̲<EFBFBD><CCB2><EFBFBD>Ϊ<EFBFBD>գ<EFBFBD>', '<27><>ʾ<EFBFBD><CABE>Ϣ', 0);
exit;
end;
end;
if cds_main.Locate('QtyUnit', '', []) then
begin
application.MessageBox('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>λ<EFBFBD><CEBB><EFBFBD><EFBFBD>Ϊ<EFBFBD>գ<EFBFBD>', '<27><>ʾ<EFBFBD><CABE>Ϣ', 0);
exit;
end;
if cds_main.Locate('QtyUnit', NULL, []) then
begin
application.MessageBox('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>λ<EFBFBD><CEBB><EFBFBD><EFBFBD>Ϊ<EFBFBD>գ<EFBFBD>', '<27><>ʾ<EFBFBD><CABE>Ϣ', 0);
exit;
end;
if savedate() then
begin
application.MessageBox('<27><><EFBFBD>ݱ<EFBFBD><DDB1><EFBFBD><EFBFBD>ɹ<EFBFBD><C9B9><EFBFBD>', '<27><>ʾ<EFBFBD><CABE>Ϣ');
TBsave.Enabled := false;
if trim(CRType.Text) = '<27><EFBFBD>˻<EFBFBD><CBBB><EFBFBD><EFBFBD><EFBFBD>' then
TBPrint.Visible := true;
// ModalResult:=1;
end
else
begin
application.MessageBox('<27><><EFBFBD>ݱ<EFBFBD><DDB1><EFBFBD>ʧ<EFBFBD>ܣ<EFBFBD>', '<27><>ʾ<EFBFBD><CABE>Ϣ', MB_ICONERROR);
end;
end;
procedure TfrmbpRk.v1P_CodeNamePropertiesButtonClick(Sender: TObject; AButtonIndex: Integer);
begin
try
frmZdyAttachCP := TfrmZdyAttachCP.Create(Application);
with frmZdyAttachCP do
begin
if ShowModal = 1 then
begin
Self.CDS_main.Edit;
Self.CDS_main.FieldByName('P_Code').Value := Trim(CDS_HZ.fieldbyname('ZdyCode').AsString);
Self.CDS_main.FieldByName('P_CodeName').Value := Trim(CDS_HZ.fieldbyname('ZDYName').AsString);
Self.CDS_main.FieldByName('P_Color').Value := Trim(CDS_HZ.fieldbyname('DEFstr3').AsString);
// Self.Order_Sub.FieldByName('SOrddefstr4').Value:=Trim(ClientDataSet1.fieldbyname('Note').AsString);
Self.CDS_main.Post;
end;
end;
finally
frmZdyAttachCP.Free;
end;
self.tv1.Controller.EditingController.ShowEdit();
end;
procedure TfrmbpRk.ToolButton1Click(Sender: TObject);
begin
CDS_Main.Append;
CDS_Main.fieldbyname('CPType').Value := '<27><>Ʒ';
CDS_Main.fieldbyname('QtyUnit').Value := 'M';
CDS_Main.Post;
end;
procedure TfrmbpRk.ToolButton2Click(Sender: TObject);
begin
if CDS_Main.IsEmpty then
exit;
CDS_Main.Delete;
end;
procedure TfrmbpRk.TBCloseClick(Sender: TObject);
begin
close;
end;
procedure TfrmbpRk.v1P_CodeNamePropertiesEditValueChanged(Sender: TObject);
var
mvalue: string;
begin
mvalue := TcxTextEdit(Sender).EditingText;
if trim(mvalue) = '' then
exit;
if rightBstr(trim(mvalue), 1) <> '#' then
begin
mvalue := trim(mvalue) + '#';
end;
with CDS_Main do
begin
Edit;
FieldByName('P_CodeName').Value := Trim(mvalue);
Post;
end;
with ADOQueryCmd do
begin
close;
sql.Clear;
sql.Add('select * from KH_Zdy_Attachment A ');
sql.Add('where zdyName=' + quotedstr(trim(CDS_main.fieldbyname('P_CodeName').AsString)));
open;
end;
if ADOQueryCmd.IsEmpty then
begin
application.MessageBox('Ʒ<><C6B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ڣ<EFBFBD>', '<27><>ʾ<EFBFBD><CABE>Ϣ', 0);
with CDS_main do
begin
Edit;
FieldByName('P_CodeName').Value := '';
Post;
end;
end;
self.tv1.Controller.EditingController.ShowEdit();
end;
procedure TfrmbpRk.v1P_ColorPropertiesEditValueChanged(Sender: TObject);
var
mvalue: string;
begin
mvalue := TcxTextEdit(Sender).EditingText;
if trim(mvalue) = '' then
exit;
if rightBstr(trim(mvalue), 1) <> '#' then
begin
mvalue := trim(mvalue) + '#';
end;
with CDS_Main do
begin
Edit;
FieldByName('P_Color').Value := Trim(mvalue);
Post;
end;
with ADOQueryCmd do
begin
close;
sql.Clear;
sql.Add('select * from KH_Zdy_Attachment A ');
sql.Add('where zdyName=' + quotedstr(trim(CDS_main.fieldbyname('P_CodeName').AsString)));
sql.Add('and DEFstr3=' + quotedstr(trim(CDS_main.fieldbyname('P_Color').AsString)));
open;
end;
if ADOQueryCmd.IsEmpty then
begin
application.MessageBox('<27><>ɫ<EFBFBD><C9AB><EFBFBD><EFBFBD><EFBFBD>ڣ<EFBFBD>', '<27><>ʾ<EFBFBD><CABE>Ϣ', 0);
with CDS_main do
begin
Edit;
FieldByName('P_Color').Value := '';
Post;
end;
end;
self.tv1.Controller.EditingController.ShowEdit();
end;
procedure TfrmbpRk.v1P_ColorPropertiesButtonClick(Sender: TObject; AButtonIndex: Integer);
begin
try
frmZDYHelp := TfrmZDYHelp.Create(Application);
with frmZDYHelp do
begin
flag := 'OrdColor';
flagname := '<27><>ɫ';
V1Name.Caption := '<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>';
V1Note.Caption := <><D3A2><EFBFBD><EFBFBD><EFBFBD><EFBFBD>';
MainType := Trim(DName);
fnote := True;
if ShowModal = 1 then
begin
Self.CDS_Main.Edit;
Self.CDS_Main.FieldByName('P_Color').Value := Trim(ClientDataSet1.fieldbyname('ZDYName').AsString) + '#';
Self.CDS_Main.Post;
end;
end;
finally
frmZDYHelp.Free;
end;
self.tv1.Controller.EditingController.ShowEdit();
end;
procedure TfrmbpRk.custBtnClick(Sender: TObject);
begin
try
frmZdyAttachment := TfrmZdyAttachment.Create(Application);
with frmZdyAttachment do
begin
if trim(self.ckName.Text) = '<27><EFBFBD>ֿ<EFBFBD>' then
fkhType := '<27><EFBFBD>ͻ<EFBFBD>'
else
fkhType := trim(SYRName.Text);
if ShowModal = 1 then
begin
cust.Text := Trim(CDS_HZ.fieldbyname('ZDYName').AsString);
custaddress.Text := Trim(CDS_HZ.fieldbyname('defnote1').AsString);
end;
end;
finally
frmZdyAttachment.Free;
end;
end;
procedure TfrmbpRk.v1QtyPropertiesEditValueChanged(Sender: TObject);
var
fieldname: string;
num1: double;
begin
fieldname := Tv1.Controller.FocusedColumn.DataBinding.FilterFieldName;
with CDS_Main do
begin
Edit;
FieldByName(Trim(fieldname)).Value := TcxTextEdit(Sender).EditingText;
num1 := FieldByName('Qty').AsFloat * FieldByName('Price').AsFloat;
FieldByName('Money').Value := strtofloat(format('%8.2f', [num1]));
Post;
end;
Tv1.Controller.EditingController.ShowEdit();
end;
procedure TfrmbpRk.Edit1KeyPress(Sender: TObject; var Key: Char);
var
FReal: Double;
maxno: string;
begin
if Key = #13 then
begin
if Trim(Edit1.Text) = '' then
Exit;
if TryStrToFloat(Edit1.Text, FReal) = False then
begin
Application.MessageBox('<27><><EFBFBD><EFBFBD><EFBFBD>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD>!', '<27><>ʾ', 0);
Exit;
end;
if CDS_Main.IsEmpty then
begin
CDS_Main.Append;
CDS_Main.fieldbyname('CPType').Value := '<27><>Ʒ';
CDS_main.fieldbyname('RollNum').Value := 1;
CDS_main.fieldbyname('Qty').Value := Edit1.Text;
CDS_Main.fieldbyname('QtyUnit').Value := 'M';
CDS_Main.Post;
end
else
begin
CopyAddRowCDS(CDS_main);
tv1.Controller.EditingController.ShowEdit();
with CDS_main do
begin
Edit;
CDS_main.fieldbyname('RollNum').Value := 1;
CDS_main.fieldbyname('Qty').Value := Edit1.Text;
Post;
end;
end;
Edit1.Text := '';
end;
tv1.Controller.EditingController.ShowEdit();
end;
procedure TfrmbpRk.Edit2KeyPress(Sender: TObject; var Key: Char);
var
FReal: Double;
maxno: string;
I: integer;
begin
if Key = #13 then
begin
if Trim(Edit2.Text) = '' then
Exit;
if TryStrToFlOAT(Edit2.Text, FReal) = False then
begin
Application.MessageBox('<27><><EFBFBD><EFBFBD><EFBFBD>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD>!', '<27><>ʾ', 0);
Exit;
end;
if CDS_main.IsEmpty then
exit;
I := STRTOintdef(Edit2.Text, 0);
for I := 1 to STRTOintdef(Edit2.Text, 0) do
begin
CopyAddRowCDS(CDS_main);
end;
Edit1.Text := '';
end;
tv1.Controller.EditingController.ShowEdit();
end;
procedure TfrmbpRk.TBPrintClick(Sender: TObject);
var
filepath: string;
begin
if CDS_Main.IsEmpty then
exit;
with AdoPrint do
begin
close;
sql.Clear;
sql.Add('exec P_Do_PrintMd ');
sql.Add('@mainID=' + quotedstr(trim(fkeyNO)));
sql.Add(',@flag=' + quotedstr(trim('<27><EFBFBD><E3B6AB><EFBFBD><EFBFBD>')));
open;
end;
try
filepath := ExtractFilePath(Application.ExeName) + 'report\<5C>˻<EFBFBD><CBBB><EFBFBD><EBB5A5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>.rmf';
if not FileExists(Pchar(filepath)) then
begin
application.MessageBox(pchar('<27>ļ<EFBFBD>[' + filepath + ']<5D><><EFBFBD><EFBFBD><EFBFBD>ڣ<EFBFBD>'), '<27><>ʾ<EFBFBD><CABE>Ϣ', MB_IConError);
exit;
end;
RMVariables['dtxz'] := FormatDateTime('yyyy-mm-dd', date());
RMVariables['zdr'] := trim(DName);
RMVariables['Filler'] := trim(CDS_Main.fieldbyname('Filler').AsString);
RMGridReport1.LoadFromFile(filepath);
RMGridReport1.ShowReport;
finally
end;
end;
procedure TfrmbpRk.FactoryNoNamePropertiesButtonClick(Sender: TObject; AButtonIndex: Integer);
begin
try
frmZdyAttachGYS := TfrmZdyAttachGYS.Create(Application);
with frmZdyAttachGYS do
begin
if ShowModal = 1 then
begin
FactoryNoName.Text := Trim(CDS_HZ.fieldbyname('ZDYName').AsString);
FactoryNoName.Hint := Trim(CDS_HZ.fieldbyname('ZdyCode').AsString);
end;
end;
finally
frmZdyAttachGYS.Free;
end;
end;
end.