589 lines
17 KiB
ObjectPascal
589 lines
17 KiB
ObjectPascal
unit U_SampleLR_SO;
|
||
|
||
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,
|
||
cxContainer, cxCurrencyEdit, Menus, cxLookAndFeelPainters, cxButtons, cxImage,
|
||
cxDBEdit, IdBaseComponent, IdComponent, IdTCPConnection, IdTCPClient, IdFTP,
|
||
ShellAPI;
|
||
|
||
type
|
||
TfrmSampleLR_So = class(TForm)
|
||
ToolBar1: TToolBar;
|
||
TBSave: TToolButton;
|
||
TBClose: TToolButton;
|
||
Panel1: TPanel;
|
||
Label1: TLabel;
|
||
CRTime: TDateTimePicker;
|
||
ADOQueryCmd: TADOQuery;
|
||
ADOQueryTmp: TADOQuery;
|
||
DataSource1: TDataSource;
|
||
CDS_Main: TClientDataSet;
|
||
cxGridPopupMenu1: TcxGridPopupMenu;
|
||
Label2: TLabel;
|
||
factoryName: TBtnEditA;
|
||
DeliveryTime: TDateTimePicker;
|
||
Label3: TLabel;
|
||
Label4: TLabel;
|
||
Label5: TLabel;
|
||
Label6: TLabel;
|
||
defstr1: TEdit;
|
||
Label7: TLabel;
|
||
Label9: TLabel;
|
||
defstr3: TEdit;
|
||
Label10: TLabel;
|
||
request: TMemo;
|
||
Qty: TcxCurrencyEdit;
|
||
P_CodeName: TBtnEditA;
|
||
P_Code: TBtnEditA;
|
||
note: TMemo;
|
||
Label11: TLabel;
|
||
defstr5: TEdit;
|
||
Label13: TLabel;
|
||
custName: TBtnEditA;
|
||
Label14: TLabel;
|
||
defflt1: TcxCurrencyEdit;
|
||
Label8: TLabel;
|
||
defflt2: TcxCurrencyEdit;
|
||
Label12: TLabel;
|
||
defflt3: TcxCurrencyEdit;
|
||
Label15: TLabel;
|
||
defflt4: TcxCurrencyEdit;
|
||
Label16: TLabel;
|
||
Label17: TLabel;
|
||
defflt5: TcxCurrencyEdit;
|
||
Label18: TLabel;
|
||
defstr2: TEdit;
|
||
defstr4: TEdit;
|
||
Label19: TLabel;
|
||
Label20: TLabel;
|
||
KHconNo: TEdit;
|
||
kuanNo: TEdit;
|
||
Label21: TLabel;
|
||
Picture4: TcxDBImage;
|
||
FileName: TcxButton;
|
||
ADOQueryImage: TADOQuery;
|
||
DSImage: TDataSource;
|
||
IdFTP1: TIdFTP;
|
||
Panel2: TPanel;
|
||
Label22: TLabel;
|
||
defflt6: TcxCurrencyEdit;
|
||
procedure FormDestroy(Sender: TObject);
|
||
procedure FormCreate(Sender: TObject);
|
||
procedure FormClose(Sender: TObject; var Action: TCloseAction);
|
||
procedure FormShow(Sender: TObject);
|
||
procedure TBSaveClick(Sender: TObject);
|
||
procedure ToolButton1Click(Sender: TObject);
|
||
procedure TBCloseClick(Sender: TObject);
|
||
procedure v1P_CodePropertiesButtonClick(Sender: TObject; AButtonIndex: Integer);
|
||
procedure factoryNameBtnClick(Sender: TObject);
|
||
procedure P_CodeNameBtnClick(Sender: TObject);
|
||
procedure P_CodeBtnClick(Sender: TObject);
|
||
procedure custNameBtnClick(Sender: TObject);
|
||
procedure FileNameClick(Sender: TObject);
|
||
procedure Picture4DblClick(Sender: TObject);
|
||
private
|
||
fFlileFlag: string;
|
||
procedure InitGrid();
|
||
function savedate(): Boolean;
|
||
procedure InitImage();
|
||
procedure LookImage(FileName: string);
|
||
function YFData_other(moneyFee: string; money: double): Boolean;
|
||
{ Private declarations }
|
||
public
|
||
fkeyNO: string;
|
||
FCRFlag: string;
|
||
canshu1: string;
|
||
|
||
{ Public declarations }
|
||
end;
|
||
|
||
var
|
||
frmSampleLR_So: TfrmSampleLR_So;
|
||
|
||
implementation
|
||
|
||
uses
|
||
U_DataLink, U_Fun10, U_ZDYHelp, U_ZdyAttachGYS, U_CPManageSel, U_ZdyAttachment,
|
||
getpic;
|
||
{$R *.dfm}
|
||
|
||
function TfrmSampleLR_So.YFData_other(moneyFee: string; money: double): Boolean;
|
||
var
|
||
CRID, YFID: string;
|
||
begin
|
||
CRID := '0';
|
||
Result := False;
|
||
with ADOQueryTmp do
|
||
begin
|
||
Close;
|
||
sql.Clear;
|
||
sql.Add(' select * from YF_Money_CR where FactoryName=''' + Trim(factoryName.Text) + '''');
|
||
sql.Add(' and mainID=''' + Trim(fkeyNo) + '''');
|
||
sql.Add(' and YFName=''' + trim(moneyFee) + ''' ');
|
||
Open;
|
||
end;
|
||
if ADOQueryTmp.IsEmpty then
|
||
begin
|
||
if GetLSNo(ADOQueryCmd, YFID, 'YF', 'YF_Money_CR', 3, 1) = False then
|
||
begin
|
||
Application.MessageBox('ȡӦ<C8A1><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(fkeyNo);
|
||
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(factoryName.Text);
|
||
FieldByName('CRTime').Value := Trim(FormatDateTime('yyyy-MM-dd', CRTime.Date));
|
||
FieldByName('YFType').Value := '<27>Զ<EFBFBD><D4B6><EFBFBD><EFBFBD><EFBFBD>';
|
||
FieldByName('Qty').Value := money;
|
||
FieldByName('Price').Value := 0;
|
||
FieldByName('money').Value := 0;
|
||
FieldByName('BBmoney').Value := 0;
|
||
FieldByName('HuiLv').Value := 1;
|
||
FieldByName('BZType').Value := 'RMB';
|
||
FieldByName('QtyUnit').Value := '<27><>';
|
||
FieldByName('ComTaiTou').Value := Trim(factoryName.Text);
|
||
FieldByName('YFName').Value := trim(moneyFee);
|
||
FieldByName('MainId').Value := Trim(fkeyNo);
|
||
// FieldByName('subID').Value:=Trim(Ado.fieldbyname('subID').AsString);
|
||
// FieldByName('OrderNO').Value:=Trim(Ado.fieldbyname('conNo').AsString);
|
||
FieldByName('P_CodeName').Value := Trim(P_CodeName.Text);
|
||
// FieldByName('P_Spec').Value:=Trim(P_CodeName.Text);
|
||
FieldByName('P_color').Value := Trim(defstr5.Text);
|
||
FieldByName('status').Value := '0';
|
||
Post;
|
||
end;
|
||
end
|
||
else
|
||
begin
|
||
YFID := Trim(ADOQueryTmp.fieldbyname('YFID').AsString);
|
||
end;
|
||
with ADOQueryCmd do
|
||
begin
|
||
Close;
|
||
sql.Clear;
|
||
sql.Add('update YF_Money_CR Set Qty=(select (case when YF_Money_CR.YFName=''SO<53><4F><EFBFBD><EFBFBD>''then isnull(A.defflt6,0) else isnull(A.defflt4,0) end) from JY_Sample A where A.JSNO=YF_Money_CR.MainID) ');
|
||
sql.Add(' where YFID=''' + Trim(YFID) + '''');
|
||
ExecSQL;
|
||
end;
|
||
with ADOQueryCmd do
|
||
begin
|
||
Close;
|
||
sql.Clear;
|
||
sql.Add('delete from YF_Money_CR ');
|
||
sql.Add('where YFID=''' + Trim(YFID) + ''' and Qty=0 and YFName=''' + trim(moneyFee) + '''');
|
||
ExecSQL;
|
||
end;
|
||
with ADOQueryCmd do
|
||
begin
|
||
Close;
|
||
sql.Clear;
|
||
sql.Add('Update YF_Money_CR Set Money=Price*Qty,BBMoney=Price*Qty*HuiLv');
|
||
sql.Add(' where YFID=''' + Trim(YFID) + '''');
|
||
ExecSQL;
|
||
end;
|
||
Result := True;
|
||
end;
|
||
|
||
procedure TfrmSampleLR_So.LookImage(FileName: string);
|
||
var
|
||
sFieldName: string;
|
||
// ff: TADOBlobStream;
|
||
// FJStream : TMemoryStream;
|
||
begin
|
||
|
||
sFieldName := leftbstr(ExtractFilePath(Application.ExeName), 1) + ':\ͼƬ<CDBC>鿴';
|
||
|
||
if not DirectoryExists(pchar(sFieldName)) then
|
||
CreateDirectory(pchar(sFieldName), nil);
|
||
|
||
sFieldName := sFieldName + '\' + trim(FileName);
|
||
|
||
try
|
||
IdFTP1.Host := ReadINIFileStr('SYSTEMSET.INI', 'SERVER', '<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ַ', '127.0.0.1');
|
||
IdFTP1.Username := 'three';
|
||
IdFTP1.Password := '641010';
|
||
IdFTP1.Connect();
|
||
except
|
||
;
|
||
end;
|
||
|
||
if IdFTP1.Connected then
|
||
begin
|
||
|
||
Panel2.Caption := '<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ݣ<EFBFBD><DDA3><EFBFBD><EFBFBD>Ե<EFBFBD>...';
|
||
Panel2.Visible := true;
|
||
application.ProcessMessages;
|
||
try
|
||
IdFTP1.Get(fFlileFlag + '\' + Trim(FileName), sFieldName, true, false);
|
||
except
|
||
Panel2.Visible := false;
|
||
Application.MessageBox('<27>ͻ<EFBFBD>ͼ<EFBFBD><CDBC><EFBFBD>ļ<EFBFBD><C4BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>', '<27><>ʾ', MB_ICONWARNING);
|
||
IdFTP1.Quit;
|
||
Exit;
|
||
end;
|
||
end
|
||
else
|
||
begin
|
||
Panel2.Visible := false;
|
||
Application.MessageBox('<27><EFBFBD><DEB7><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD><C4BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>', '<27><>ʾ', MB_ICONWARNING);
|
||
IdFTP1.Quit;
|
||
Exit;
|
||
end;
|
||
Panel2.Visible := false;
|
||
if IdFTP1.Connected then
|
||
IdFTP1.Quit;
|
||
ShellExecute(Handle, 'open', PChar(sFieldName), '', '', SW_SHOWNORMAL);
|
||
end;
|
||
|
||
procedure TfrmSampleLR_So.InitImage();
|
||
begin
|
||
with ADOQueryImage do
|
||
begin
|
||
close;
|
||
sql.Clear;
|
||
sql.Add('select * from TP_File A');
|
||
sql.Add('where WBID=' + quotedstr(trim(fkeyNO)));
|
||
sql.Add('and TFType=' + quotedstr(trim('SO')));
|
||
open;
|
||
end;
|
||
end;
|
||
|
||
function TfrmSampleLR_So.savedate(): Boolean;
|
||
begin
|
||
result := false;
|
||
try
|
||
ADOQueryCmd.Connection.BeginTrans;
|
||
if trim(fkeyNo) = '' then
|
||
begin
|
||
if GetLSNo(ADOQueryTmp, fkeyNo, '', 'JY_Sample', 3, 1) = False then
|
||
begin
|
||
ADOQueryCmd.Connection.RollbackTrans;
|
||
Application.MessageBox('ȡ<><C8A1><EFBFBD><EFBFBD>ˮ<EFBFBD><CBAE>ʧ<EFBFBD>ܣ<EFBFBD>', '<27><>ʾ', 0);
|
||
Exit;
|
||
end;
|
||
fkeyNo := trim(DCode) + fkeyNo;
|
||
end;
|
||
with ADOQueryCmd do
|
||
begin
|
||
close;
|
||
sql.Clear;
|
||
sql.Add('select * from JY_Sample where JSNO=''' + trim(fkeyNo) + ''' and CRFlag=''' + trim(fCRFlag) + '''');
|
||
open;
|
||
end;
|
||
if ADOQueryCmd.IsEmpty then
|
||
begin
|
||
ADOQueryCmd.Append;
|
||
ADOQueryCmd.FieldByName('Filler').Value := DName;
|
||
end
|
||
else
|
||
begin
|
||
ADOQueryCmd.Edit;
|
||
ADOQueryCmd.FieldByName('editer').Value := DName;
|
||
ADOQueryCmd.FieldByName('editTime').Value := now();
|
||
end;
|
||
SSetsaveSqlNew(ADOQueryCmd, 'JY_Sample', Panel1, 0);
|
||
|
||
ADOQueryCmd.fieldbyname('JSNO').Value := fkeyNo;
|
||
ADOQueryCmd.fieldbyname('JSID').Value := 1;
|
||
ADOQueryCmd.fieldbyname('CRFlag').Value := fCRFlag;
|
||
ADOQueryCmd.fieldbyname('Qty').Value := strtofloatdef(trim(Qty.Text), 0);
|
||
ADOQueryCmd.fieldbyname('defflt1').Value := strtofloatdef(trim(defflt1.Text), 0);
|
||
ADOQueryCmd.fieldbyname('defflt2').Value := strtofloatdef(trim(defflt2.Text), 0);
|
||
ADOQueryCmd.fieldbyname('defflt3').Value := strtofloatdef(trim(defflt3.Text), 0);
|
||
ADOQueryCmd.fieldbyname('defflt4').Value := strtofloatdef(trim(defflt4.Text), 0);
|
||
ADOQueryCmd.Post;
|
||
|
||
if trim(factoryName.Text) <> '' then
|
||
begin
|
||
if not YFdata_other('SO<53><4F><EFBFBD><EFBFBD>', strtofloatdef(defflt6.Text, 0)) then
|
||
begin
|
||
ADOQueryCmd.Connection.RollbackTrans;
|
||
exit;
|
||
end;
|
||
if not YFdata_other('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>', strtofloatdef(defflt4.Text, 0)) then
|
||
begin
|
||
ADOQueryCmd.Connection.RollbackTrans;
|
||
exit;
|
||
end;
|
||
end;
|
||
ADOQueryCmd.Connection.CommitTrans;
|
||
result := true;
|
||
except
|
||
ADOQueryCmd.Connection.RollbackTrans;
|
||
end;
|
||
end;
|
||
|
||
procedure TfrmSampleLR_So.InitGrid();
|
||
begin
|
||
try
|
||
with adoqueryTmp do
|
||
begin
|
||
close;
|
||
sql.Clear;
|
||
sql.Add('select A.* from JY_Sample A');
|
||
sql.Add('where JSNO=' + quotedstr(trim(fkeyNO)));
|
||
open;
|
||
end;
|
||
if not adoqueryTmp.IsEmpty then
|
||
begin
|
||
SCSHDataNew(adoqueryTmp, Panel1, 0);
|
||
end;
|
||
finally
|
||
end;
|
||
end;
|
||
|
||
procedure TfrmSampleLR_So.FormDestroy(Sender: TObject);
|
||
begin
|
||
frmSampleLR_SO := nil;
|
||
end;
|
||
|
||
procedure TfrmSampleLR_So.FormCreate(Sender: TObject);
|
||
begin
|
||
CRTime.Date := DServerDate;
|
||
DeliveryTime.Date := CRTime.Date;
|
||
end;
|
||
|
||
procedure TfrmSampleLR_So.FormClose(Sender: TObject; var Action: TCloseAction);
|
||
begin
|
||
Action := cahide;
|
||
end;
|
||
|
||
procedure TfrmSampleLR_So.FormShow(Sender: TObject);
|
||
begin
|
||
if trim(canshu1) = '<27><>Ȩ<EFBFBD><C8A8>' then
|
||
begin
|
||
defstr2.Enabled := true;
|
||
defstr4.Enabled := true;
|
||
end;
|
||
fFlileFlag := UserDataFlag + 'SO';
|
||
InitGrid();
|
||
InitImage();
|
||
end;
|
||
|
||
procedure TfrmSampleLR_So.TBSaveClick(Sender: TObject);
|
||
begin
|
||
CRTime.SetFocus;
|
||
if trim(P_Code.Text) = '' then
|
||
begin
|
||
application.MessageBox('<27><>Ʒ<EFBFBD><C6B7><EFBFBD>Ų<EFBFBD><C5B2><EFBFBD>Ϊ<EFBFBD>գ<EFBFBD>', '<27><>ʾ<EFBFBD><CABE>Ϣ', MB_ICONERROR);
|
||
exit;
|
||
end;
|
||
if trim(P_CodeName.Text) = '' then
|
||
begin
|
||
application.MessageBox('<27><>Ʒ<EFBFBD><C6B7><EFBFBD>Ʋ<EFBFBD><C6B2><EFBFBD>Ϊ<EFBFBD>գ<EFBFBD>', '<27><>ʾ<EFBFBD><CABE>Ϣ', MB_ICONERROR);
|
||
exit;
|
||
end;
|
||
if savedate() then
|
||
begin
|
||
application.MessageBox('<27><><EFBFBD>ݱ<EFBFBD><DDB1><EFBFBD><EFBFBD>ɹ<EFBFBD><C9B9><EFBFBD>', '<27><>ʾ<EFBFBD><CABE>Ϣ');
|
||
// ModalResult:=1;
|
||
end
|
||
else
|
||
begin
|
||
application.MessageBox('<27><><EFBFBD>ݱ<EFBFBD><DDB1><EFBFBD>ʧ<EFBFBD>ܣ<EFBFBD>', '<27><>ʾ<EFBFBD><CABE>Ϣ', MB_ICONERROR);
|
||
end;
|
||
end;
|
||
|
||
procedure TfrmSampleLR_So.ToolButton1Click(Sender: TObject);
|
||
begin
|
||
{ frmCPManageSel:=TfrmCPManageSel.create(self);
|
||
with frmCPManageSel do
|
||
begin
|
||
if showmodal=1 then
|
||
begin
|
||
self.cds_main.DisableControls;
|
||
CDS_Main.DisableControls;
|
||
CDS_Main.First;
|
||
while not CDS_Main.Eof do
|
||
begin
|
||
if (cds_main.fieldbyname('ssel').AsBoolean) and
|
||
(not self.cds_main.Locate('P_Code',trim(cds_main.fieldbyname('CYNo').AsString),[])) then
|
||
begin
|
||
self.cds_main.Append;
|
||
// self.cds_main.FieldByName('kcid').Value:=trim(cds_main.fieldbyname('kcid').AsString);
|
||
// self.cds_main.FieldByName('mainID').Value:=trim(cds_main.fieldbyname('mainID').AsString);
|
||
// self.cds_main.FieldByName('subID').Value:=trim(cds_main.fieldbyname('subID').AsString);
|
||
// self.cds_main.FieldByName('MJID').Value:=trim(cds_main.fieldbyname('MJID').AsString);
|
||
// self.cds_main.FieldByName('MJXH').Value:=trim(cds_main.fieldbyname('MJXH').AsString);
|
||
// self.cds_main.FieldByName('CPTYPE').Value:=trim(cds_main.fieldbyname('MJType').AsString);
|
||
self.cds_main.FieldByName('P_Code').Value:=trim(cds_main.fieldbyname('CYNo').AsString);
|
||
self.cds_main.FieldByName('P_CodeName').Value:=trim(cds_main.fieldbyname('CYName').AsString);
|
||
self.cds_main.FieldByName('defnote5').Value:=trim(cds_main.fieldbyname('defnote5').AsString);
|
||
self.cds_main.FieldByName('P_spec').Value:=trim(cds_main.fieldbyname('CYSpec').AsString);
|
||
self.cds_main.FieldByName('P_cf').Value:=trim(cds_main.fieldbyname('CYECF').AsString);
|
||
self.cds_main.FieldByName('CYMF').Value:=trim(cds_main.fieldbyname('CYMF').AsString);
|
||
self.cds_main.FieldByName('CYKZ').Value:=trim(cds_main.fieldbyname('CYKZ').AsString);
|
||
self.cds_main.FieldByName('factoryName').Value:=trim(cds_main.fieldbyname('DefStr7').AsString);
|
||
self.cds_main.FieldByName('Kuwei').Value:=trim(cds_main.fieldbyname('DefStr2').AsString);
|
||
// self.cds_main.FieldByName('P_Color').Value:=trim(cds_main.fieldbyname('P_Color').AsString);
|
||
// self.cds_main.FieldByName('P_MF').Value:=cds_main.fieldbyname('P_MF').AsFloat;
|
||
// self.cds_main.FieldByName('P_KZ').Value:=cds_main.fieldbyname('P_KZ').AsFloat;
|
||
// self.cds_main.FieldByName('RollNum').Value:=;
|
||
// self.cds_main.FieldByName('Qty').Value:=cds_main.fieldbyname('MJLen').AsFloat;
|
||
// self.cds_main.FieldByName('QtyUnit').Value:=trim(cds_main.fieldbyname('MJTypeother').AsString);
|
||
self.cds_main.Post;
|
||
end;
|
||
cds_main.Next;
|
||
end;
|
||
cds_main.EnableControls;
|
||
self.cds_main.EnableControls;
|
||
end;
|
||
free;
|
||
end;
|
||
// cds_main.Append;
|
||
// cds_Main.fieldbyname('qtyUnit').Value:='M';
|
||
// cds_main.post; }
|
||
end;
|
||
|
||
procedure TfrmSampleLR_So.TBCloseClick(Sender: TObject);
|
||
begin
|
||
close;
|
||
end;
|
||
|
||
procedure TfrmSampleLR_So.v1P_CodePropertiesButtonClick(Sender: TObject; AButtonIndex: Integer);
|
||
begin
|
||
try
|
||
frmZDYHelp := TfrmZDYHelp.Create(Application);
|
||
with frmZDYHelp do
|
||
begin
|
||
flag := 'YPCode';
|
||
flagname := '<27><>Ʒ<EFBFBD><C6B7><EFBFBD><EFBFBD>';
|
||
if ShowModal = 1 then
|
||
begin
|
||
Self.CDS_Main.Edit;
|
||
Self.CDS_Main.FieldByName('P_Code').Value := Trim(ClientDataSet1.fieldbyname('ZDYName').AsString);
|
||
end;
|
||
end;
|
||
finally
|
||
frmZDYHelp.Free;
|
||
end;
|
||
end;
|
||
|
||
procedure TfrmSampleLR_So.factoryNameBtnClick(Sender: TObject);
|
||
begin
|
||
frmZdyAttachGYS := TfrmZdyAttachGYS.create(self);
|
||
with frmZdyAttachGYS do
|
||
begin
|
||
DEFstr5.ItemIndex := DEFstr5.Items.IndexOf('<27>ӹ<EFBFBD><D3B9><EFBFBD>');
|
||
DEFstr5.Enabled := false;
|
||
if showmodal = 1 then
|
||
begin
|
||
factoryName.Text := trim(CDS_HZ.fieldbyname('zdyName').AsString)
|
||
end;
|
||
free;
|
||
end;
|
||
end;
|
||
|
||
procedure TfrmSampleLR_So.P_CodeNameBtnClick(Sender: TObject);
|
||
begin
|
||
try
|
||
frmZDYHelp := TfrmZDYHelp.Create(Application);
|
||
with frmZDYHelp do
|
||
begin
|
||
flag := 'MPRTCodeName';
|
||
flagname := '<27><>Ʒ<EFBFBD><C6B7><EFBFBD><EFBFBD>';
|
||
if ShowModal = 1 then
|
||
begin
|
||
P_CodeName.Text := Trim(ClientDataSet1.fieldbyname('ZDYName').AsString);
|
||
end;
|
||
end;
|
||
finally
|
||
frmZDYHelp.Free;
|
||
end;
|
||
end;
|
||
|
||
procedure TfrmSampleLR_So.P_CodeBtnClick(Sender: TObject);
|
||
begin
|
||
frmCPManageSel := TfrmCPManageSel.Create(self);
|
||
with frmCPManageSel do
|
||
begin
|
||
if showmodal = 1 then
|
||
begin
|
||
P_Code.Text := CDS_Main.fieldbyname('CYNo').asstring;
|
||
P_CodeName.Text := CDS_Main.fieldbyname('CYName').asstring;
|
||
end;
|
||
free;
|
||
end;
|
||
end;
|
||
|
||
procedure TfrmSampleLR_So.custNameBtnClick(Sender: TObject);
|
||
begin
|
||
frmZdyAttachment := TfrmZdyAttachment.create(self);
|
||
with frmZdyAttachment do
|
||
begin
|
||
if trim(canshu1) <> '<27><>Ȩ<EFBFBD><C8A8>' then
|
||
canshu1 := 'ҵ<><D2B5>Ա';
|
||
if showmodal = 1 then
|
||
begin
|
||
custName.Text := trim(CDS_HZ.fieldbyname('CoName').AsString)
|
||
end;
|
||
free;
|
||
end;
|
||
end;
|
||
|
||
procedure TfrmSampleLR_So.FileNameClick(Sender: TObject);
|
||
begin
|
||
if trim(fkeyNO) = '' then
|
||
begin
|
||
application.MessageBox('SO<53><4F><EFBFBD><EFBFBD>Ϣδ<CFA2><CEB4><EFBFBD>棬<EFBFBD><E6A3AC><EFBFBD>ȱ<EFBFBD><C8B1><EFBFBD>SO<53><4F><EFBFBD><EFBFBD>Ϣ<EFBFBD><CFA2>', '<27><>ʾ<EFBFBD><CABE>Ϣ', MB_ICONERROR);
|
||
exit;
|
||
end;
|
||
|
||
try
|
||
FormGetPic := TFormGetPic.Create(Application);
|
||
with FormGetPic do
|
||
begin
|
||
fkeyNO := trim(self.fkeyNO);
|
||
pat1 := TCXbutton(Sender).Name;
|
||
pic1 := TCXbutton(Sender).Hint;
|
||
FTFType := 'SO';
|
||
fFlileFlag := self.fFlileFlag;
|
||
if ShowModal = 1 then
|
||
begin
|
||
// self.Timage(Tbutton(Sender).Hint).Picture.Assign(FormGetPic.Image2.Picture.Bitmap);
|
||
// zdycode.Enabled:=false;
|
||
end;
|
||
|
||
Release;
|
||
end;
|
||
InitImage();
|
||
except
|
||
if FormGetPic <> nil then
|
||
FormGetPic.Release;
|
||
end;
|
||
end;
|
||
|
||
procedure TfrmSampleLR_So.Picture4DblClick(Sender: TObject);
|
||
begin
|
||
if TcxDBImage(Sender).Picture.Height = 0 then
|
||
exit;
|
||
|
||
LookImage(ADOQueryImage.fieldbyname(TcxDBImage(Sender).Hint).asstring);
|
||
|
||
end;
|
||
|
||
end.
|
||
|