|
|
unit u_code_UsdExRate;
|
|
|
|
|
|
interface
|
|
|
|
|
|
uses
|
|
|
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
|
|
|
BusinessSkinForm, bsSkinCtrls, ExtCtrls, dxExEdtr, dxCntner, dxTL,
|
|
|
dxDBCtrl, dxDBGrid,Dialogs, dxDBTLCl, dxGrClms, DB, ADODB;
|
|
|
|
|
|
type
|
|
|
Tfrm_code_UsdExRate = class(TForm)
|
|
|
Panel1: TPanel;
|
|
|
bsSkinButton1: TbsSkinButton;
|
|
|
bsSkinButton2: TbsSkinButton;
|
|
|
bsSkinButton4: TbsSkinButton;
|
|
|
bsSkinButton3: TbsSkinButton;
|
|
|
bsSkinButton5: TbsSkinButton;
|
|
|
bsBusinessSkinForm1: TbsBusinessSkinForm;
|
|
|
dsrUsdExRate: TDataSource;
|
|
|
t_code_usdexrate: TADOQuery;
|
|
|
bsSkinGroupBox1: TbsSkinGroupBox;
|
|
|
dxDBGrid1: TdxDBGrid;
|
|
|
dxDBGrid1Column1: TdxDBGridMaskColumn;
|
|
|
dxDBGrid1Column3: TdxDBGridDateColumn;
|
|
|
dxDBGrid1Column2: TdxDBGridDateColumn;
|
|
|
bsSkinGroupBox2: TbsSkinGroupBox;
|
|
|
dxDBGrid2: TdxDBGrid;
|
|
|
dxDBGridMaskColumn1: TdxDBGridMaskColumn;
|
|
|
dxDBGridDateColumn1: TdxDBGridDateColumn;
|
|
|
dxDBGridDateColumn2: TdxDBGridDateColumn;
|
|
|
ds_code_jpexrate1: TDataSource;
|
|
|
t_code_jpexrate: TADOQuery;
|
|
|
Panel2: TPanel;
|
|
|
bsSkinButton6: TbsSkinButton;
|
|
|
bsSkinButton7: TbsSkinButton;
|
|
|
bsSkinButton8: TbsSkinButton;
|
|
|
bsSkinButton9: TbsSkinButton;
|
|
|
dxDBGrid1Column4: TdxDBGridColumn;
|
|
|
dxDBGrid1Column5: TdxDBGridColumn;
|
|
|
bsSkinButton11: TbsSkinButton;
|
|
|
bsSkinButton10: TbsSkinButton;
|
|
|
procedure FormShow(Sender: TObject);
|
|
|
procedure FormCloseQuery(Sender: TObject; var CanClose: Boolean);
|
|
|
procedure bsSkinButton5Click(Sender: TObject);
|
|
|
procedure bsSkinButton3Click(Sender: TObject);
|
|
|
procedure bsSkinButton2Click(Sender: TObject);
|
|
|
procedure bsSkinButton4Click(Sender: TObject);
|
|
|
procedure bsSkinButton1Click(Sender: TObject);
|
|
|
procedure bsSkinButton6Click(Sender: TObject);
|
|
|
procedure bsSkinButton7Click(Sender: TObject);
|
|
|
procedure bsSkinButton8Click(Sender: TObject);
|
|
|
procedure bsSkinButton9Click(Sender: TObject);
|
|
|
procedure bsSkinButton10Click(Sender: TObject);
|
|
|
procedure bsSkinButton11Click(Sender: TObject);
|
|
|
private
|
|
|
procedure Upbsrate(bsno,aCurrency:string);
|
|
|
|
|
|
{ Private declarations }
|
|
|
public
|
|
|
{ Public declarations }
|
|
|
end;
|
|
|
|
|
|
var
|
|
|
frm_code_UsdExRate: Tfrm_code_UsdExRate;
|
|
|
|
|
|
implementation
|
|
|
|
|
|
uses u_data_share, my_sys_function, u_main, u_sys_progress;
|
|
|
|
|
|
{$R *.dfm}
|
|
|
|
|
|
procedure Tfrm_code_UsdExRate.FormShow(Sender: TObject);
|
|
|
begin
|
|
|
if not t_code_usdexrate.Active then
|
|
|
t_code_usdexrate.Open;
|
|
|
{
|
|
|
if not t_code_jpexrate.Active then
|
|
|
t_code_jpexrate.Open;
|
|
|
}
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_code_UsdExRate.FormCloseQuery(Sender: TObject;
|
|
|
var CanClose: Boolean);
|
|
|
begin
|
|
|
CanClose:=frm_close_query(t_code_usdexrate);
|
|
|
// CanClose:=frm_close_query(t_code_jpexrate);
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_code_UsdExRate.bsSkinButton5Click(Sender: TObject);
|
|
|
begin
|
|
|
close;
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_code_UsdExRate.bsSkinButton3Click(Sender: TObject);
|
|
|
begin
|
|
|
table_cancel(t_code_usdexrate);
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_code_UsdExRate.bsSkinButton2Click(Sender: TObject);
|
|
|
begin
|
|
|
table_post(t_code_usdexrate);
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_code_UsdExRate.bsSkinButton4Click(Sender: TObject);
|
|
|
begin
|
|
|
table_delete(t_code_usdexrate);
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_code_UsdExRate.bsSkinButton1Click(Sender: TObject);
|
|
|
begin
|
|
|
t_code_usdexrate.Insert;
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_code_UsdExRate.bsSkinButton6Click(Sender: TObject);
|
|
|
begin
|
|
|
// t_code_jpexrate.Insert;
|
|
|
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_code_UsdExRate.bsSkinButton7Click(Sender: TObject);
|
|
|
begin
|
|
|
// table_post(t_code_jpexrate);
|
|
|
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_code_UsdExRate.bsSkinButton8Click(Sender: TObject);
|
|
|
begin
|
|
|
// table_delete(t_code_jpexrate);
|
|
|
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_code_UsdExRate.bsSkinButton9Click(Sender: TObject);
|
|
|
begin
|
|
|
// table_cancel(t_code_jpexrate);
|
|
|
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_code_UsdExRate.bsSkinButton10Click(Sender: TObject);
|
|
|
var aAdoQuery:TAdoQuery;
|
|
|
s:string;
|
|
|
begin
|
|
|
if t_code_usdexrate.FieldByName('<27><><EFBFBD><EFBFBD>').IsNull then Exit;
|
|
|
s:='<27><>:'+t_code_usdexrate.FieldByName('<27><>ʼ<EFBFBD><CABC><EFBFBD><EFBFBD>').AsString+' <20><>:'+ t_code_usdexrate.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString+' <20>Ļ<EFBFBD><C4BB><EFBFBD> '+'<27><><EFBFBD><EFBFBD>Ϊ'+t_code_usdexrate.FieldByName('<27><><EFBFBD><EFBFBD>').AsString;
|
|
|
if MessageDlg('ȷʵҪ<CAB5><D2AA><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>(<28><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>-<2D><><EFBFBD>ĵ<EFBFBD>)'+s+'Ҫ<><D2AA><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>',mtWarning,[mbyes,mbno],0)<>mryes then
|
|
|
Exit;
|
|
|
if not ASSIGNED(frm_sys_progress) then
|
|
|
frm_sys_progress:=tfrm_sys_progress.Create(self);
|
|
|
|
|
|
frm_sys_progress.bsSkinGauge1.ProgressText:='<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ⱥ<C8BA><F2A1A3A1><EFBFBD>';
|
|
|
frm_sys_progress.Show;
|
|
|
|
|
|
aAdoQuery:=CreateAdoQuery;
|
|
|
with aAdoQuery do
|
|
|
try
|
|
|
Close;SQL.Clear;
|
|
|
sql.Add('Select * from V_op_bscard_All where ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>=''<27><>ͨ<EFBFBD><CDA8>''');
|
|
|
sql.Add('and <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> between :beginEtd and :endETD');
|
|
|
Parameters.ParamByName('beginEtd').Value:=t_code_usdexrate.FieldByName('<27><>ʼ<EFBFBD><CABC><EFBFBD><EFBFBD>').AsDateTime;
|
|
|
Parameters.ParamByName('endETD').Value:=t_code_usdexrate.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsDateTime;
|
|
|
Open;First;
|
|
|
if not IsEmpty then
|
|
|
begin
|
|
|
frm_sys_progress.bsSkinGauge1.MaxValue:=recordcount;
|
|
|
frm_sys_progress.bsSkinGauge1.MinValue:=0;
|
|
|
frm_sys_progress.bsSkinGauge1.Value:=0;
|
|
|
frm_sys_progress.Update;
|
|
|
while not Eof do
|
|
|
begin
|
|
|
frm_sys_progress.bsSkinGauge1.Value:=frm_sys_progress.bsSkinGauge1.Value+1;
|
|
|
frm_sys_progress.bsSkinGauge1.ProgressText:='<27><><EFBFBD>ᵥ<EFBFBD><E1B5A5>:'+FieldByName('<27><><EFBFBD>ᵥ<EFBFBD><E1B5A5>').Asstring;
|
|
|
Upbsrate(FieldByName('<27><><EFBFBD><EFBFBD>').Asstring,'USD');
|
|
|
Next;
|
|
|
end;
|
|
|
end;
|
|
|
|
|
|
Close;SQL.Clear;
|
|
|
sql.Add('Select * from V_op_bscard_All where ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>=''<27><><EFBFBD>ĵ<EFBFBD>''');
|
|
|
sql.Add('and <20><><EFBFBD><EFBFBD><EFBFBD>ڼ<EFBFBD> between :beginEtd and :endETD');
|
|
|
Parameters.ParamByName('beginEtd').Value:=t_code_usdexrate.FieldByName('<27><>ʼ<EFBFBD><CABC><EFBFBD><EFBFBD>').AsDateTime;
|
|
|
Parameters.ParamByName('endETD').Value:=t_code_usdexrate.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsDateTime;
|
|
|
Open;First;
|
|
|
if not IsEmpty then
|
|
|
begin
|
|
|
Open;First;
|
|
|
frm_sys_progress.bsSkinGauge1.MaxValue:=recordcount;
|
|
|
frm_sys_progress.bsSkinGauge1.MinValue:=0;
|
|
|
frm_sys_progress.bsSkinGauge1.Value:=0;
|
|
|
frm_sys_progress.Update;
|
|
|
while not Eof do
|
|
|
begin
|
|
|
frm_sys_progress.bsSkinGauge1.Value:=frm_sys_progress.bsSkinGauge1.Value+1;
|
|
|
frm_sys_progress.bsSkinGauge1.ProgressText:='<27><><EFBFBD>ᵥ<EFBFBD><E1B5A5>:'+FieldByName('<27><><EFBFBD>ᵥ<EFBFBD><E1B5A5>').Asstring;
|
|
|
Upbsrate(FieldByName('<27><><EFBFBD><EFBFBD>').Asstring,'USD');
|
|
|
Next;
|
|
|
end;
|
|
|
end;
|
|
|
finally
|
|
|
frm_sys_progress.close;
|
|
|
frm_sys_progress:=nil;
|
|
|
Free;
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_code_UsdExRate.bsSkinButton11Click(Sender: TObject);
|
|
|
var aAdoQuery:TAdoQuery;
|
|
|
s:string;
|
|
|
begin
|
|
|
|
|
|
|
|
|
if t_code_usdexrate.FieldByName('<27><><EFBFBD><EFBFBD>').IsNull then Exit;
|
|
|
|
|
|
s:='<27><>:'+t_code_usdexrate.FieldByName('<27><>ʼ<EFBFBD><CABC><EFBFBD><EFBFBD>').AsString+' <20><>:'+ t_code_usdexrate.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString+' <20>Ļ<EFBFBD><C4BB><EFBFBD> '+'<27><><EFBFBD><EFBFBD>Ϊ'+t_code_usdexrate.FieldByName('<27><><EFBFBD><EFBFBD>').AsString;
|
|
|
if MessageDlg('ȷʵҪ<CAB5><D2AA><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'+s+'Ҫ<><D2AA><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>',mtWarning,[mbyes,mbno],0)<>mryes then
|
|
|
Exit;
|
|
|
if not ASSIGNED(frm_sys_progress) then
|
|
|
frm_sys_progress:=tfrm_sys_progress.Create(self);
|
|
|
|
|
|
frm_sys_progress.bsSkinGauge1.ProgressText:='<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ⱥ<C8BA><F2A1A3A1><EFBFBD>';
|
|
|
frm_sys_progress.Show;
|
|
|
|
|
|
aAdoQuery:=CreateAdoQuery;
|
|
|
with aAdoQuery do
|
|
|
try
|
|
|
Close;SQL.Clear;
|
|
|
sql.Add('Select * from V_op_bscard_All where 1=1 ');
|
|
|
sql.Add('and <20><><EFBFBD><EFBFBD><EFBFBD>ڼ<EFBFBD> between :beginEtd and :endETD');
|
|
|
Parameters.ParamByName('beginEtd').Value:=t_code_usdexrate.FieldByName('<27><>ʼ<EFBFBD><CABC><EFBFBD><EFBFBD>').AsDateTime;
|
|
|
Parameters.ParamByName('endETD').Value:=t_code_usdexrate.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsDateTime;
|
|
|
Open;First;
|
|
|
if not IsEmpty then
|
|
|
begin
|
|
|
frm_sys_progress.bsSkinGauge1.MaxValue:=recordcount;
|
|
|
frm_sys_progress.bsSkinGauge1.MinValue:=0;
|
|
|
frm_sys_progress.bsSkinGauge1.Value:=0;
|
|
|
frm_sys_progress.Update;
|
|
|
while not Eof do
|
|
|
begin
|
|
|
frm_sys_progress.bsSkinGauge1.Value:=frm_sys_progress.bsSkinGauge1.Value+1;
|
|
|
frm_sys_progress.bsSkinGauge1.ProgressText:='<27><><EFBFBD>ᵥ<EFBFBD><E1B5A5>:'+FieldByName('<27><><EFBFBD>ᵥ<EFBFBD><E1B5A5>').Asstring;
|
|
|
Upbsrate(FieldByName('<27><><EFBFBD><EFBFBD>').Asstring,'USD');
|
|
|
Next;
|
|
|
end;
|
|
|
end;
|
|
|
|
|
|
|
|
|
finally
|
|
|
frm_sys_progress.close;
|
|
|
frm_sys_progress:=nil;
|
|
|
Free;
|
|
|
end;
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_code_UsdExRate.Upbsrate(bsno, aCurrency: string);
|
|
|
var aAdoQuery:TAdoQuery;
|
|
|
begin
|
|
|
aAdoQuery:=CreateAdoQuery;
|
|
|
with aAdoQuery do
|
|
|
try
|
|
|
Close;SQL.Clear;
|
|
|
sql.Add('Select * from t_ch_fee');
|
|
|
sql.Add('where <20><><EFBFBD><EFBFBD>=:<3A><><EFBFBD><EFBFBD> and <20>ұ<EFBFBD>=:<3A>ұ<EFBFBD>');
|
|
|
Parameters.ParamByName('<27><><EFBFBD><EFBFBD>').Value:=bsno;
|
|
|
Parameters.ParamByName('<27>ұ<EFBFBD>').Value:=trim(aCurrency);
|
|
|
Open;First;
|
|
|
while not Eof do
|
|
|
begin
|
|
|
Edit;
|
|
|
FieldByName('<27><><EFBFBD><EFBFBD>').Value:=t_code_usdexrate.FieldByName('<27><><EFBFBD><EFBFBD>').Value;
|
|
|
Post;
|
|
|
Next;
|
|
|
end;
|
|
|
|
|
|
finally
|
|
|
Free;
|
|
|
end;
|
|
|
end;
|
|
|
|
|
|
end.
|