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.

440 lines
15 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_ch_fee_edi;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, ExtCtrls, bsSkinCtrls, Grids, Wwdbigrd, Wwdbgrid, dxExEdtr, DB,
ADODB, dxCntner, dxTL, dxDBCtrl, dxDBGrid, dxDBTLCl, dxGrClms, StdCtrls,
dxGrClEx;
type
TfrmCh_fee_edi = class(TForm)
bsknpnl2: TbsSkinPanel;
btn2Cancel: TbsSkinButton;
btn1Import: TbsSkinButton;
btn12: TbsSkinButton;
pnl1: TPanel;
dxdbgrd1_ch_fee_edi: TdxDBGrid;
qry1_ch_fee_edi: TADOQuery;
ds1_ch_fee_edi: TDataSource;
dxdbgrdmskclmndxdbgrd1_ch_fee_ediCH_ID: TdxDBGridMaskColumn;
dxdbgrdmskclmndxdbgrd1_ch_fee_edireportid: TdxDBGridMaskColumn;
dxdbgrdmskclmndxdbgrd1_ch_fee_ediColumn3: TdxDBGridMaskColumn;
dxdbgrdmskclmndxdbgrd1_ch_fee_ediColumn4: TdxDBGridMaskColumn;
dxdbgrdmskclmndxdbgrd1_ch_fee_ediColumn5: TdxDBGridMaskColumn;
dxdbgrdmskclmndxdbgrd1_ch_fee_ediColumn7: TdxDBGridMaskColumn;
dxdbgrdmskclmndxdbgrd1_ch_fee_ediColumn8: TdxDBGridMaskColumn;
dxdbgrdmskclmndxdbgrd1_ch_fee_ediColumn9: TdxDBGridMaskColumn;
dxdbgrdmskclmndxdbgrd1_ch_fee_ediColumn13: TdxDBGridMaskColumn;
dxdbgrdmskclmndxdbgrd1_ch_fee_ediColumn15: TdxDBGridMaskColumn;
dxdbgrdtclmndxdbgrd1_ch_fee_ediColumn16: TdxDBGridDateColumn;
dxdbgrdtclmndxdbgrd1_ch_fee_ediColumn17: TdxDBGridDateColumn;
dxdbgrdmskclmndxdbgrd1_ch_fee_ediColumn18: TdxDBGridMaskColumn;
dxdbgrdmskclmndxdbgrd1_ch_fee_ediColumn19: TdxDBGridMaskColumn;
dxdbgrdmskclmndxdbgrd1_ch_fee_ediColumn20: TdxDBGridMaskColumn;
dxdbgrdmskclmndxdbgrd1_ch_fee_ediColumn21: TdxDBGridMaskColumn;
dxdbgrdmskclmndxdbgrd1_ch_fee_ediColumn22: TdxDBGridMaskColumn;
lbl1: TLabel;
qry1: TADOQuery;
ds1: TDataSource;
atncfldqry1_ch_fee_ediCH_ID: TAutoIncField;
strngfldqry1_ch_fee_edireportid: TStringField;
strngfldqry1_ch_fee_ediDSDesigner: TStringField;
strngfldqry1_ch_fee_ediDSDesigner2: TStringField;
strngfldqry1_ch_fee_ediDSDesigner3: TStringField;
strngfldqry1_ch_fee_ediDSDesigner4: TStringField;
strngfldqry1_ch_fee_ediDSDesigner5: TStringField;
strngfldqry1_ch_fee_ediDSDesigner6: TStringField;
strngfldqry1_ch_fee_ediDSDesigner7: TStringField;
bcdfldqry1_ch_fee_ediDSDesigner8: TBCDField;
bcdfldqry1_ch_fee_ediDSDesigner9: TBCDField;
bcdfldqry1_ch_fee_ediDSDesigner10: TBCDField;
strngfldqry1_ch_fee_ediDSDesigner11: TStringField;
bcdfldqry1_ch_fee_ediDSDesigner12: TBCDField;
strngfldqry1_ch_fee_ediDSDesigner13: TStringField;
dtmfldqry1_ch_fee_ediDSDesigner14: TDateTimeField;
dtmfldqry1_ch_fee_ediDSDesigner15: TDateTimeField;
strngfldqry1_ch_fee_ediDSDesigner16: TStringField;
strngfldqry1_ch_fee_ediDSDesigner17: TStringField;
strngfldqry1_ch_fee_ediDSDesigner18: TStringField;
strngfldqry1_ch_fee_ediDSDesigner19: TStringField;
intgrfldqry1_ch_fee_ediDSDesigner20: TIntegerField;
strngfldqry1DSDesigner: TStringField;
strngfldqry1DSDesigner2: TStringField;
strngfldqry1DSDesigner3: TStringField;
dxdbgrdclmn_ch_fee_ediColumn6: TdxDBGridColumn;
dxdbgrdclmndxdbgrdcrncyclmndxdbgrd1_ch_fee_ediColumn12: TdxDBGridColumn;
dxdbgrdclmndxdbgrdcrncyclmndxdbgrd1_ch_fee_ediColumn10: TdxDBGridColumn;
dxdbgrdclmndxdbgrdcrncyclmndxdbgrd1_ch_fee_ediColumn11: TdxDBGridColumn;
dxdbgrdclmndxdbgrdcrncyclmndxdbgrd1_ch_fee_ediColumn14: TdxDBGridColumn;
btn3ViewFee: TbsSkinButton;
procedure btn2CancelClick(Sender: TObject);
procedure btn1ImportClick(Sender: TObject);
procedure btn3ViewFeeClick(Sender: TObject);
private
{ Private declarations }
m_qryTask:TADOQuery;
m_blshowform:Boolean;
public
{ Public declarations }
procedure BindData(qrytask:TADOQuery;blshowform:Boolean);
function DoImportData():Boolean;
function CancelImportData():Boolean;
end;
var
frmCh_fee_edi: TfrmCh_fee_edi;
implementation
uses u_main,u_op_seae_TaskContrast,my_sys_function;
{$R *.dfm}
procedure TfrmCh_fee_edi.BindData(qrytask:TADOQuery;blshowform:Boolean);
var
taskid:string;
bsno,strtmp,strsql:string;
ifinish:Integer;
begin
m_blshowform:=blshowform;
m_qryTask:=qrytask;
taskid:=qrytask.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString;
bsno:= qrytask.fieldbyname('SEA<45><41><EFBFBD><EFBFBD>').AsString;
ifinish:= m_qryTask.FieldByName('<27>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD>').AsInteger;
btn1Import.Enabled:= True;
btn2Cancel.Enabled:=true;
if(bsno='') then
btn1Import.Enabled:=False
else
begin
if(ifinish=1) and (blshowform=True) then
begin
btn1Import.Enabled:=False;
btn2Cancel.Enabled:=false;
end
else
begin
strtmp:=m_qryTask.fieldbyname('<27><>ע').AsString ;
if( ifinish = 0) and ( strtmp<>'' ) and (Pos('<27><><EFBFBD><EFBFBD>ƥ<EFBFBD><C6A5>',strtmp)>0) then
begin
strsql:= Format('update t_ch_fee_edi set <20><><EFBFBD><EFBFBD>=''%s'' where reportid=''%s'';',
[bsno,taskid]) ;
m_qryTask.Connection.Execute(strsql);
end;
end;
end;
//<2F><><EFBFBD><EFBFBD>
// btn1Import.Enabled:=false;
//
//qry1.Active:=False;
//qry1.Active:=True;
lbl1.Caption:=qrytask.fieldbyname('<27><><EFBFBD><EFBFBD>˵<EFBFBD><CBB5>').AsString;
qry1_ch_fee_edi.Active:=False;
qry1_ch_fee_edi.Parameters[0].Value:=taskid;
qry1_ch_fee_edi.Active:=True;
//<2F><><EFBFBD><EFBFBD>ǰ<EFBFBD>Ȳ<EFBFBD><C8B2><EFBFBD> [<5B><><EFBFBD><EFBFBD>] --<2D><><EFBFBD><EFBFBD><EFBFBD>Զ<EFBFBD>ƥ<EFBFBD><C6A5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
// ContrastTDNR();
end;
procedure TfrmCh_fee_edi.btn2CancelClick(Sender: TObject);
begin
CancelImportData();
end;
function TfrmCh_fee_edi.DoImportData():Boolean ;
var
strtmp,fphm,taskid:string;
strsql,sqlpre:string;
strfield1,strfield2:string;
qrytmp:TAdoquery;
begin
//<2F><><EFBFBD><EFBFBD>״̬:<3A><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>鷢Ʊ<E9B7A2><C6B1><EFBFBD>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD>,<2C>Ѵ<EFBFBD><D1B4>ڲ<EFBFBD><DAB2><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
//<2F><><EFBFBD><EFBFBD>ɾ<EFBFBD><C9BE>: 1>op_seae <20><><EFBFBD><EFBFBD>״̬ Ϊ <20><><EFBFBD>÷<EFBFBD><C3B7><EFBFBD> <20><> <20><EFBFBD><E1BDBB><EFBFBD><EFBFBD><EFBFBD><EFBFBD> Ҳ<><D2B2><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
// 2> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><><C6B1><EFBFBD><EFBFBD>/<2F><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>/<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><>Ϊ<EFBFBD><CEAA>
fphm:='';
if(not qry1_ch_fee_edi.IsEmpty) then
begin
qry1_ch_fee_edi.First;
fphm:=qry1_ch_fee_edi.fieldbyname('<27><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>').asstring;
end;
if( fphm='')then
begin
result:=False;
Exit;
end;
if(lbl1.caption='<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ʊ') then
begin
qrytmp:=CreateAdoQuery;
strsql:='select <20><><EFBFBD><EFBFBD>״̬, isnull(<28><><EFBFBD><EFBFBD><ECB5A5>,'''') as <20><><EFBFBD><EFBFBD><ECB5A5> from t_op_seae where <20><><EFBFBD><EFBFBD>='''+ m_qryTask.fieldbyname('SEA<45><41><EFBFBD><EFBFBD>').AsString +''' ';
with qrytmp do
begin
close;sql.Clear;
sql.Add(strsql);
Open;
if not IsEmpty then
begin
if(fieldbyname('<27><><EFBFBD><EFBFBD><ECB5A5>').asstring<>'') then
begin
showmessage(format('<27><>ҵ<EFBFBD><D2B5><EFBFBD>Ѿ<EFBFBD><D1BE>б<EFBFBD><D0B1><EFBFBD><ECB5A5>,<2C><><EFBFBD><EFBFBD>ɾ<EFBFBD><C9BE><EFBFBD><EFBFBD>',[strtmp]));
result:=False;
Exit;
end;
strtmp:= fieldbyname('<27><><EFBFBD><EFBFBD>״̬').asstring;
end;
close;
end;
if( strtmp='<27><><EFBFBD>÷<EFBFBD><C3B7><EFBFBD>') or (strtmp ='<27><EFBFBD><E1BDBB><EFBFBD><EFBFBD>') then
begin
showmessage(format('<27><>ҵ<EFBFBD><D2B5><EFBFBD>Ѿ<EFBFBD>%s,<2C><><EFBFBD><EFBFBD>ͨ<EFBFBD><CDA8><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>ɾ<EFBFBD><C9BE>,<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><><C8BB><EFBFBD>ֶ<EFBFBD><D6B6><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>',[strtmp]));
result:=False;
Exit;
end
else
begin
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ö<EFBFBD><C3B6><EFBFBD>
strsql:='select <20><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>,<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,<2C><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>,<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> from t_ch_fee '
+format(' where msk<73><6B>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>=''%s''',[fphm])
+' and ( isnull(<28><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>,0)<>0 or isnull(<28><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,0)<>0 or isnull(<28><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>,0)<>0 or isnull(<28><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,0)<>0)';
with qrytmp do
begin
close;sql.Clear;
sql.Add(strsql);
Open;
if not IsEmpty then
begin
ShowMessage('<27><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>,<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,<2C><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>,<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>д<EFBFBD><D0B4>ڲ<EFBFBD>Ϊ0<CEAA><30><EFBFBD><EFBFBD>Ŀ,<2C><><EFBFBD><EFBFBD>ɾ<EFBFBD><C9BE><EFBFBD><EFBFBD>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>,<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><><C8BB><EFBFBD>ֶ<EFBFBD><D6B6><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
result:=False;
Close;
Exit;
end;
Close;
end;
//
try
if(m_blshowform=True) then
m_qryTask.Connection.BeginTrans;
strsql:='';
With qrytmp do
begin
close;SQL.Clear;
sql.add(Format('select CH_ID from t_ch_fee where msk<73><6B>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>= ''%s'' ',[fphm]));
open;
if(not qrytmp.IsEmpty ) then
begin
while not eof do
begin
strsql :=strsql+'delete from t_ch_fee where CH_ID =' + qrytmp.fieldbyname('CH_ID').AsString + ';';
qrytmp.next;
end;
m_qryTask.Connection.Execute(strsql);
end;
close;
end;
sqlpre:='INSERT INTO t_op_task_state ( [<5B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>],[<5B><><EFBFBD><EFBFBD>״̬],[<5B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>])VALUES (''%s'' ,''%s'' ,''%s'')';
strsql:=Format(sqlpre,[m_qryTask.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring,'<27><><EFBFBD><EFBFBD>',employee] );
m_qryTask.Connection.Execute(strsql);
if(m_blshowform) then
begin
//д<><D0B4><EFBFBD><EFBFBD>
m_qryTask.Edit;
m_qryTask.FieldByName('<27><><EFBFBD><EFBFBD>ʱ<EFBFBD><CAB1>').AsDateTime:=Now;
m_qryTask.FieldByName('<27>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD>').AsInteger:=1;
m_qryTask.FieldByName('<27><><EFBFBD><EFBFBD>״̬').AsString:='<27><><EFBFBD><EFBFBD>';
m_qryTask.post;
m_qryTask.Connection.CommitTrans;
m_qryTask.Requery();
Application.MessageBox(PChar('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'),'<27><>Ϣ<EFBFBD><CFA2>ʾ');
end;
except on e:Exception do
begin
// on except
if(m_blshowform=True) and (m_qryTask.Connection.InTransaction=True) then
m_qryTask.Connection.RollbackTrans;
m_qryTask.Cancel();
Result:=False;
Application.MessageBox(PChar('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>: '+e.Message),'<27><>Ϣ<EFBFBD><CFA2>ʾ');
end;
end;
//
end;
end
else
begin
qrytmp:=CreateAdoQuery;
strsql:='select <20><><EFBFBD><EFBFBD>״̬, isnull(<28><><EFBFBD><EFBFBD><ECB5A5>,'''') as <20><><EFBFBD><EFBFBD><ECB5A5> from t_op_seae where <20><><EFBFBD><EFBFBD>='''+ m_qryTask.fieldbyname('SEA<45><41><EFBFBD><EFBFBD>').AsString +''' ';
with qrytmp do
begin
close;sql.Clear;
sql.Add(strsql);
Open;
if not IsEmpty then
begin
strtmp:= fieldbyname('<27><><EFBFBD><EFBFBD>״̬').asstring;
//
if( strtmp='<27><><EFBFBD>÷<EFBFBD><C3B7><EFBFBD>') or (strtmp ='<27><EFBFBD><E1BDBB><EFBFBD><EFBFBD>') then
begin
showmessage(format('<27><>ҵ<EFBFBD><D2B5><EFBFBD>Ѿ<EFBFBD>%s,<2C><><EFBFBD>ܵ<EFBFBD><DCB5>롣',[strtmp]));
result:=False;
Exit;
end
else if(fieldbyname('<27><><EFBFBD><EFBFBD><ECB5A5>').asstring<>'') then
begin
showmessage(format('<27><>ҵ<EFBFBD><D2B5><EFBFBD>Ѿ<EFBFBD><D1BE>б<EFBFBD><D0B1><EFBFBD><ECB5A5>,<2C><><EFBFBD>ܵ<EFBFBD><DCB5>롣',[strtmp]));
result:=False;
Exit;
end;
end;
close;
end;
//<2F>ж<EFBFBD><D0B6>Ƿ<EFBFBD><C7B7>Ѿ<EFBFBD><D1BE><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ö<EFBFBD><C3B6><EFBFBD>
strsql:='select CH_ID from t_ch_fee ' +format('where MSK<53><4B>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>=''%s'';',[fphm]) ;
//qrytmp:=CreateAdoQuery;
with qrytmp do
begin
close;sql.Clear;
sql.Add(strsql);
Open;
if not IsEmpty then
begin
ShowMessage(Format('<27><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD> %s <20>Ѵ<EFBFBD><D1B4><EFBFBD>,<2C><><EFBFBD><EFBFBD><EFBFBD>ظ<EFBFBD><D8B8><EFBFBD><EFBFBD><EFBFBD>!',[fphm]));
result:=False;
Close;
Exit;
end;
Close;
end;
try
if(m_blshowform) then
m_qryTask.Connection.BeginTrans;
//<2F>ұ<EFBFBD><D2B1><EFBFBD><EFBFBD><EFBFBD>Ԫ<EFBFBD><D4AA>ȫ<EFBFBD><C8AB><EFBFBD><EFBFBD><EFBFBD>ɺ<EFBFBD><C9BA>˷<EFBFBD>
strfield1:='<27><><EFBFBD><EFBFBD>,<2C><><EFBFBD><EFBFBD>״̬,<2C><><EFBFBD><EFBFBD>,<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,<2C><><EFBFBD>㵥λ,<2C>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>,<2C><>׼,<2C><><EFBFBD><EFBFBD>,<2C><><EFBFBD><EFBFBD>,'
+'<27><><EFBFBD><EFBFBD>,<2C>ұ<EFBFBD>,<2C><><EFBFBD><EFBFBD>,<2C><>ע,<2C><EFBFBD><E1BDBB><EFBFBD><EFBFBD><><C2BC><EFBFBD><EFBFBD>, ¼<><C2BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,<2C><><EFBFBD><EFBFBD>Ӣ<EFBFBD><D3A2><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,MSK<53><4B>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD><><CBB3>'
+',<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,<2C><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>,<2C>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD>,<2C><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>,<2C><><EFBFBD><EFBFBD>,<2C>Ƿ<EFBFBD><C7B7>渶,<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ʊ,<2C><><EFBFBD>뿪Ʊ,<2C>ύ,<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>';
//<2F><><EFBFBD><EFBFBD>
strsql:=' insert into [t_ch_fee] ( '+ strfield1+ ' )' ;
strfield2:='<27><><EFBFBD><EFBFBD>,''¼<><C2BC>״̬'',<2C><><EFBFBD><EFBFBD>,case when <20>ұ<EFBFBD>=''USD'' and <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>='''' THEN ''<27><><EFBFBD>˷<EFBFBD>'' else <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> end as <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,<2C><><EFBFBD>㵥λ,<2C>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>,<2C><>׼,'
+'case when <20>ұ<EFBFBD>=''USD'' then <20><><EFBFBD><EFBFBD>/<2F><><EFBFBD><EFBFBD> else <20><><EFBFBD><EFBFBD> end as <20><><EFBFBD><EFBFBD>,<2C><><EFBFBD><EFBFBD>,'
+'<27><><EFBFBD><EFBFBD>,<2C>ұ<EFBFBD>,'
+' case when <20>ұ<EFBFBD>=''USD'' THEN isnull( (select <20><><EFBFBD><EFBFBD> from t_code_usdexrate where <20><>ʼ<EFBFBD><CABC><EFBFBD><EFBFBD><= t.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> and <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>>=t.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ),(select <20><><EFBFBD><EFBFBD> from t_code_currency where <20>ұ<EFBFBD>=''USD'') ) ELSE <20><><EFBFBD><EFBFBD> END AS <20><><EFBFBD><EFBFBD>, '
+' <20><>ע,<2C><EFBFBD><E1BDBB><EFBFBD><EFBFBD>,'''+ employee + ''' , getdate(),<2C><><EFBFBD><EFBFBD>Ӣ<EFBFBD><D3A2><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,<2C><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD><><CBB3>'
+',0,0,0,0,0,0,0,0,0,0,0';
strsql:= strsql + ' SELECT '+strfield2 + ' FROM '
+' [t_ch_fee_edi] f,(select <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,<2C><><EFBFBD><EFBFBD> as <20><><EFBFBD><EFBFBD>1 from t_op_seae ) t where f.<2E><><EFBFBD><EFBFBD>=t.<2E><><EFBFBD><EFBFBD>1 and reportid='''+ m_qrytask.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring + ''';';
m_qryTask.Connection.Execute(strsql);
if(m_blshowform) then
begin
sqlpre:='INSERT INTO t_op_task_state ( [<5B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>],[<5B><><EFBFBD><EFBFBD>״̬],[<5B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>])VALUES (''%s'' ,''%s'' ,''%s'')';
strsql:=Format(sqlpre,[m_qryTask.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring,'<27><><EFBFBD><EFBFBD>',employee] );
m_qryTask.Connection.Execute(strsql); //д<><D0B4><EFBFBD><EFBFBD>
m_qryTask.Edit;
m_qryTask.FieldByName('<27><><EFBFBD><EFBFBD>ʱ<EFBFBD><CAB1>').AsDateTime:=Now;
m_qryTask.FieldByName('<27>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD>').AsInteger:=1;
m_qryTask.FieldByName('<27><><EFBFBD><EFBFBD>״̬').AsString:='<27><><EFBFBD><EFBFBD>';
m_qryTask.post;
m_qryTask.Connection.CommitTrans;
m_qryTask.Requery();
Application.MessageBox(PChar('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'),'<27><>Ϣ<EFBFBD><CFA2>ʾ');
frmOpSeae_TaskContrast.close;
end;
except on e:Exception do
begin
if(m_blshowform) then
m_qryTask.Connection.RollbackTrans;
m_qryTask.Cancel();
Result:=False;
Application.MessageBox(PChar('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>: '+e.Message),'<27><>Ϣ<EFBFBD><CFA2>ʾ');
end;
end;
end;
end;
function TfrmCh_fee_edi.CancelImportData():Boolean;
var
sql,bsno,reportid,cnfields:string;
begin
if( Application.MessageBox(PChar('<27><>ȷʵҪֱ<D2AA>ӽ<EFBFBD><D3BD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>?'+#13#10+'<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֱ<EFBFBD>ӹر<D3B9><D8B1><EFBFBD><EFBFBD><EFBFBD>!,<2C>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>?'),'<27><>Ϣ<EFBFBD><CFA2>ʾ',MB_YESNO+ MB_ICONQUESTION)<>IDYES) then
Exit;
//
try
//** m_qryTask.Connection.BeginTrans;
//
m_qryTask.Edit;
m_qryTask.FieldByName('<27><><EFBFBD><EFBFBD>ʱ<EFBFBD><CAB1>').AsDateTime:=Now;
m_qryTask.FieldByName('<27>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD>').AsInteger:=1;
m_qryTask.FieldByName('<27><><EFBFBD><EFBFBD>״̬').AsString:='<27><><EFBFBD><EFBFBD>';
m_qryTask.Post;
//
sql:='INSERT INTO t_op_task_state ( [<5B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>],[<5B><><EFBFBD><EFBFBD>״̬],[<5B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>])VALUES (''%s'' ,''%s'' ,''%s'')';
sql:=Format(sql,[m_qryTask.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring,'<27><><EFBFBD><EFBFBD>',employee] );
m_qryTask.Connection.Execute(sql);
//** m_qryTask.Connection.CommitTrans;
m_qryTask.Requery();
Application.MessageBox(PChar('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'),'<27><>Ϣ<EFBFBD><CFA2>ʾ');
frmOpSeae_TaskContrast.close;
except on e:Exception do
begin
//** m_qryTask.Connection.RollbackTrans;
Result:=False;
Application.MessageBox(PChar('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>: '+E.Message),'<27><>Ϣ<EFBFBD><CFA2>ʾ');
end;
end;
end;
procedure TfrmCh_fee_edi.btn1ImportClick(Sender: TObject);
begin
//
DoImportData();
end;
procedure TfrmCh_fee_edi.btn3ViewFeeClick(Sender: TObject);
var
bsno:string;
begin
//
bsno:=m_qryTask.fieldbyname('SEA<45><41><EFBFBD><EFBFBD>').AsString;
if(bsno<>'') then
begin
fee_view(bsno);
end;
end;
end.