|
|
unit u_op_railway_piliangfeemodify;
|
|
|
|
|
|
interface
|
|
|
|
|
|
uses
|
|
|
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
|
|
|
Dialogs, BusinessSkinForm, bsSkinCtrls, StdCtrls, Mask, wwdbedit,
|
|
|
Wwdotdot, Wwdbcomb, wwdbdatetimepicker, RxLookup, wwdblook, ComCtrls,
|
|
|
bsSkinTabs, ExtCtrls;
|
|
|
|
|
|
type
|
|
|
Tfrm_op_railway_piliangfeemodify = class(TForm)
|
|
|
bsBusinessSkinForm1: TbsBusinessSkinForm;
|
|
|
bsSkinButton3: TbsSkinButton;
|
|
|
bsSkinButton2: TbsSkinButton;
|
|
|
bsSkinRadioGroup1: TbsSkinRadioGroup;
|
|
|
Label38: TLabel;
|
|
|
RxDBLookupCombo16: TRxDBLookupCombo;
|
|
|
Label13: TLabel;
|
|
|
RxDBLookupCombo5: TRxDBLookupCombo;
|
|
|
wwDBComboBox13: TwwDBComboBox;
|
|
|
Label1: TLabel;
|
|
|
Edit7: TEdit;
|
|
|
Edit1: TEdit;
|
|
|
Edit2: TEdit;
|
|
|
Label37: TLabel;
|
|
|
RxDBLookupCombo1: TRxDBLookupCombo;
|
|
|
Label2: TLabel;
|
|
|
Label3: TLabel;
|
|
|
Label4: TLabel;
|
|
|
Label5: TLabel;
|
|
|
Edit3: TEdit;
|
|
|
bsSkinBevel1: TbsSkinBevel;
|
|
|
Label6: TLabel;
|
|
|
Edit4: TEdit;
|
|
|
bsSkinBevel2: TbsSkinBevel;
|
|
|
Label8: TLabel;
|
|
|
Edit5: TEdit;
|
|
|
Label9: TLabel;
|
|
|
Edit6: TEdit;
|
|
|
Label10: TLabel;
|
|
|
Edit8: TEdit;
|
|
|
Label11: TLabel;
|
|
|
Edit9: TEdit;
|
|
|
Label12: TLabel;
|
|
|
Edit10: TEdit;
|
|
|
Edit11: TEdit;
|
|
|
Edit12: TEdit;
|
|
|
procedure bsSkinButton2Click(Sender: TObject);
|
|
|
procedure bsSkinButton3Click(Sender: TObject);
|
|
|
procedure Edit7Change(Sender: TObject);
|
|
|
procedure RxDBLookupCombo1Change(Sender: TObject);
|
|
|
procedure Edit5Change(Sender: TObject);
|
|
|
private
|
|
|
{ Private declarations }
|
|
|
public
|
|
|
{ Public declarations }
|
|
|
end;
|
|
|
|
|
|
var
|
|
|
frm_op_railway_piliangfeemodify: Tfrm_op_railway_piliangfeemodify;
|
|
|
|
|
|
implementation
|
|
|
|
|
|
uses u_main, u_data_share, my_sys_function,
|
|
|
u_op_railway_feemodify;
|
|
|
|
|
|
{$R *.dfm}
|
|
|
|
|
|
procedure Tfrm_op_railway_piliangfeemodify.bsSkinButton2Click(
|
|
|
Sender: TObject);
|
|
|
begin
|
|
|
close;
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_op_railway_piliangfeemodify.bsSkinButton3Click(
|
|
|
Sender: TObject);
|
|
|
var
|
|
|
i:integer;
|
|
|
procedure edidataset;
|
|
|
begin
|
|
|
frm_op_railway_feemodify.t_op_railway.edit;
|
|
|
if RxDBLookupCombo16.DisplayValue<>'' then
|
|
|
frm_op_railway_feemodify.t_op_railway['<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>']:=RxDBLookupCombo16.DisplayValues[1];
|
|
|
if Trim(Edit5.text)<>'' then
|
|
|
frm_op_railway_feemodify.t_op_railway['<27><><EFBFBD><EFBFBD>']:=StrToFloatdef(Edit5.Text,0);
|
|
|
|
|
|
if Trim(Edit1.text)<>'' then
|
|
|
frm_op_railway_feemodify.t_op_railway['<27><><EFBFBD><EFBFBD>']:=StrToIntDef(Edit1.Text,0);
|
|
|
if Trim(Edit8.text)<>'' then
|
|
|
frm_op_railway_feemodify.t_op_railway['<27><><EFBFBD><EFBFBD>']:=StrToFloatdef(Edit8.Text,0);
|
|
|
if RxDBLookupCombo1.DisplayValue<>'' then
|
|
|
frm_op_railway_feemodify.t_op_railway['<27>ұ<EFBFBD>']:=RxDBLookupCombo1.DisplayValues[0];
|
|
|
if Trim(Edit3.text)<>'' then
|
|
|
frm_op_railway_feemodify.t_op_railway['<27><><EFBFBD><EFBFBD>']:=StrToFloatdef(Edit3.Text,0);
|
|
|
if Trim(wwDBComboBox13.text)<>'' then
|
|
|
frm_op_railway_feemodify.t_op_railway['<27><>']:=wwDBComboBox13.Text;
|
|
|
|
|
|
if Trim(Edit7.text)<>'' then
|
|
|
frm_op_railway_feemodify.t_op_railway['<27><><EFBFBD><EFBFBD>˰<EFBFBD><CBB0>']:=StrToFloatdef(Edit7.Text,0);
|
|
|
if Trim(Edit6.text)<>'' then
|
|
|
frm_op_railway_feemodify.t_op_railway['˰<><CBB0>']:=StrToFloatdef(Edit6.Text,0);
|
|
|
if Trim(Edit10.text)<>'' then
|
|
|
frm_op_railway_feemodify.t_op_railway['˰<><CBB0>']:=StrToFloatdef(Edit10.Text,0);
|
|
|
if Trim(Edit2.text)<>'' then
|
|
|
frm_op_railway_feemodify.t_op_railway['<27><><EFBFBD><EFBFBD>˰<EFBFBD><CBB0><EFBFBD><EFBFBD>']:=StrToFloatdef(Edit2.Text,0);
|
|
|
if Trim(Edit9.text)<>'' then
|
|
|
frm_op_railway_feemodify.t_op_railway['<27><><EFBFBD><EFBFBD>˰<EFBFBD><CBB0>']:=StrToFloatdef(Edit9.Text,0);
|
|
|
if Trim(Edit11.text)<>'' then
|
|
|
frm_op_railway_feemodify.t_op_railway['<27><><EFBFBD><EFBFBD>˰<EFBFBD><CBB0>']:=StrToFloatdef(Edit11.Text,0);
|
|
|
if Trim(Edit12.text)<>'' then
|
|
|
frm_op_railway_feemodify.t_op_railway['<27><><EFBFBD><EFBFBD>˰<EFBFBD><CBB0>']:=StrToFloatdef(Edit12.Text,0);
|
|
|
|
|
|
|
|
|
|
|
|
if RxDBLookupCombo5.DisplayValue<>'' then
|
|
|
frm_op_railway_feemodify.t_op_railway['<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>']:=RxDBLookupCombo5.DisplayValues[1];
|
|
|
|
|
|
frm_op_railway_feemodify.t_op_railway.Post;
|
|
|
|
|
|
end;
|
|
|
begin
|
|
|
if frm_op_railway_feemodify.t_op_railway.IsEmpty then
|
|
|
exit;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if bsSkinRadioGroup1.ItemIndex=0 then begin
|
|
|
if frm_op_railway_feemodify.dxDBGrid2.SelectedCount<1 then
|
|
|
begin
|
|
|
edidataset;
|
|
|
end else
|
|
|
try
|
|
|
frm_op_railway_feemodify.t_op_railway.DisableControls;
|
|
|
|
|
|
for i:=0 to frm_op_railway_feemodify.dxDBGrid2.SelectedCount-1 do
|
|
|
begin
|
|
|
frm_op_railway_feemodify.t_op_railway.GotoBookmark(pointer(frm_op_railway_feemodify.dxDBGrid2.selectedrows[i]));
|
|
|
if (frm_op_railway_feemodify.t_op_railway.FieldByName('<27><><EFBFBD><EFBFBD>״̬').AsString='<27><><EFBFBD><EFBFBD>ͨ<EFBFBD><CDA8>') or (frm_op_railway_feemodify.t_op_railway.FieldByName('<27><><EFBFBD><EFBFBD>״̬').AsString='<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>')
|
|
|
or (frm_op_railway_feemodify.t_op_railway.FieldByName('<27><><EFBFBD><EFBFBD>״̬').AsString='<27><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>') then begin
|
|
|
ShowMessage('<27><><EFBFBD>ţ<EFBFBD>'+frm_op_railway_feemodify.t_op_railway.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring+',<2C><><EFBFBD><EFBFBD><EFBFBD>˻<EFBFBD><CBBB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>!');
|
|
|
end else edidataset;
|
|
|
|
|
|
end;
|
|
|
finally
|
|
|
frm_op_railway_feemodify.t_op_railway.EnableControls;
|
|
|
end;
|
|
|
end else if bsSkinRadioGroup1.itemindex=1 then begin
|
|
|
frm_op_railway_feemodify.t_op_railway.First;
|
|
|
if (frm_op_railway_feemodify.t_op_railway.FieldByName('<27><><EFBFBD><EFBFBD>״̬').AsString='<27><><EFBFBD><EFBFBD>ͨ<EFBFBD><CDA8>') or (frm_op_railway_feemodify.t_op_railway.FieldByName('<27><><EFBFBD><EFBFBD>״̬').AsString='<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>')
|
|
|
or (frm_op_railway_feemodify.t_op_railway.FieldByName('<27><><EFBFBD><EFBFBD>״̬').AsString='<27><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>') then begin
|
|
|
ShowMessage('<27><><EFBFBD>ţ<EFBFBD>'+frm_op_railway_feemodify.t_op_railway.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring+',<2C><><EFBFBD><EFBFBD><EFBFBD>˻<EFBFBD><CBBB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>!');
|
|
|
end else edidataset;
|
|
|
frm_op_railway_feemodify.t_op_railway.next;
|
|
|
end;
|
|
|
ShowMessage('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><DEB8><EFBFBD><EFBFBD>ɣ<EFBFBD>');
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_op_railway_piliangfeemodify.Edit7Change(Sender: TObject);
|
|
|
begin
|
|
|
if (StrToFloatDef(Trim(Edit7.Text),0)<>0) and (StrToFloatDef(Trim(Edit1.Text),0)<>0) then begin
|
|
|
Edit2.Text:=FormatFloat('0.00;-0.00;0.0',StrToFloatDef(Trim(Edit7.Text),0)*StrToFloatDef(Trim(Edit1.Text),0));
|
|
|
if (StrToFloatDef(Trim(Edit6.Text),0)<>0) then begin
|
|
|
Edit5.Text:=FormatFloat('0.00;-0.00;0.0',StrToFloatDef(Trim(Edit7.Text),0)*(1+StrToFloatDef(Trim(Edit6.Text),0)/100));
|
|
|
Edit8.Text:=FormatFloat('0.00;-0.00;0.0',StrToFloatDef(Trim(Edit5.Text),0)*StrToFloatDef(Trim(Edit1.Text),0));
|
|
|
Edit10.Text:=FormatFloat('0.00;-0.00;0.0',StrToFloatDef(Trim(Edit8.Text),0)-StrToFloatDef(Trim(Edit2.Text),0));
|
|
|
if (StrToFloatDef(Trim(Edit9.Text),0)<>0) then begin
|
|
|
Edit11.Text:=FormatFloat('0.00;-0.00;0.0',StrToFloatDef(Trim(Edit8.Text),0)/(1+(StrToFloatDef(Trim(Edit9.Text),0)/100))*(StrToFloatDef(Trim(Edit9.Text),0)/100));
|
|
|
Edit12.Text:=FormatFloat('0.00;-0.00;0.0',StrToFloatDef(Trim(Edit8.Text),0)-StrToFloatDef(Trim(Edit11.Text),0));
|
|
|
|
|
|
end;
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
end;
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_op_railway_piliangfeemodify.RxDBLookupCombo1Change(
|
|
|
Sender: TObject);
|
|
|
begin
|
|
|
if RxDBLookupCombo1.DisplayValues[0]<>'' then begin
|
|
|
IF frm_data_share.t_code_currency.Locate('<27>ұ<EFBFBD>',RxDBLookupCombo1.DisplayValues[0],[])THEN
|
|
|
begin
|
|
|
if RxDBLookupCombo1.DisplayValues[0]='USD' then begin
|
|
|
Edit3.Text:=FloatToStr(getUsdExRate(DateToStr(Date)));
|
|
|
end else
|
|
|
Edit3.Text:=FloatToStr(frm_data_share.t_code_currency.fieldbyname('<27><><EFBFBD><EFBFBD>').asfloat);
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_op_railway_piliangfeemodify.Edit5Change(Sender: TObject);
|
|
|
begin
|
|
|
if (StrToFloatDef(Trim(Edit5.Text),0)<>0) and (StrToFloatDef(Trim(Edit1.Text),0)<>0) then begin
|
|
|
Edit8.Text:=FormatFloat('0.00;-0.00;0.0',StrToFloatDef(Trim(Edit5.Text),0)*StrToFloatDef(Trim(Edit1.Text),0));
|
|
|
// if (StrToFloatDef(Trim(Edit6.Text),0)<>0) then begin
|
|
|
// end;
|
|
|
Edit7.Text:=FormatFloat('0.00;-0.00;0.0',StrToFloatDef(Trim(Edit5.Text),0)/(1+(StrToFloatDef(Trim(Edit6.Text),0)/100)));
|
|
|
Edit2.Text:=FormatFloat('0.00;-0.00;0.0',StrToFloatDef(Trim(Edit7.Text),0)*StrToFloatDef(Trim(Edit1.Text),0));
|
|
|
Edit10.Text:=FormatFloat('0.00;-0.00;0.0',StrToFloatDef(Trim(Edit8.Text),0)-StrToFloatDef(Trim(Edit2.Text),0));
|
|
|
|
|
|
if (StrToFloatDef(Trim(Edit9.Text),0)<>0) then begin
|
|
|
Edit11.Text:=FormatFloat('0.00;-0.00;0.0',StrToFloatDef(Trim(Edit8.Text),0)/(1+(StrToFloatDef(Trim(Edit9.Text),0)/100))*(StrToFloatDef(Trim(Edit9.Text),0)/100));
|
|
|
Edit12.Text:=FormatFloat('0.00;-0.00;0.0',StrToFloatDef(Trim(Edit8.Text),0)-StrToFloatDef(Trim(Edit11.Text),0));
|
|
|
|
|
|
end;
|
|
|
end;
|
|
|
end;
|
|
|
|
|
|
end.
|