You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
DS6JIEFENG/海关EDI/u_op_seae_edi_custom_ld.pas

1419 lines
57 KiB
Plaintext

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

unit u_op_seae_edi_custom_ld;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,IdFTP,IdFTPCommon,
Dialogs, BusinessSkinForm, StdCtrls, bsSkinCtrls,inifiles, DB, ADODB,
IdComponent, IdTCPConnection, IdTCPClient, IdExplicitTLSClientServerBase,
IdMessageClient, IdSMTPBase, IdSMTP, IdBaseComponent, IdMessage,IdAttachmentFile;
type
Tfrm_op_seae_edi_custom_ld = class(TForm)
bsBusinessSkinForm1: TbsBusinessSkinForm;
Label2: TLabel;
Edit2: TEdit;
Edit1: TEdit;
Label1: TLabel;
SaveDialog1: TSaveDialog;
bsSkinButton1: TbsSkinButton;
bsSkinButton2: TbsSkinButton;
bsSkinButton3: TbsSkinButton;
t_op_ctn: TADOQuery;
t_op_ctn1: TDataSource;
bsSkinRadioGroup1: TbsSkinRadioGroup;
Label3: TLabel;
Edit3: TEdit;
bsSkinRadioGroup2: TbsSkinRadioGroup;
bsSkinButton4: TbsSkinButton;
bsSkinGroupBox1: TbsSkinGroupBox;
Label4: TLabel;
Label5: TLabel;
Label6: TLabel;
Label7: TLabel;
Edit4: TEdit;
Edit5: TEdit;
Edit6: TEdit;
Edit7: TEdit;
t_op_ams: TADOQuery;
t_op_ams1: TDataSource;
bsSkinCheckRadioBox2: TbsSkinCheckRadioBox;
t_op_seae_assistant: TADOQuery;
Label8: TLabel;
Edit8: TEdit;
Label9: TLabel;
Edit9: TEdit;
Label10: TLabel;
Edit10: TEdit;
Label11: TLabel;
Edit11: TEdit;
Label12: TLabel;
Edit12: TEdit;
t_op_edictn: TADOQuery;
Label13: TLabel;
Label14: TLabel;
Edit13: TEdit;
Edit14: TEdit;
Label15: TLabel;
Edit15: TEdit;
IdMsg: TIdMessage;
SMTP1: TIdSMTP;
procedure bsSkinButton2Click(Sender: TObject);
procedure FormShow(Sender: TObject);
procedure bsSkinButton1Click(Sender: TObject);
procedure bsSkinButton3Click(Sender: TObject);
procedure bsSkinButton4Click(Sender: TObject);
private
function isEditrue(DataSet:TDataSet): boolean;
function GetStrNum(str:String):integer;
function FormatListString(Old:TStrings;mCount,Strlength:integer):String;
function FormatEdiString(str:String;Strlength:integer=0):String;
function CreateSIEdiFile_MBL:TStrings;
function GetCntrEdi(cntrsize: String):String;
function GetpkgsEdi(pkgs:String):String;
function GetlineEdi(aline:String):String;
function GetvesselEdi(avessel:String):String;
function GetLengthword(var s: String; l: Integer;str:String): String;
procedure GetLengthTString(var sl:TStringList;l:integer);
function IsZhongwen(Str:String):Boolean;
function Changestr(str:widestring):string;
{ Private declarations }
public
{ Public declarations }
function GetPortStr(Port:String):String;
function GetPPCC(aFree:String):string;
function GetCntrSize(code,Cntr:String):string;
function Getport(code,port:String):string;
function GetCarrCustomNO(sanme:String):string;
end;
var
frm_op_seae_edi_custom_ld: Tfrm_op_seae_edi_custom_ld;
implementation
uses u_op_seae_edi_data, u_main, my_sys_function, u_data_share;
{$R *.dfm}
function Tfrm_op_seae_edi_custom_ld.Changestr(str:widestring):string;
var
i:integer;
strC:widestring;
begin
strC:='';
for i:=1 to length(str) do
begin
if ((str[i]=#39) or (str[i]=':') or (str[i]='''') or (str[i]='+') or (str[i]='?')) then
begin
strC:=strC+'?'+str[i];
end
else
begin
strC:=strC+str[i];
end;
end;
result:=strC;
end;
function Tfrm_op_seae_edi_custom_ld.GetCarrCustomNO(sanme:String):string;
var
aQuery:TADOQuery;
begin
result:='';
aQuery:=CreateAdoQuery;
try
with aQuery do begin
Close;SQL.Clear;
SQL.Add('Select <20>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>,<2C><><EFBFBD>ر<EFBFBD><D8B1><EFBFBD> from t_crm_client where <20>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>=:<3A>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>');
Parameters.ParamByName('<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>').Value:=sanme;
Open;
if (not IsEmpty) and (FieldByName('<27><><EFBFBD>ر<EFBFBD><D8B1><EFBFBD>').AsString<>'') then begin
Result:=FieldByName('<27><><EFBFBD>ر<EFBFBD><D8B1><EFBFBD>').AsString;
end;
end;
finally
FreeAndNil(aQuery);
end;
end;
function Tfrm_op_seae_edi_custom_ld.GetPPCC(aFree:String):string;
var
aQuery:TADOQuery;
begin
result:='';
aQuery:=CreateAdoQuery;
try
with aQuery do begin
Close;SQL.Clear;
SQL.Add('Select <20><><EFBFBD><EFBFBD> from t_code_FREE where <20><><EFBFBD>ѷ<EFBFBD>ʽ=:FREE');
Parameters.ParamByName('FREE').Value:=aFree;
Open;
if (not IsEmpty) and (FieldByName('<27><><EFBFBD><EFBFBD>').AsString<>'') then begin
Result:=FieldByName('<27><><EFBFBD><EFBFBD>').AsString;
end;
end;
finally
FreeAndNil(aQuery);
end;
end;
function Tfrm_op_seae_edi_custom_ld.GetCntrSize(code,Cntr:String):string;
var
aQuery:TADOQuery;
begin
result:=Cntr;
aQuery:=CreateAdoQuery;
try
with aQuery do begin
Close;SQL.Clear;
SQL.Add('Select EDI<44><49><EFBFBD><EFBFBD> from t_code_ctn where <20><><EFBFBD><EFBFBD>='''+Code+'''');
Open;
if (not IsEmpty) and (FieldByName('EDI<44><49><EFBFBD><EFBFBD>').AsString<>'') then begin
Result:=FieldByName('EDI<44><49><EFBFBD><EFBFBD>').AsString;
end;
end;
finally
FreeAndNil(aQuery);
end;
end;
function Tfrm_op_seae_edi_custom_ld.Getport(code,port:String):string;
var
aQuery:TADOQuery;
begin
result:=port;
aQuery:=CreateAdoQuery;
try
with aQuery do begin
Close;SQL.Clear;
SQL.Add('Select <20>ۿ<EFBFBD><DBBF><EFBFBD><EFBFBD><EFBFBD> from t_code_edi_port where EDI<44><49><EFBFBD><EFBFBD>='''+Code+'''');
Open;
if (not IsEmpty) and (FieldByName('<27>ۿ<EFBFBD><DBBF><EFBFBD><EFBFBD><EFBFBD>').AsString<>'') then begin
Result:=FieldByName('<27>ۿ<EFBFBD><DBBF><EFBFBD><EFBFBD><EFBFBD>').AsString;
end;
end;
if Pos(',',Result)>0 then
Result:=Copy(Result,1,Pos(',',Result)-1);
finally
FreeAndNil(aQuery);
end;
end;
function Tfrm_op_seae_edi_custom_ld.GetPortStr(Port:String):String;
begin
if Pos(',',Port)>0 then
Result:=Copy(Port,1,Pos(',',Port)-1)
else
Result:=Port;
end;
function Tfrm_op_seae_edi_custom_ld.IsZhongwen(Str: String): Boolean;
var
i:Integer;
begin
Result:=false;
if Str='' then Exit;
for i:=1 to Length(Str) do begin
// if Str[i]>Chr(127) then begin
if bytetype(Str[i],1)<>mbsinglebyte then begin
Result:=True;
Exit;
end;
end;
end;
function Tfrm_op_seae_edi_custom_ld.GetLengthword(var s: String; l: Integer;str:String): String;
var
i:Integer;
b:Boolean;
begin
s:='';
if Length(str)<=l then begin
result:=str;
end else begin
b:=true;
s:=Copy(str,l+1,Length(str)-l);
str:=Copy(str,1,l);
result:='';
for i:=Length(str) downto 1 do begin
if ( not (str[i] in [' ',';',',','.',':','/','(',')','?','+','-'])) and b then
s:=str[i]+s
else begin
b:=false;
result:=str[i]+Result;
end;
end;
s:=s+' ';
end;
end;
procedure Tfrm_op_seae_edi_custom_ld.GetLengthTString(var sl: TStringList; l: integer);
var
i:integer;
str_head,S:String;
Stemp:TStrings;
begin
Stemp:=TStringList.Create;
try
str_head:='';
S:='';
for i:=0 to sl.Count-1 do begin
if sl[i]<>'' then
stemp.add(GetLengthword(str_head,l,s+sl[i]));
S:=Str_head;
end;
while S<>'' do begin
stemp.add(GetLengthword(str_head,l,s));
S:=Str_head;
end;
SL.Assign(Stemp);
finally
FreeAndNil(Stemp);
end;
end;
function Tfrm_op_seae_edi_custom_ld.FormatEdiString(str:String;Strlength:integer=0):String;
var
i:integer;
strC:widestring;
begin
strC:='';
for i:=1 to length(str) do
begin
if ((str[i]=#39) or (str[i]=':') or (str[i]='+') or (str[i]='?') or (str[i]=';')) then
begin
strC:=strC+'?'+str[i];
end
else
begin
strC:=strC+str[i];
end;
end;
result:=strC;
end;
function Tfrm_op_seae_edi_custom_ld.FormatListString(Old:TStrings;mCount,Strlength:integer):String;
var
i:integer;
NewStrs:TStrings;
mStr:String;
begin
Result:='';
NewStrs:=TStringList.Create;
for i:=0 to old.Count-1 do begin
if Length(old.Strings[i])<=Strlength then begin
NewStrs.Add(old.Strings[i]);
end else begin
mStr:=old.Strings[i];
while length(mStr)>Strlength do begin
newStrs.Add(copy(mStr,1,Strlength));
system.Delete(mStr,1,Strlength);
end;
newStrs.Add(mStr);
end;
end;
try
for i:=0 to mCount-1 do begin
if i<NewStrs.Count then begin
Result:=Result+NewStrs.Strings[i];
end;
if i<mCount-1 then
Result:=Result+':';
end;
finally
FreeAndNil(NewStrs);
end;
end;
function Tfrm_op_seae_edi_custom_ld.GetStrNum(str:String):integer;
var
i:integer;
begin
result:=0;
if str='' then exit;
for i:=1 to length(Str) do begin
if str[i] in ['0','1','2','3','4','5','6','7','8','9'] then
result:=result+1;
end;
end;
procedure Tfrm_op_seae_edi_custom_ld.bsSkinButton2Click(Sender: TObject);
begin
close;
end;
procedure Tfrm_op_seae_edi_custom_ld.FormShow(Sender: TObject);
var
inifile1:Tinifile;
begin
inifile1:=Tinifile.Create(ExtractFilePath(application.ExeName)+'main.ini');
edit1.text:=inifile1.ReadString('customLD','SEND','');
edit2.text:=inifile1.ReadString('customLD','RECIEVE','');
edit3.text:=inifile1.ReadString('customLD','SENDNAME','');
edit4.text:=inifile1.ReadString('customLD','FTPSERVER','');
edit5.text:=inifile1.ReadString('customLD','FTPPATH','/');
edit6.text:=inifile1.ReadString('customLD','FTPNAME','');
edit7.text:=inifile1.ReadString('customLD','FTPPASS','');
edit8.text:=inifile1.ReadString('customLD','SENDDEPT','');
edit9.text:=inifile1.ReadString('customLD','SENDATTN','');
edit10.text:=inifile1.ReadString('customLD','SENDTEL','');
edit11.text:=inifile1.ReadString('customLD','SENDFAX','');
edit12.text:=inifile1.ReadString('customLD','SENDEMAIL','');
edit13.text:=inifile1.ReadString('customLD','ESINAME','');
edit14.text:=inifile1.ReadString('customLD','ESIPASS','');
inifile1.free;
t_op_ams.close;
t_op_ams.Parameters.ParamByName('<27><><EFBFBD><EFBFBD>').Value:=frm_op_seae_edi_data.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring;
t_op_ams.open;
end;
procedure Tfrm_op_seae_edi_custom_ld.bsSkinButton1Click(Sender: TObject);
var
Str:TStrings;
inifile1:Tinifile;
i:integer;
begin
inifile1:=Tinifile.Create(ExtractFilePath(application.ExeName)+'main.ini');
inifile1.WriteString('customLD','SEND',edit1.text);
inifile1.WriteString('customLD','RECIEVE',edit2.text);
inifile1.WriteString('customLD','SENDNAME',edit3.text);
inifile1.WriteString('customLD','FTPSERVER',edit4.text);
inifile1.WriteString('customLD','FTPPATH',edit5.text);
inifile1.WriteString('customLD','FTPNAME',edit6.text);
inifile1.WriteString('customLD','FTPPASS',edit7.text);
inifile1.WriteString('customLD','SENDDEPT',edit8.text);
inifile1.WriteString('customLD','SENDATTN',edit9.text);
inifile1.WriteString('customLD','SENDTEL',edit10.text);
inifile1.WriteString('customLD','SENDFAX',edit11.text);
inifile1.WriteString('customLD','SENDEMAIL',edit12.text);
inifile1.WriteString('customLD','ESINAME',edit13.text);
inifile1.WriteString('customLD','ESIPASS',edit14.text);
inifile1.free;
str:=Tstringlist.Create;
try
Str:=CreateSIEdiFile_MBL;
for i:=0 to Str.Count-1 do begin
if IsZhongwen(Str[i]) then begin
if MessageDlg('<27><>Ʊҵ<C6B1><D2B5><EFBFBD><EFBFBD><EFBFBD>ܺ<EFBFBD><DCBA><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ַ<EFBFBD><D6B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ַ<EFBFBD>,ȷʵҪ<CAB5><D2AA><EFBFBD><EFBFBD><EFBFBD>ϴ<EFBFBD><CFB4><EFBFBD><EFBFBD><EFBFBD>',mtWarning,[mbYes,mbNo],0)=mrNo then
exit;
end;
end;
SaveDialog1.FileName:=frm_op_seae_edi_data.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><E1B5A5>').asstring;
if SaveDialog1.Execute then
begin
str.SaveToFile(SaveDialog1.FileName+'.txt');
showmessage('<27>ļ<EFBFBD><C4BC><EFBFBD><EFBFBD>ɳɹ<C9B3><C9B9><EFBFBD>');
end
else
begin
showmessage('<27>ļ<EFBFBD><C4BC><EFBFBD><EFBFBD><EFBFBD>ʧ<EFBFBD>ܣ<EFBFBD>');
exit;
end;
finally
FreeAndNil(Str)
end;
close;
end;
function Tfrm_op_seae_edi_custom_ld.isEditrue(DataSet:TDataSet): boolean;
var
cntrs:String;
begin
result:=true;
if trim(Edit1.text)='' then
begin
result:=false;
MessageDlg('<27><><EFBFBD>ͷ<EFBFBD><CDB7><EFBFBD><EFBFBD><EFBFBD><EBB2BB>Ϊ<EFBFBD><CEAA>',mtWarning,[mbOk],0);
exit;
end;
if trim(Edit2.text)='' then
begin
result:=false;
MessageDlg('<27><><EFBFBD>ܷ<EFBFBD><DCB7><EFBFBD><EFBFBD><EFBFBD><EBB2BB>Ϊ<EFBFBD><CEAA>',mtWarning,[mbOk],0);
exit;
end;
if frm_op_seae_edi_data.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD>˾<EFBFBD><CBBE><EFBFBD><EFBFBD>').AsString='' then
begin
result:=false;
MessageDlg('<27><><EFBFBD><EFBFBD>˾<EFBFBD><CBBE><EFBFBD>ش<EFBFBD><D8B4><EFBFBD><EBB2BB>Ϊ<EFBFBD><CEAA>',mtWarning,[mbOk],0);
exit;
end;
if trim(DataSet.fieldbyname('<27><><EFBFBD><EFBFBD><E1B5A5>').asstring)='' then
begin
result:=false;
MessageDlg('<27><EFBFBD>Ų<EFBFBD><C5B2><EFBFBD>Ϊ<EFBFBD><CEAA>',mtWarning,[mbOk],0);
exit;
end;
if trim(DataSet.fieldbyname('<27><><EFBFBD>ѷ<EFBFBD>ʽ').asstring)='' then
begin
result:=false;
MessageDlg('<27><><EFBFBD>ѷ<EFBFBD>ʽ<EFBFBD><CABD><EFBFBD><EFBFBD>Ϊ<EFBFBD><CEAA>',mtWarning,[mbOk],0);
exit;
end;
if trim(DataSet.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring)='' then begin
result:=false;
MessageDlg('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD><CEAA>',mtWarning,[mbOk],0);
exit;
end;
if trim(DataSet.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring)='' then begin
result:=false;
MessageDlg('<27><><EFBFBD>β<EFBFBD><CEB2><EFBFBD>Ϊ<EFBFBD><CEAA>',mtWarning,[mbOk],0);
exit;
end;
if trim(DataSet.fieldbyname('װ<>۴<EFBFBD><DBB4><EFBFBD>').asstring)='' then begin
result:=false;
MessageDlg('װ<>۴<EFBFBD><DBB4><EFBFBD><EBB2BB>Ϊ<EFBFBD><CEAA>',mtWarning,[mbOk],0);
exit;
end;
if trim(DataSet.fieldbyname('װ<><D7B0><EFBFBD><EFBFBD>').asstring)='' then begin
result:=false;
MessageDlg('װ<><D7B0><EFBFBD>۲<EFBFBD><DBB2><EFBFBD>Ϊ<EFBFBD><CEAA>',mtWarning,[mbOk],0);
exit;
end;
if trim(DataSet.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring)='' then begin
result:=false;
MessageDlg('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ڲ<EFBFBD><DAB2><EFBFBD>Ϊ<EFBFBD><CEAA>',mtWarning,[mbOk],0);
exit;
end;
if trim(DataSet.fieldbyname('ж<><D0B6><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring)='' then begin
result:=false;
MessageDlg('ж<><D0B6><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EBB2BB>Ϊ<EFBFBD><CEAA>',mtWarning,[mbOk],0);
exit;
end;
if trim(DataSet.fieldbyname('Ŀ<>ĵ<EFBFBD>').asstring)='' then begin
result:=false;
MessageDlg('Ŀ<>ĵز<C4B5><D8B2><EFBFBD>Ϊ<EFBFBD><CEAA>',mtWarning,[mbOk],0);
exit;
end;
if trim(DataSet.fieldbyname('ǩ<><C7A9><EFBFBD>ص<EFBFBD>').asstring)='' then begin
result:=false;
MessageDlg('ǩ<><C7A9><EFBFBD>ص㲻<D8B5><E3B2BB>Ϊ<EFBFBD><CEAA>',mtWarning,[mbOk],0);
exit;
end;
if trim(GetpkgsEdi(DataSet.fieldbyname('<27><>װ').asstring))='' then begin
result:=false;
MessageDlg('<27><>װEDI<44><49><EFBFBD><EFBFBD><EBB2BB><EFBFBD><EFBFBD>!',mtWarning,[mbOk],0);
exit;
end;
if trim(DataSet.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring)='' then begin
result:=false;
MessageDlg('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD><CEAA>',mtWarning,[mbOk],0);
exit;
end;
if trim(DataSet.fieldbyname('<27><>ͷ').asstring)='' then begin
result:=false;
MessageDlg('<27><>ͷ<EFBFBD><CDB7><EFBFBD><EFBFBD>Ϊ<EFBFBD><CEAA>',mtWarning,[mbOk],0);
exit;
end;
if DataSet.fieldbyname('<27><><EFBFBD><EFBFBD>').asinteger=0 then begin
result:=false;
MessageDlg('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD><CEAA>',mtWarning,[mbOk],0);
exit;
end;
if DataSet.fieldbyname('<27><><EFBFBD><EFBFBD>').asFloat=0 then begin
result:=false;
MessageDlg('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD><CEAA>',mtWarning,[mbOk],0);
exit;
end;
if DataSet.fieldbyname('<27><><EFBFBD><EFBFBD>').asFloat=0 then begin
result:=false;
MessageDlg('<27>ܳ<EFBFBD><DCB3><EFBFBD><EBB2BB>Ϊ<EFBFBD><CEAA>',mtWarning,[mbOk],0);
exit;
end;
if trim(frm_op_seae_edi_data.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʶ').asstring)='' then begin
result:=false;
MessageDlg('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʶ<EFBFBD><CAB6><EFBFBD><EFBFBD>Ϊ<EFBFBD><CEAA>',mtWarning,[mbOk],0);
exit;
end;
if trim(frm_op_seae_edi_data.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʶ').asstring)='' then begin
result:=false;
MessageDlg('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʶ<EFBFBD><CAB6><EFBFBD><EFBFBD>Ϊ<EFBFBD><CEAA>',mtWarning,[mbOk],0);
exit;
end;
if trim(frm_op_seae_edi_data.t_op_seae.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʶ').asstring)='D' then
begin
if Trim(frm_op_seae_edi_data.t_op_seae.fieldbyname('Σ<><CEA3>Ʒ<EFBFBD><C6B7><EFBFBD><EFBFBD>').asstring)='' then begin
result:=false;
MessageDlg('Σ<><CEA3>Ʒ<EFBFBD>ȼ<EFBFBD><C8BC><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD><CEAA>',mtWarning,[mbOk],0);
exit;
end;
if Trim(frm_op_seae_edi_data.t_op_seae.fieldbyname('Σ<><CEA3>Ʒ<EFBFBD><C6B7><EFBFBD><EFBFBD>').asstring)='' then begin
result:=false;
MessageDlg('Σ<><CEA3>Ʒ<EFBFBD><C6B7><EFBFBD>Ų<EFBFBD><C5B2><EFBFBD>Ϊ<EFBFBD><CEAA>',mtWarning,[mbOk],0);
exit;
end;
if GetStrNum(Trim(frm_op_seae_edi_data.t_op_seae.fieldbyname('Σ<><CEA3>Ʒ<EFBFBD><C6B7><EFBFBD><EFBFBD>').asstring))<>4 then begin
result:=false;
MessageDlg('Σ<><CEA3>Ʒ<EFBFBD><C6B7><EFBFBD>ű<EFBFBD><C5B1><EFBFBD><EFBFBD><EFBFBD><34><CEBB><EFBFBD><EFBFBD>',mtWarning,[mbOk],0);
exit;
end;
end;
if trim(frm_op_seae_edi_data.t_op_seae.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʶ').asstring)='R' then begin
if Trim(frm_op_seae_edi_data.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring)='' then begin
result:=false;
MessageDlg('<27><><EFBFBD><EFBFBD><EFBFBD>¶Ȳ<C2B6><C8B2><EFBFBD>Ϊ<EFBFBD><CEAA>',mtWarning,[mbOk],0);
exit;
end;
if Trim(frm_op_seae_edi_data.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD>ͨ<EFBFBD><CDA8><EFBFBD><EFBFBD>').asstring)='' then begin
result:=false;
MessageDlg('<27><><EFBFBD><EFBFBD>ͨ<EFBFBD><CDA8><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD><CEAA>',mtWarning,[mbOk],0);
exit;
end;
end;
t_op_ctn.close;
t_op_ctn.Parameters.ParamByName('<27><><EFBFBD><EFBFBD>').Value:=frm_op_seae_edi_data.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring;
t_op_ctn.open;
if t_op_ctn.IsEmpty then begin
result:=false;
MessageDlg('<27><>װ<EFBFBD><EFBFBD><E4B2BB>Ϊ<EFBFBD><CEAA>',mtWarning,[mbOk],0);
exit;
end;
t_op_ctn.First;
while not t_op_ctn.Eof do begin
if Trim(t_op_ctn.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring)='' then begin
result:=false;
MessageDlg('<27><><EFBFBD>Ų<EFBFBD><C5B2><EFBFBD>Ϊ<EFBFBD>գ<EFBFBD>',mtWarning,[mbOk],0);
exit;
end;
if Trim(t_op_ctn.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring)='' then begin
result:=false;
MessageDlg('<27><><EFBFBD>Ų<EFBFBD><C5B2><EFBFBD>Ϊ<EFBFBD>գ<EFBFBD>',mtWarning,[mbOk],0);
exit;
end;
t_op_ctn.Next;
end;
if iszhongwen(dataset.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD>˴<EFBFBD><CBB4><EFBFBD>').AsString) then begin
result:=false;
MessageDlg('<27><><EFBFBD><EFBFBD><EFBFBD>˲<EFBFBD><CBB2><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ַ<EFBFBD><D6B7><EFBFBD>',mtWarning,[mbOk],0);
exit;
end;
if iszhongwen(dataset.fieldbyname('<27>ջ<EFBFBD><D5BB>˴<EFBFBD><CBB4><EFBFBD>').AsString) then begin
result:=false;
MessageDlg('<27>ջ<EFBFBD><D5BB>˲<EFBFBD><CBB2><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ַ<EFBFBD><D6B7><EFBFBD>',mtWarning,[mbOk],0);
exit;
end;
if iszhongwen(dataset.fieldbyname('֪ͨ<CDA8>˴<EFBFBD><CBB4><EFBFBD>').AsString) then begin
result:=false;
MessageDlg('֪ͨ<CDA8>˲<EFBFBD><CBB2><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ַ<EFBFBD><D6B7><EFBFBD>',mtWarning,[mbOk],0);
exit;
end;
if iszhongwen(dataset.fieldbyname('<27><>ͷ').AsString) then begin
result:=false;
MessageDlg('<27><>ͷ<EFBFBD><CDB7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ַ<EFBFBD><D6B7><EFBFBD>',mtWarning,[mbOk],0);
exit;
end;
if iszhongwen(dataset.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString) then begin
result:=false;
MessageDlg('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ַ<EFBFBD><D6B7><EFBFBD>',mtWarning,[mbOk],0);
exit;
end;
end;
function Tfrm_op_seae_edi_custom_ld.CreateSIEdiFile_MBL:TStrings;
var
str:Tstringlist;
Tempstr : TStrings;
Temprslt : string;
i,j,Count:integer;
strsql,strRmain:string;
rs,aQuery2:Tadoquery;
wide_str:widestring;
k:integer;
inifile1:Tinifile;
strType,XType:string;
strDatetime:string;
SenderCode,ReciverCode,TransType:string;
begin
if not isEditrue(frm_op_seae_edi_data.t_op_seae) then
begin
Exit;
end;
SenderCode:=trim(edit1.Text) ;
ReciverCode:=trim(edit2.Text) ;
if bsSkinRadioGroup1.ItemIndex=0 then
strType:='9'
else if bsSkinRadioGroup1.ItemIndex=1 then
strType:='2'
else if bsSkinRadioGroup1.ItemIndex=2 then
strType:='3'
else if bsSkinRadioGroup1.ItemIndex=3 then
strType:='4'
else strType:='9';
if frm_op_seae_edi_data.dxdbgrid1.SelectedCount<=1 then
begin
str:=Tstringlist.Create;
str.Clear;
str.Add('00:IFCSUM:MANIFEST:'+trim(strType)+':'+ SenderCode+':'+ReciverCode+':'+GetDatetime(datetimetostr(now),4)+':1.0'+#39);
//
Count:=0;
str.Add ('10'
+':'+frm_op_seae_edi_data.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD>IMO').asstring // 2 <20><><EFBFBD><EFBFBD>IMO<4D><4F><EFBFBD><EFBFBD>
+':'+ trim(frm_op_seae_edi_data.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD>').AsString) //3<><33><EFBFBD><EFBFBD>
+':' //4<><34><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
+':'+ trim(frm_op_seae_edi_data.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring) //5<><35><EFBFBD><EFBFBD>
+#39);
str.Add('11'
+':'+frm_op_seae_edi_data.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD>˾<EFBFBD><CBBE><EFBFBD><EFBFBD>').AsString //2 <20><><EFBFBD><EFBFBD>˾(<28><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)<29><><EFBFBD><EFBFBD>
+':' //3 <20><><EFBFBD><EFBFBD>˾(<28><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)
+ #39);
if pos('PREPAID',trim(frm_op_seae_edi_data.t_op_seae.fieldbyname('<27><><EFBFBD>ѷ<EFBFBD>ʽ').asstring)) >0 then
xtype := 'P'
else if pos('COLLECT',trim(frm_op_seae_edi_data.t_op_seae.fieldbyname('<27><><EFBFBD>ѷ<EFBFBD>ʽ').asstring)) >0 then
xtype := 'C'
else xtype := 'P';
if uppercase(frm_op_seae_edi_data.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring)='CY-CY' then
TransType:='10'
else if uppercase(frm_op_seae_edi_data.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring)='DOOR-DOOR' then
TransType:='27'
else if uppercase(frm_op_seae_edi_data.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring)='DOOR-PIER' then
TransType:='28'
else if uppercase(frm_op_seae_edi_data.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring)='PIER-DOOR' then
TransType:='29'
else TransType:='10'; // PIER TO PIER
str.add('12:' + trim(frm_op_seae_edi_data.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><E1B5A5>').asstring) //2<><32><EFBFBD><EFBFBD><EFBFBD>˵<EFBFBD><CBB5><EFBFBD>
+':' //3 ǰ<><C7B0><EFBFBD><EFBFBD><EFBFBD><EFBFBD><E4B4AC><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
+':' //4 ǰ<><C7B0><EFBFBD><EFBFBD><EFBFBD><EFBFBD><E4B4AC>
+':' //5 ǰ<><C7B0><EFBFBD><EFBFBD><EFBFBD><EFBFBD><E4BABD>
+':'+ trim(frm_op_seae_edi_data.t_op_seae.fieldbyname('Ŀ<>Ĵ<EFBFBD><C4B4><EFBFBD>').asstring) //6 <20>ջ<EFBFBD><D5BB>ش<EFBFBD><D8B4><EFBFBD>
+':'+ trim(frm_op_seae_edi_data.t_op_seae.fieldbyname('Ŀ<>ĵ<EFBFBD>').asstring) //7<>ջ<EFBFBD><D5BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
+':'+ trim(frm_op_seae_edi_data.t_op_seae.fieldbyname('װ<>۴<EFBFBD><DBB4><EFBFBD>').asstring) //8װ<38><D7B0><EFBFBD>۴<EFBFBD><DBB4><EFBFBD>
+':'+ trim(frm_op_seae_edi_data.t_op_seae.fieldbyname('װ<><D7B0><EFBFBD><EFBFBD>').asstring) //9װ<39><D7B0><EFBFBD><EFBFBD>
+':'+TransType //10<31><30><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
+':'+ XType //11<31><31><EFBFBD>ʽ<EEB7BD><CABD><EFBFBD>˷<EFBFBD>֧<EFBFBD><D6A7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
+':'+ GetDatetime(frm_op_seae_edi_data.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring,4) +'086'//12 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ڣ<EFBFBD><DAA3><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ں<EFBFBD>ʱ<EFBFBD>
+':' //13<31><33><EFBFBD>ߴ<EFBFBD><DFB4><EFBFBD>
+':' //14ǩ<34><C7A9><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
+':' //15<31><35><EFBFBD>֣<EFBFBD><D6A3><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʹ<EFBFBD><CDB4>
+':' //16 <20><><EFBFBD><EFBFBD>
+':'+ trim(frm_op_seae_edi_data.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><E1B5A5>').asstring) //17 <20><><EFBFBD><EFBFBD><EFBFBD>˵<EFBFBD><CBB5><EFBFBD>
+#39);
str.add('13:' + trim(frm_op_seae_edi_data.t_op_seae.fieldbyname('ж<><D0B6><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring) //2ж<32><D0B6><EFBFBD>ش<EFBFBD><D8B4><EFBFBD> ???
+':'+ trim(frm_op_seae_edi_data.t_op_seae.fieldbyname('ж<><D0B6><EFBFBD><EFBFBD>').asstring) //3ж<33><D0B6><EFBFBD><EFBFBD>
+':'+ trim(frm_op_seae_edi_data.t_op_seae.fieldbyname('Ŀ<>Ĵ<EFBFBD><C4B4><EFBFBD>').asstring) //4<><34><EFBFBD><EFBFBD><EFBFBD>ش<EFBFBD><D8B4><EFBFBD>
+':'+ trim(frm_op_seae_edi_data.t_op_seae.fieldbyname('Ŀ<>ĵ<EFBFBD>').asstring)+':' //5<><35><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
+ ':' // 6 <20><>ת<EFBFBD>۴<EFBFBD><DBB4><EFBFBD>
+ ':' // 7 <20><>ת<EFBFBD><D7AA>
+ ':'+ trim(frm_op_seae_edi_data.t_op_seae.fieldbyname('ǩ<><C7A9><EFBFBD>ص<EFBFBD>').asstring) // 8 <20>ᵥǩ<E1B5A5><C7A9><EFBFBD>ش<EFBFBD><D8B4><EFBFBD><EBA3A8><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>˵ػ<CBB5><D8BB>߹<EFBFBD><DFB9>Ҵ<EFBFBD><D2B4>
+':' // 9
+':' // 10
+#39);
{ str.add('16'
+':' //2 <20><><EFBFBD><EFBFBD><EFBFBD>˴<EFBFBD><CBB4><EFBFBD>
+':'+ Changestr(frm_op_seae_edi_data.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString) //3<><33><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
+':'+ Changestr(frm_op_seae_edi_data.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD>˵<EFBFBD>ַ1').AsString) //4<><34><EFBFBD><EFBFBD><EFBFBD>˵<EFBFBD>ַ<EFBFBD><D6B7><EFBFBD>ֵ<EFBFBD>,<2C><><EFBFBD>
+#39);
str.add('17'
+':' //2 <20>ջ<EFBFBD><D5BB>˴<EFBFBD><CBB4><EFBFBD>
+':'+ Changestr(frm_op_seae_edi_data.t_op_seae.fieldbyname('<27>ջ<EFBFBD><D5BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString) //3<>ջ<EFBFBD><D5BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
+':'+ Changestr(frm_op_seae_edi_data.t_op_seae.fieldbyname('<27>ջ<EFBFBD><D5BB>˵<EFBFBD>ַ1').AsString) //4<>ջ<EFBFBD><D5BB>˵<EFBFBD>ַ<EFBFBD><D6B7><EFBFBD>ֵ<EFBFBD>,<2C><><EFBFBD>
+#39);
str.add('18'
+':' //2 ֪ͨ<CDA8>˴<EFBFBD><CBB4><EFBFBD>
+':'+ Changestr(frm_op_seae_edi_data.t_op_seae.fieldbyname('֪ͨ<CDA8><D6AA><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString) //3֪ͨ<CDA8><D6AA><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
+':'+ Changestr(frm_op_seae_edi_data.t_op_seae.fieldbyname('֪ͨ<CDA8>˵<EFBFBD>ַ1').AsString) //4֪ͨ<CDA8>˵<EFBFBD>ַ<EFBFBD><D6B7><EFBFBD>ֵ<EFBFBD>,<2C><><EFBFBD>
+#39);
}
str.add('16'
+':' //2 <20><><EFBFBD><EFBFBD><EFBFBD>˴<EFBFBD><CBB4><EFBFBD>
+':'+ Changestr(frm_op_seae_edi_data.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString) //3<><33><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
+':'+ Changestr(frm_op_seae_edi_data.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD>˵<EFBFBD>ַ1').AsString) //4<><34><EFBFBD><EFBFBD><EFBFBD>˵<EFBFBD>ַ<EFBFBD><D6B7><EFBFBD>ֵ<EFBFBD>,<2C><><EFBFBD>
+':'+ Changestr(frm_op_seae_edi_data.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD>˳<EFBFBD><CBB3><EFBFBD>').AsString)
+'::'+ Changestr(frm_op_seae_edi_data.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString)
+':'+ Changestr(frm_op_seae_edi_data.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʱ<EFBFBD>').AsString)
+':'+ Changestr(frm_op_seae_edi_data.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD>˹<EFBFBD><CBB9>Ҵ<EFBFBD><D2B4><EFBFBD>').AsString)
+':'+ Changestr(frm_op_seae_edi_data.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD>˵绰').AsString)
+':'+ Changestr(frm_op_seae_edi_data.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString)
+'::'+ Changestr(frm_op_seae_edi_data.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD>˹<EFBFBD><CBB9>Ҵ<EFBFBD><D2B4><EFBFBD>').AsString)
+#39);
str.add('17'
+':' //2 <20>ջ<EFBFBD><D5BB>˴<EFBFBD><CBB4><EFBFBD>
+':'+ Changestr(frm_op_seae_edi_data.t_op_seae.fieldbyname('<27>ջ<EFBFBD><D5BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString) //3<>ջ<EFBFBD><D5BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
+':'+ Changestr(frm_op_seae_edi_data.t_op_seae.fieldbyname('<27>ջ<EFBFBD><D5BB>˵<EFBFBD>ַ1').AsString) //4<>ջ<EFBFBD><D5BB>˵<EFBFBD>ַ<EFBFBD><D6B7><EFBFBD>ֵ<EFBFBD>,<2C><><EFBFBD>
+':'+ Changestr(frm_op_seae_edi_data.t_op_seae.fieldbyname('<27>ջ<EFBFBD><D5BB>˳<EFBFBD><CBB3><EFBFBD>').AsString)
+'::'+ Changestr(frm_op_seae_edi_data.t_op_seae.fieldbyname('<27>ջ<EFBFBD><D5BB><EFBFBD><EFBFBD><EFBFBD>').AsString)
+':'+ Changestr(frm_op_seae_edi_data.t_op_seae.fieldbyname('<27>ջ<EFBFBD><D5BB><EFBFBD><EFBFBD>ʱ<EFBFBD>').AsString)
+':'+ Changestr(frm_op_seae_edi_data.t_op_seae.fieldbyname('<27>ջ<EFBFBD><D5BB>˹<EFBFBD><CBB9>Ҵ<EFBFBD><D2B4><EFBFBD>').AsString)
+':'+ Changestr(frm_op_seae_edi_data.t_op_seae.fieldbyname('<27>ջ<EFBFBD><D5BB>˵绰').AsString)
+':'+ Changestr(frm_op_seae_edi_data.t_op_seae.fieldbyname('<27>ջ<EFBFBD><D5BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString)
+':::::'
+#39);
str.add('18'
+':' //2 ֪ͨ<CDA8>˴<EFBFBD><CBB4><EFBFBD>
+':'+ Changestr(frm_op_seae_edi_data.t_op_seae.fieldbyname('֪ͨ<CDA8><D6AA><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString) //3֪ͨ<CDA8><D6AA><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
+':'+ Changestr(frm_op_seae_edi_data.t_op_seae.fieldbyname('֪ͨ<CDA8>˵<EFBFBD>ַ1').AsString) //4֪ͨ<CDA8>˵<EFBFBD>ַ<EFBFBD><D6B7><EFBFBD>ֵ<EFBFBD>,<2C><><EFBFBD>
+':'+ Changestr(frm_op_seae_edi_data.t_op_seae.fieldbyname('֪ͨ<CDA8>˳<EFBFBD><CBB3><EFBFBD>').AsString)
+'::'+ Changestr(frm_op_seae_edi_data.t_op_seae.fieldbyname('֪ͨ<CDA8><D6AA><EFBFBD><EFBFBD>').AsString)
+':'+ Changestr(frm_op_seae_edi_data.t_op_seae.fieldbyname('֪ͨ<CDA8><D6AA><EFBFBD>ʱ<EFBFBD>').AsString)
+':'+ Changestr(frm_op_seae_edi_data.t_op_seae.fieldbyname('֪ͨ<CDA8>˹<EFBFBD><CBB9>Ҵ<EFBFBD><D2B4><EFBFBD>').AsString)
+':'+ Changestr(frm_op_seae_edi_data.t_op_seae.fieldbyname('֪ͨ<CDA8>˵绰').AsString)
+':'+ Changestr(frm_op_seae_edi_data.t_op_seae.fieldbyname('֪ͨ<CDA8><D6AA><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString)
+':'
+#39);
str.Add ('41:1' //2<><32><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
+':' //3<><33><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
+':'+trim(frm_op_seae_edi_data.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring) //4 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
+':'+GetpkgsEdi(frm_op_seae_edi_data.t_op_seae.fieldbyname('<27><>װ').asstring) //5 <20><>װ<EFBFBD><D7B0><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
+':'+trim(frm_op_seae_edi_data.t_op_seae.fieldbyname('<27><>װ').asstring) // 6 <20><>װ<EFBFBD><D7B0><EFBFBD><EFBFBD>
+':'+trim(frm_op_seae_edi_data.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring) // 7<><37>ë<EFBFBD><C3AB>
+':'+trim(frm_op_seae_edi_data.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring) // 8<><38><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
+':'+trim(frm_op_seae_edi_data.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring) // 9<><39><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
+':'+trim(frm_op_seae_edi_data.t_op_seae.fieldbyname('<27><><EFBFBD>ʽ').asstring) // 10<31><30><EFBFBD><EFBFBD>˰<EFBFBD><CBB0><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
+':' // 11<31><31><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
+':' // 12ԭ<32><D4AD><EFBFBD>ش<EFBFBD><D8B4><EFBFBD>
+#39);
if trim(frm_op_seae_edi_data.t_op_seae.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʶ').asstring)='D' then
begin
str.Add ('43:'+trim(frm_op_seae_edi_data.t_op_seae.fieldbyname('Σ<><CEA3>Ʒ<EFBFBD><C6B7><EFBFBD><EFBFBD>').asstring) //2Σ<32><CEA3>Ʒ<EFBFBD><C6B7><EFBFBD><EFBFBD>
+':none' //3Σ<33><CEA3>Ʒҳ<C6B7><D2B3>
+':' +trim(frm_op_seae_edi_data.t_op_seae.fieldbyname('Σ<><CEA3>Ʒ<EFBFBD><C6B7><EFBFBD><EFBFBD>').asstring) //4<><34><EFBFBD>Ϲ<EFBFBD>Σ<EFBFBD><CEA3>Ʒ<EFBFBD><C6B7><EFBFBD><EFBFBD>
+':none' //5Σ<35><CEA3>Ʒ<EFBFBD><C6B7>ǩ
+':' //6 Σ<>ջ<EFBFBD><D5BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
+':' //7 <20><><EFBFBD><EFBFBD>Σ<EFBFBD><CEA3>ƷӦ<C6B7><D3A6><EFBFBD><EFBFBD>ʩ<EFBFBD><CAA9>
+':' //8 ҽ<>Ƽ<EFBFBD><C6BC><EFBFBD>ָ<EFBFBD>Ϻ<EFBFBD>
+':' //9 Ӧ<><D3A6><EFBFBD><EFBFBD>ϵ
+':' //10 <20>¶ȼ<C2B6><C8BC><EFBFBD><EFBFBD><EFBFBD>λ
+':' //11 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
+':' //12 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
+':' //13 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
+':' //14 Σ<><CEA3>Ʒ<EFBFBD><C6B7>ϵ<EFBFBD><CFB5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
+':' //15 Σ<><CEA3>Ʒ<EFBFBD><C6B7>ϵ<EFBFBD>˵绰
+':' //16 Σ<><CEA3>Ʒ<EFBFBD><C6B7>ϵ<EFBFBD><CFB5>EMAIL
+':' //17 Σ<><CEA3>Ʒ<EFBFBD><C6B7>ϵ<EFBFBD>˴<EFBFBD><CBB4><EFBFBD>
+#39);
end
else
if trim(frm_op_seae_edi_data.t_op_seae.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʶ').asstring)='R' then
begin
str.Add ('43:' //2Σ<32><CEA3>Ʒ<EFBFBD><C6B7><EFBFBD><EFBFBD>
+':' //3Σ<33><CEA3>Ʒҳ<C6B7><D2B3>
+':' //4<><34><EFBFBD>Ϲ<EFBFBD>Σ<EFBFBD><CEA3>Ʒ<EFBFBD><C6B7><EFBFBD><EFBFBD>
+':' //5Σ<35><CEA3>Ʒ<EFBFBD><C6B7>ǩ
+':' //6 Σ<>ջ<EFBFBD><D5BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
+':' //7 <20><><EFBFBD><EFBFBD>Σ<EFBFBD><CEA3>ƷӦ<C6B7><D3A6><EFBFBD><EFBFBD>ʩ<EFBFBD><CAA9>
+':' //8 ҽ<>Ƽ<EFBFBD><C6BC><EFBFBD>ָ<EFBFBD>Ϻ<EFBFBD>
+':' //9 Ӧ<><D3A6><EFBFBD><EFBFBD>ϵ
+':C' //10 <20>¶ȼ<C2B6><C8BC><EFBFBD><EFBFBD><EFBFBD>λ
+':'+frm_op_seae_edi_data.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring //11 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
+':' //12 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
+':' //13 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
+':' //14 Σ<><CEA3>Ʒ<EFBFBD><C6B7>ϵ<EFBFBD><CFB5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
+':' //15 Σ<><CEA3>Ʒ<EFBFBD><C6B7>ϵ<EFBFBD>˵绰
+':' //16 Σ<><CEA3>Ʒ<EFBFBD><C6B7>ϵ<EFBFBD><CFB5>EMAIL
+':' //17 Σ<><CEA3>Ʒ<EFBFBD><C6B7>ϵ<EFBFBD>˴<EFBFBD><CBB4><EFBFBD>
+#39);
end;
try
Tempstr:=TStringList.Create;
Tempstr.Clear;
Tempstr.Text:=Changestr(frm_op_seae_edi_data.t_op_seae.fieldbyname('<27><>ͷ').asstring);
str.Add ('44:'
//+ Changestr(frm_op_seae_edi_data.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring)+ ':'
+ FormatListString(Tempstr,5,300)+ ':'
+'::::' + #39);
finally
Tempstr.Free;
end;
try
Tempstr:=TStringList.Create;
Tempstr.Clear;
Tempstr.Text:=Changestr(frm_op_seae_edi_data.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring);
str.Add ('47:'
//+ Changestr(frm_op_seae_edi_data.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring)+ ':'
+ FormatListString(Tempstr,5,300)+ ':'
+ #39);
finally
Tempstr.Free;
end;
Count:=Count+10;
XType := 'F';
strsql:='select t_op_ctn_edi.<2E><><EFBFBD><EFBFBD>,t_op_ctn_edi.<2E><><EFBFBD><EFBFBD>,t_op_ctn_edi.<2E><><EFBFBD><EFBFBD>,t_op_ctn_edi.<2E><><EFBFBD><EFBFBD>,t_op_ctn_edi.<2E>ߴ<EFBFBD>,t_op_ctn_edi.<2E><><EFBFBD><EFBFBD>,t_op_ctn_edi.<2E><><EFBFBD><EFBFBD>,t_op_ctn_edi.<2E><><EFBFBD><EFBFBD>,t_op_ctn_edi.<2E><>װ,t_op_ctn_edi.<2E><><EFBFBD><EFBFBD>,t_code_ctn.EDI<44><49><EFBFBD><EFBFBD> from t_op_ctn_edi '
+'left join t_code_ctn on t_code_ctn.<2E><><EFBFBD><EFBFBD>=t_op_ctn_edi.<2E><><EFBFBD><EFBFBD> WHERE t_op_ctn_edi.<2E><><EFBFBD><EFBFBD>='
+#39+frm_op_seae_edi_data.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring+#39;
try
rs:=Tadoquery.Create(application);
rs.Connection := frm_main.db;
rs.sql.clear;
rs.sql.add(strsql);
rs.Open;
rs.First;
if not rs.IsEmpty then begin
rs.First;
while not rs.Eof do
begin
str.Add ('51:001' //2<><32><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
+':'+trim(rs.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring) //3<><33><EFBFBD><EFBFBD>
+':'+trim(rs.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring) //4<><34>Ǧ<EFBFBD><C7A6><EFBFBD><EFBFBD>
+':'+Trim(rs.fieldbyname('<27>ߴ<EFBFBD>').asstring+rs.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring) //5<><35>װ<EFBFBD><D7B0><EFBFBD>ߴ<EFBFBD><DFB4><EFBFBD><EFBFBD><EFBFBD>
+':8' //6<><36>״̬<D7B4><CCAC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>߿<EFBFBD><DFBF><EFBFBD><EFBFBD><EFBFBD>ʶ<EFBFBD><CAB6><EFBFBD>
+':' +trim(IntToStr(rs.fieldbyname('<27><><EFBFBD><EFBFBD>').AsInteger)) //7<><37><EFBFBD>ڻ<EFBFBD><DABB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
+':'+trim(FloatToStr(rs.fieldbyname('<27><><EFBFBD><EFBFBD>').AsFloat)) //8<><38><EFBFBD>ڻ<EFBFBD><DABB><EFBFBD>
+':' //9<><39>Ƥ<EFBFBD><C6A4>
+':'+trim(FloatToStr(rs.fieldbyname('<27><><EFBFBD><EFBFBD>').AsFloat)) //10<31><30><EFBFBD>ڻ<EFBFBD><DABB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
+':' //11
+':' //12
+':' //13
+':' // 14
+':' // 15
+':' // 16
+':' // 17
+#39);
rs.Next;
end;
end;
rs.Close;
rs.Destroy;
except
on e:exception do
begin
rs.Close;
rs.Destroy;
exit;
end;
end;
frm_op_seae_edi_data.t_op_seae.Edit;
frm_op_seae_edi_data.t_op_seae.FieldByName('EDI״̬').AsString:='<27>ѷ<EFBFBD><D1B7><EFBFBD>';
frm_op_seae_edi_data.t_op_seae.Post;
str.Add ('99:'+ inttostr(Count+2)+#39);
end
else
begin
str:=Tstringlist.Create;
str.Clear;
str.Add('00:IFCSUM:MANIFEST:'+trim(strType)+':'+ SenderCode+':'+ReciverCode+':'+GetDatetime(datetimetostr(now),4)+':1.0'+#39);
Count:=0;
for k:=0 to frm_op_seae_edi_data.dxdbgrid1.SelectedCount-1 do
begin
str.Add ('10'
+':'+frm_op_seae_edi_data.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD>IMO').asstring // 2 <20><><EFBFBD><EFBFBD>IMO<4D><4F><EFBFBD><EFBFBD>
+':'+ trim(frm_op_seae_edi_data.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD>').AsString) //3<><33><EFBFBD><EFBFBD>
+':' //4<><34><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
+':'+ trim(frm_op_seae_edi_data.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring) //5<><35><EFBFBD><EFBFBD>
+#39);
str.Add('11'
+':'+frm_op_seae_edi_data.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD>˾<EFBFBD><CBBE><EFBFBD><EFBFBD>').AsString //2 <20><><EFBFBD><EFBFBD>˾(<28><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)<29><><EFBFBD><EFBFBD>
+':' //3 <20><><EFBFBD><EFBFBD>˾(<28><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)
+ #39);
if pos('PREPAID',trim(frm_op_seae_edi_data.t_op_seae.fieldbyname('<27><><EFBFBD>ѷ<EFBFBD>ʽ').asstring)) >0 then
xtype := 'P'
else
if pos('COLLECT',trim(frm_op_seae_edi_data.t_op_seae.fieldbyname('<27><><EFBFBD>ѷ<EFBFBD>ʽ').asstring)) >0 then
xtype := 'C'
else xtype := 'P';
if uppercase(frm_op_seae_edi_data.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring)='CY-CY' then
TransType:='10'
else if uppercase(frm_op_seae_edi_data.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring)='DOOR-DOOR' then
TransType:='27'
else if uppercase(frm_op_seae_edi_data.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring)='DOOR-PIER' then
TransType:='28'
else if uppercase(frm_op_seae_edi_data.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring)='PIER-DOOR' then
TransType:='29'
else TransType:='10'; // PIER TO PIER
str.add('12:' + trim(frm_op_seae_edi_data.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><E1B5A5>').asstring) //2<><32><EFBFBD><EFBFBD><EFBFBD>˵<EFBFBD><CBB5><EFBFBD>
+':' //3 ǰ<><C7B0><EFBFBD><EFBFBD><EFBFBD><EFBFBD><E4B4AC><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
+':' //4 ǰ<><C7B0><EFBFBD><EFBFBD><EFBFBD><EFBFBD><E4B4AC>
+':' //5 ǰ<><C7B0><EFBFBD><EFBFBD><EFBFBD><EFBFBD><E4BABD>
+':'+ trim(frm_op_seae_edi_data.t_op_seae.fieldbyname('Ŀ<>Ĵ<EFBFBD><C4B4><EFBFBD>').asstring) //6 <20>ջ<EFBFBD><D5BB>ش<EFBFBD><D8B4><EFBFBD>
+':'+ trim(frm_op_seae_edi_data.t_op_seae.fieldbyname('Ŀ<>ĵ<EFBFBD>').asstring) //7<>ջ<EFBFBD><D5BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
+':'+ trim(frm_op_seae_edi_data.t_op_seae.fieldbyname('װ<>۴<EFBFBD><DBB4><EFBFBD>').asstring) //8װ<38><D7B0><EFBFBD>۴<EFBFBD><DBB4><EFBFBD>
+':'+ trim(frm_op_seae_edi_data.t_op_seae.fieldbyname('װ<><D7B0><EFBFBD><EFBFBD>').asstring) //9װ<39><D7B0><EFBFBD><EFBFBD>
+':'+TransType //10<31><30><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
+':'+ XType //11<31><31><EFBFBD>ʽ<EEB7BD><CABD><EFBFBD>˷<EFBFBD>֧<EFBFBD><D6A7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
+':'+ GetDatetime(frm_op_seae_edi_data.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring,4) +'086'//12 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ڣ<EFBFBD><DAA3><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ں<EFBFBD>ʱ<EFBFBD>
+':' //13<31><33><EFBFBD>ߴ<EFBFBD><DFB4><EFBFBD>
+':' //14ǩ<34><C7A9><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
+':' //15<31><35><EFBFBD>֣<EFBFBD><D6A3><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʹ<EFBFBD><CDB4>
+':' //16 <20><><EFBFBD><EFBFBD>
+':'+ trim(frm_op_seae_edi_data.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><E1B5A5>').asstring) //17 <20><><EFBFBD><EFBFBD><EFBFBD>˵<EFBFBD><CBB5><EFBFBD>
+#39);
str.add('13:' + trim(frm_op_seae_edi_data.t_op_seae.fieldbyname('ж<><D0B6><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring) //2ж<32><D0B6><EFBFBD>ش<EFBFBD><D8B4><EFBFBD> ???
+':'+ trim(frm_op_seae_edi_data.t_op_seae.fieldbyname('ж<><D0B6><EFBFBD><EFBFBD>').asstring) //3ж<33><D0B6><EFBFBD><EFBFBD>
+':'+ trim(frm_op_seae_edi_data.t_op_seae.fieldbyname('Ŀ<>Ĵ<EFBFBD><C4B4><EFBFBD>').asstring) //4<><34><EFBFBD><EFBFBD><EFBFBD>ش<EFBFBD><D8B4><EFBFBD>
+':'+ trim(frm_op_seae_edi_data.t_op_seae.fieldbyname('Ŀ<>ĵ<EFBFBD>').asstring)+':' //5<><35><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
+ ':' // 6 <20><>ת<EFBFBD>۴<EFBFBD><DBB4><EFBFBD>
+ ':' // 7 <20><>ת<EFBFBD><D7AA>
+ ':'+ trim(frm_op_seae_edi_data.t_op_seae.fieldbyname('ǩ<><C7A9><EFBFBD>ص<EFBFBD>').asstring) // 8 <20>ᵥǩ<E1B5A5><C7A9><EFBFBD>ش<EFBFBD><D8B4><EFBFBD><EBA3A8><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>˵ػ<CBB5><D8BB>߹<EFBFBD><DFB9>Ҵ<EFBFBD><D2B4>
+':' // 9
+':' // 10
+#39);
{ str.add('16'
+':' //2 <20><><EFBFBD><EFBFBD><EFBFBD>˴<EFBFBD><CBB4><EFBFBD>
+':'+ Changestr(frm_op_seae_edi_data.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString) //3<><33><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
+':'+ Changestr(frm_op_seae_edi_data.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD>˵<EFBFBD>ַ1').AsString) //4<><34><EFBFBD><EFBFBD><EFBFBD>˵<EFBFBD>ַ<EFBFBD><D6B7><EFBFBD>ֵ<EFBFBD>,<2C><><EFBFBD>
+#39);
str.add('17'
+':' //2 <20>ջ<EFBFBD><D5BB>˴<EFBFBD><CBB4><EFBFBD>
+':'+ Changestr(frm_op_seae_edi_data.t_op_seae.fieldbyname('<27>ջ<EFBFBD><D5BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString) //3<>ջ<EFBFBD><D5BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
+':'+ Changestr(frm_op_seae_edi_data.t_op_seae.fieldbyname('<27>ջ<EFBFBD><D5BB>˵<EFBFBD>ַ1').AsString) //4<>ջ<EFBFBD><D5BB>˵<EFBFBD>ַ<EFBFBD><D6B7><EFBFBD>ֵ<EFBFBD>,<2C><><EFBFBD>
+#39);
str.add('18'
+':' //2 ֪ͨ<CDA8>˴<EFBFBD><CBB4><EFBFBD>
+':'+ Changestr(frm_op_seae_edi_data.t_op_seae.fieldbyname('֪ͨ<CDA8><D6AA><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString) //3֪ͨ<CDA8><D6AA><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
+':'+ Changestr(frm_op_seae_edi_data.t_op_seae.fieldbyname('֪ͨ<CDA8>˵<EFBFBD>ַ1').AsString) //4֪ͨ<CDA8>˵<EFBFBD>ַ<EFBFBD><D6B7><EFBFBD>ֵ<EFBFBD>,<2C><><EFBFBD>
+#39);
}
str.add('16'
+':' //2 <20><><EFBFBD><EFBFBD><EFBFBD>˴<EFBFBD><CBB4><EFBFBD>
+':'+ Changestr(frm_op_seae_edi_data.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString) //3<><33><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
+':'+ Changestr(frm_op_seae_edi_data.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD>˵<EFBFBD>ַ1').AsString) //4<><34><EFBFBD><EFBFBD><EFBFBD>˵<EFBFBD>ַ<EFBFBD><D6B7><EFBFBD>ֵ<EFBFBD>,<2C><><EFBFBD>
+':'+ Changestr(frm_op_seae_edi_data.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD>˳<EFBFBD><CBB3><EFBFBD>').AsString)
+'::'+ Changestr(frm_op_seae_edi_data.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString)
+':'+ Changestr(frm_op_seae_edi_data.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʱ<EFBFBD>').AsString)
+':'+ Changestr(frm_op_seae_edi_data.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD>˹<EFBFBD><CBB9>Ҵ<EFBFBD><D2B4><EFBFBD>').AsString)
+':'+ Changestr(frm_op_seae_edi_data.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD>˵绰').AsString)
+':'+ Changestr(frm_op_seae_edi_data.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString)
+'::'+ Changestr(frm_op_seae_edi_data.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD>˹<EFBFBD><CBB9>Ҵ<EFBFBD><D2B4><EFBFBD>').AsString)
+#39);
str.add('17'
+':' //2 <20>ջ<EFBFBD><D5BB>˴<EFBFBD><CBB4><EFBFBD>
+':'+ Changestr(frm_op_seae_edi_data.t_op_seae.fieldbyname('<27>ջ<EFBFBD><D5BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString) //3<>ջ<EFBFBD><D5BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
+':'+ Changestr(frm_op_seae_edi_data.t_op_seae.fieldbyname('<27>ջ<EFBFBD><D5BB>˵<EFBFBD>ַ1').AsString) //4<>ջ<EFBFBD><D5BB>˵<EFBFBD>ַ<EFBFBD><D6B7><EFBFBD>ֵ<EFBFBD>,<2C><><EFBFBD>
+':'+ Changestr(frm_op_seae_edi_data.t_op_seae.fieldbyname('<27>ջ<EFBFBD><D5BB>˳<EFBFBD><CBB3><EFBFBD>').AsString)
+'::'+ Changestr(frm_op_seae_edi_data.t_op_seae.fieldbyname('<27>ջ<EFBFBD><D5BB><EFBFBD><EFBFBD><EFBFBD>').AsString)
+':'+ Changestr(frm_op_seae_edi_data.t_op_seae.fieldbyname('<27>ջ<EFBFBD><D5BB><EFBFBD><EFBFBD>ʱ<EFBFBD>').AsString)
+':'+ Changestr(frm_op_seae_edi_data.t_op_seae.fieldbyname('<27>ջ<EFBFBD><D5BB>˹<EFBFBD><CBB9>Ҵ<EFBFBD><D2B4><EFBFBD>').AsString)
+':'+ Changestr(frm_op_seae_edi_data.t_op_seae.fieldbyname('<27>ջ<EFBFBD><D5BB>˵绰').AsString)
+':'+ Changestr(frm_op_seae_edi_data.t_op_seae.fieldbyname('<27>ջ<EFBFBD><D5BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString)
+':::::'
+#39);
str.add('18'
+':' //2 ֪ͨ<CDA8>˴<EFBFBD><CBB4><EFBFBD>
+':'+ Changestr(frm_op_seae_edi_data.t_op_seae.fieldbyname('֪ͨ<CDA8><D6AA><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString) //3֪ͨ<CDA8><D6AA><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
+':'+ Changestr(frm_op_seae_edi_data.t_op_seae.fieldbyname('֪ͨ<CDA8>˵<EFBFBD>ַ1').AsString) //4֪ͨ<CDA8>˵<EFBFBD>ַ<EFBFBD><D6B7><EFBFBD>ֵ<EFBFBD>,<2C><><EFBFBD>
+':'+ Changestr(frm_op_seae_edi_data.t_op_seae.fieldbyname('֪ͨ<CDA8>˳<EFBFBD><CBB3><EFBFBD>').AsString)
+'::'+ Changestr(frm_op_seae_edi_data.t_op_seae.fieldbyname('֪ͨ<CDA8><D6AA><EFBFBD><EFBFBD>').AsString)
+':'+ Changestr(frm_op_seae_edi_data.t_op_seae.fieldbyname('֪ͨ<CDA8><D6AA><EFBFBD>ʱ<EFBFBD>').AsString)
+':'+ Changestr(frm_op_seae_edi_data.t_op_seae.fieldbyname('֪ͨ<CDA8>˹<EFBFBD><CBB9>Ҵ<EFBFBD><D2B4><EFBFBD>').AsString)
+':'+ Changestr(frm_op_seae_edi_data.t_op_seae.fieldbyname('֪ͨ<CDA8>˵绰').AsString)
+':'+ Changestr(frm_op_seae_edi_data.t_op_seae.fieldbyname('֪ͨ<CDA8><D6AA><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString)
+':'
+#39);
str.Add ('41:1' //2<><32><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
+':' //3<><33><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
+':'+trim(frm_op_seae_edi_data.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring) //4 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
+':'+GetpkgsEdi(frm_op_seae_edi_data.t_op_seae.fieldbyname('<27><>װ').asstring) //5 <20><>װ<EFBFBD><D7B0><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
+':'+trim(frm_op_seae_edi_data.t_op_seae.fieldbyname('<27><>װ').asstring) // 6 <20><>װ<EFBFBD><D7B0><EFBFBD><EFBFBD>
+':'+trim(frm_op_seae_edi_data.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring) // 7<><37>ë<EFBFBD><C3AB>
+':'+trim(frm_op_seae_edi_data.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring) // 8<><38><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
+':'+trim(frm_op_seae_edi_data.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring) // 9<><39><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
+':'+trim(frm_op_seae_edi_data.t_op_seae.fieldbyname('<27><><EFBFBD>ʽ').asstring) // 10<31><30><EFBFBD><EFBFBD>˰<EFBFBD><CBB0><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
+':' // 11<31><31><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
+':' // 12ԭ<32><D4AD><EFBFBD>ش<EFBFBD><D8B4><EFBFBD>
+#39);
if trim(frm_op_seae_edi_data.t_op_seae.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʶ').asstring)='D' then
begin
str.Add ('43:'+trim(frm_op_seae_edi_data.t_op_seae.fieldbyname('Σ<><CEA3>Ʒ<EFBFBD><C6B7><EFBFBD><EFBFBD>').asstring) //2Σ<32><CEA3>Ʒ<EFBFBD><C6B7><EFBFBD><EFBFBD>
+':none' //3Σ<33><CEA3>Ʒҳ<C6B7><D2B3>
+':' +trim(frm_op_seae_edi_data.t_op_seae.fieldbyname('Σ<><CEA3>Ʒ<EFBFBD><C6B7><EFBFBD><EFBFBD>').asstring) //4<><34><EFBFBD>Ϲ<EFBFBD>Σ<EFBFBD><CEA3>Ʒ<EFBFBD><C6B7><EFBFBD><EFBFBD>
+':none' //5Σ<35><CEA3>Ʒ<EFBFBD><C6B7>ǩ
+':' //6 Σ<>ջ<EFBFBD><D5BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
+':' //7 <20><><EFBFBD><EFBFBD>Σ<EFBFBD><CEA3>ƷӦ<C6B7><D3A6><EFBFBD><EFBFBD>ʩ<EFBFBD><CAA9>
+':' //8 ҽ<>Ƽ<EFBFBD><C6BC><EFBFBD>ָ<EFBFBD>Ϻ<EFBFBD>
+':' //9 Ӧ<><D3A6><EFBFBD><EFBFBD>ϵ
+':' //10 <20>¶ȼ<C2B6><C8BC><EFBFBD><EFBFBD><EFBFBD>λ
+':' //11 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
+':' //12 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
+':' //13 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
+':' //14 Σ<><CEA3>Ʒ<EFBFBD><C6B7>ϵ<EFBFBD><CFB5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
+':' //15 Σ<><CEA3>Ʒ<EFBFBD><C6B7>ϵ<EFBFBD>˵绰
+':' //16 Σ<><CEA3>Ʒ<EFBFBD><C6B7>ϵ<EFBFBD><CFB5>EMAIL
+':' //17 Σ<><CEA3>Ʒ<EFBFBD><C6B7>ϵ<EFBFBD>˴<EFBFBD><CBB4><EFBFBD>
+#39);
end
else
if trim(frm_op_seae_edi_data.t_op_seae.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʶ').asstring)='R' then
begin
str.Add ('43:' //2Σ<32><CEA3>Ʒ<EFBFBD><C6B7><EFBFBD><EFBFBD>
+':' //3Σ<33><CEA3>Ʒҳ<C6B7><D2B3>
+':' //4<><34><EFBFBD>Ϲ<EFBFBD>Σ<EFBFBD><CEA3>Ʒ<EFBFBD><C6B7><EFBFBD><EFBFBD>
+':' //5Σ<35><CEA3>Ʒ<EFBFBD><C6B7>ǩ
+':' //6 Σ<>ջ<EFBFBD><D5BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
+':' //7 <20><><EFBFBD><EFBFBD>Σ<EFBFBD><CEA3>ƷӦ<C6B7><D3A6><EFBFBD><EFBFBD>ʩ<EFBFBD><CAA9>
+':' //8 ҽ<>Ƽ<EFBFBD><C6BC><EFBFBD>ָ<EFBFBD>Ϻ<EFBFBD>
+':' //9 Ӧ<><D3A6><EFBFBD><EFBFBD>ϵ
+':C' //10 <20>¶ȼ<C2B6><C8BC><EFBFBD><EFBFBD><EFBFBD>λ
+':'+frm_op_seae_edi_data.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring //11 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
+':' //12 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
+':' //13 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
+':' //14 Σ<><CEA3>Ʒ<EFBFBD><C6B7>ϵ<EFBFBD><CFB5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
+':' //15 Σ<><CEA3>Ʒ<EFBFBD><C6B7>ϵ<EFBFBD>˵绰
+':' //16 Σ<><CEA3>Ʒ<EFBFBD><C6B7>ϵ<EFBFBD><CFB5>EMAIL
+':' //17 Σ<><CEA3>Ʒ<EFBFBD><C6B7>ϵ<EFBFBD>˴<EFBFBD><CBB4><EFBFBD>
+#39);
end;
try
Tempstr:=TStringList.Create;
Tempstr.Clear;
Tempstr.Text:=Changestr(frm_op_seae_edi_data.t_op_seae.fieldbyname('<27><>ͷ').asstring);
str.Add ('44:'
+ FormatListString(Tempstr,5,300)+ ':'
+ #39);
finally
Tempstr.Free;
end;
try
Tempstr:=TStringList.Create;
Tempstr.Clear;
Tempstr.Text:=Changestr(frm_op_seae_edi_data.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring);
str.Add ('47:'
+ FormatListString(Tempstr,5,300)+ ':'
+ #39);
finally
Tempstr.Free;
end;
Count:=Count+10;
XType := 'F';
XType := 'F';
strsql:='select t_op_ctn_edi.<2E><><EFBFBD><EFBFBD>,t_op_ctn_edi.<2E><><EFBFBD><EFBFBD>,t_op_ctn_edi.<2E><><EFBFBD><EFBFBD>,t_op_ctn_edi.<2E><><EFBFBD><EFBFBD>,t_op_ctn_edi.<2E>ߴ<EFBFBD>,t_op_ctn_edi.<2E><><EFBFBD><EFBFBD>,t_op_ctn_edi.<2E><><EFBFBD><EFBFBD>,t_op_ctn_edi.<2E><><EFBFBD><EFBFBD>,t_op_ctn_edi.<2E><>װ,t_op_ctn_edi.<2E><><EFBFBD><EFBFBD>,t_code_ctn.EDI<44><49><EFBFBD><EFBFBD> from t_op_ctn_edi '
+'left join t_code_ctn on t_code_ctn.<2E><><EFBFBD><EFBFBD>=t_op_ctn_edi.<2E><><EFBFBD><EFBFBD> WHERE t_op_ctn_edi.<2E><><EFBFBD><EFBFBD>='
+#39+frm_op_seae_edi_data.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring+#39;
try
rs:=Tadoquery.Create(application);
rs.Connection := frm_main.db;
rs.sql.clear;
rs.sql.add(strsql);
rs.Open;
rs.First;
if not rs.IsEmpty then begin
rs.First;
while not rs.Eof do
begin
str.Add ('51:001' //2<><32><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
+':'+trim(rs.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring) //3<><33><EFBFBD><EFBFBD>
+':'+trim(rs.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring) //4<><34>Ǧ<EFBFBD><C7A6><EFBFBD><EFBFBD>
+':'+Trim(rs.fieldbyname('<27>ߴ<EFBFBD>').asstring+rs.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring) //5<><35>װ<EFBFBD><D7B0><EFBFBD>ߴ<EFBFBD><DFB4><EFBFBD><EFBFBD><EFBFBD>
+':8' //6<><36>״̬<D7B4><CCAC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>߿<EFBFBD><DFBF><EFBFBD><EFBFBD><EFBFBD>ʶ<EFBFBD><CAB6><EFBFBD>
+':' +trim(IntToStr(rs.fieldbyname('<27><><EFBFBD><EFBFBD>').AsInteger)) //7<><37><EFBFBD>ڻ<EFBFBD><DABB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
+':'+trim(FloatToStr(rs.fieldbyname('<27><><EFBFBD><EFBFBD>').AsFloat)) //8<><38><EFBFBD>ڻ<EFBFBD><DABB><EFBFBD>
+':' //9<><39>Ƥ<EFBFBD><C6A4>
+':'+trim(FloatToStr(rs.fieldbyname('<27><><EFBFBD><EFBFBD>').AsFloat)) //10<31><30><EFBFBD>ڻ<EFBFBD><DABB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
+':' //11
+':' //12
+':' //13
+':' // 14
+':' // 15
+':' // 16
+':' // 17
+#39);
rs.Next;
end;
end;
rs.Close;
rs.Destroy;
except
on e:exception do
begin
rs.Close;
rs.Destroy;
exit;
end;
end;
frm_op_seae_edi_data.t_op_seae.Edit;
frm_op_seae_edi_data.t_op_seae.FieldByName('EDI״̬').AsString:='<27>ѷ<EFBFBD><D1B7><EFBFBD>';
frm_op_seae_edi_data.t_op_seae.Post;
end;
str.Add ('99:'+ inttostr(Count+2)+#39);
end;
Result:=str;
close;
end;
function Tfrm_op_seae_edi_custom_ld.GetCntrEdi(cntrsize: String):String;
var
aQuery:TADOQuery;
begin
aQuery:=CreateAdoQuery;
try
with aQuery do begin
Close;SQL.Clear;
SQL.Add('Select Edi<64><69><EFBFBD><EFBFBD> from t_code_ctn where <20><><EFBFBD><EFBFBD>='''+cntrsize+'''');
Open;
if IsEmpty then
Result:=''
else
Result:=FieldByName('Edi<64><69><EFBFBD><EFBFBD>').AsString;
end;
finally
FreeAndNil(aQuery);
end;
end;
function Tfrm_op_seae_edi_custom_ld.GetpkgsEdi(pkgs: String): String;
var
aQuery:TADOQuery;
begin
aQuery:=CreateAdoQuery;
try
with aQuery do begin
Close;SQL.Clear;
SQL.Add('Select Edi<64><69><EFBFBD><EFBFBD> from t_code_package where <20><><EFBFBD><EFBFBD>='''+pkgs+'''');
Open;
if IsEmpty then
Result:=''
else
Result:=FieldByName('Edi<64><69><EFBFBD><EFBFBD>').AsString;
end;
finally
FreeAndNil(aQuery);
end;
end;
function Tfrm_op_seae_edi_custom_ld.GetlineEdi(aline: String): String;
var
aQuery:TADOQuery;
begin
aQuery:=CreateAdoQuery;
try
with aQuery do begin
Close;SQL.Clear;
SQL.Add('Select Edi<64><69><EFBFBD><EFBFBD> from t_code_trade where <20><><EFBFBD><EFBFBD>='''+aline+'''');
Open;
if IsEmpty then
Result:=''
else
Result:=FieldByName('Edi<64><69><EFBFBD><EFBFBD>').AsString;
end;
finally
FreeAndNil(aQuery);
end;
end;
function Tfrm_op_seae_edi_custom_ld.GetvesselEdi(avessel: String): String;
var
aQuery:TADOQuery;
begin
aQuery:=CreateAdoQuery;
try
with aQuery do begin
Close;SQL.Clear;
SQL.Add('Select <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> from t_code_vessel where Ӣ<>Ĵ<EFBFBD><C4B4><EFBFBD>='''+avessel+'''');
Open;
if IsEmpty then
Result:=''
else
Result:=FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString;
end;
finally
FreeAndNil(aQuery);
end;
end;
procedure Tfrm_op_seae_edi_custom_ld.bsSkinButton3Click(Sender: TObject);
var
str:widestring;
StrL:TStrings;
i:integer;
str_memo:Tmemo;
ScriptPath:string;
begin
ScriptPath:=ExtractFilePath(ParamStr(0))+'CUSTOMFILE\';
if not DirectoryExists(ScriptPath) then
CreateDir(ScriptPath);
if Trim(frm_op_seae_edi_data.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><E1B5A5>').asstring)<>'' then
begin
str:=ScriptPath
+frm_op_seae_edi_data.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><E1B5A5>').asstring
+FormatDateTime('yyyy',now)
+FormatDateTime('mm',now)
+FormatDateTime('dd',now)
+FormatDateTime('hh',now)
+FormatDateTime('nn',now)+'.txt';
end
else
begin
str:=ScriptPath
+frm_op_seae_edi_data.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><E1B5A5>').asstring
+FormatDateTime('yyyy',now)
+FormatDateTime('mm',now)
+FormatDateTime('dd',now)
+FormatDateTime('hh',now)
+FormatDateTime('nn',now)+'.txt';
end;
strL:=Tstringlist.Create;
try
StrL:=CreateSIEdiFile_MBL;
for i:=0 to StrL.Count-1 do begin
if IsZhongwen(StrL[i]) then begin
if MessageDlg('<27><>Ʊҵ<C6B1><D2B5><EFBFBD><EFBFBD><EFBFBD>ܺ<EFBFBD><DCBA><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ַ<EFBFBD><D6B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ַ<EFBFBD>,ȷʵҪ<CAB5><D2AA><EFBFBD><EFBFBD><EFBFBD>ϴ<EFBFBD><CFB4><EFBFBD><EFBFBD><EFBFBD>',mtWarning,[mbYes,mbNo],0)=mrNo then
exit;
end;
end;
strL.SaveToFile(str);
str_memo:=Tmemo.create(application);
str_memo.visible:=false;
str_memo.Parent:=frm_op_seae_edi_custom_ld;
str_memo.Lines.Add('<27><>˾<EFBFBD><CBBE><EFBFBD><EFBFBD>:<3A><><EFBFBD><EFBFBD><EFBFBD>յ<EFBFBD>-<2D><><EFBFBD><EFBFBD>');
str_memo.Lines.Add('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>:'+Employee);
try
if Trim(str_memo.lines.Text)<>'' then
begin
SMTP1.AuthType := satDefault; //(satNone, satDefault, satSASL);
SMTP1.username:=MailAddress;
SMTP1.Password :=MailPw;
SMTP1.Host:='mail.sdsmartlogistics.com';
SMTP1.Port:=25;
try
SMTP1.Connect;
except
on e : Exception do
begin
ShowMessage('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>:'+E.Message);
end;
end;
if not SMTP1.Connected then
begin
Sleep(1000);
SMTP1.Connect;
end;
try
with IdMsg do
begin
body.Clear;
Body.Text :=str_memo.lines.Text;
From.address :=MailAddress;
Recipients.EMailAddresses :=MailAddress;
if Trim(frm_op_seae_edi_data.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><E1B5A5>').asstring)<>'' then
Subject:='<27><><EFBFBD><EFBFBD><EFBFBD>յ<EFBFBD> <20><><EFBFBD><EFBFBD><E1B5A5>:'+frm_op_seae_edi_data.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><E1B5A5>').asstring+' <20><><EFBFBD><EFBFBD><E1B5A5>:'+frm_op_seae_edi_data.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><E1B5A5>').asstring
else Subject:='<27><><EFBFBD><EFBFBD><EFBFBD>յ<EFBFBD> <20><><EFBFBD><EFBFBD><E1B5A5>:'+frm_op_seae_edi_data.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><E1B5A5>').asstring;
TIdAttachmentFile.Create(MessageParts,str);
end;
if not SMTP1.Connected then
begin
Sleep(1000);
SMTP1.Connect;
end;
SMTP1.Send(IdMsg);
MessageDlg('<27><><EFBFBD>ͳɹ<CDB3>!',mtConfirmation,[mbOK],0)
finally
SMTP1.Disconnect;
end;
end;
except
MessageDlg('<27><><EFBFBD><EFBFBD>ʧ<EFBFBD><CAA7>!',mtError,[mbOK],0);
end;
str_memo.free;
finally
FreeAndNil(StrL)
end;
end;
procedure Tfrm_op_seae_edi_custom_ld.bsSkinButton4Click(Sender: TObject);
begin
if frm_op_seae_edi_custom_ld.Height=349 then
frm_op_seae_edi_custom_ld.Height:=200
else
frm_op_seae_edi_custom_ld.Height:=349;
end;
end.