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.

208 lines
7.0 KiB
Plaintext

11 months ago
unit u_op_railway_sw_piliangfee;
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_sw_piliangfee = class(TForm)
bsBusinessSkinForm1: TbsBusinessSkinForm;
bsSkinButton3: TbsSkinButton;
bsSkinButton2: TbsSkinButton;
bsSkinRadioGroup1: TbsSkinRadioGroup;
Label38: TLabel;
RxDBLookupCombo16: TRxDBLookupCombo;
Label25: TLabel;
wwDBComboBox31: TwwDBComboBox;
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;
Label7: TLabel;
wwDBComboBox1: TwwDBComboBox;
procedure bsSkinButton2Click(Sender: TObject);
procedure bsSkinButton3Click(Sender: TObject);
procedure FormShow(Sender: TObject);
procedure Edit7Change(Sender: TObject);
procedure RxDBLookupCombo1Change(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
frm_op_railway_sw_piliangfee: Tfrm_op_railway_sw_piliangfee;
implementation
uses u_main, u_data_share, my_sys_function,
u_op_railway_shencode;
{$R *.dfm}
procedure Tfrm_op_railway_sw_piliangfee.bsSkinButton2Click(
Sender: TObject);
begin
close;
end;
procedure Tfrm_op_railway_sw_piliangfee.bsSkinButton3Click(
Sender: TObject);
var
i:integer;
procedure edidataset;
begin
frm_op_railwayctn_shencode.t_ch_fee.Insert;
frm_op_railwayctn_shencode.t_ch_fee['<27><><EFBFBD><EFBFBD>']:=frm_op_railwayctn_shencode.t_ch_fee.DataSource.DataSet['<27><><EFBFBD><EFBFBD>'];
frm_op_railwayctn_shencode.t_ch_fee['<27><><EFBFBD><EFBFBD>']:=wwDBComboBox31.Text;
frm_op_railwayctn_shencode.t_ch_fee['<27><><EFBFBD><EFBFBD>״̬']:='¼<><C2BC>״̬';
frm_op_railwayctn_shencode.t_ch_fee['¼<><C2BC><EFBFBD><EFBFBD>']:=employee;
frm_op_railwayctn_shencode.t_ch_fee['<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>']:=0;
frm_op_railwayctn_shencode.t_ch_fee['<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>']:=RxDBLookupCombo16.DisplayValues[1];
frm_op_railwayctn_shencode.t_ch_fee['<27><><EFBFBD><EFBFBD>']:=StrToFloatdef(Edit7.Text,0);
frm_op_railwayctn_shencode.t_ch_fee['<27><><EFBFBD><EFBFBD>']:=StrToIntDef(Edit1.Text,0);;
frm_op_railwayctn_shencode.t_ch_fee['<27><><EFBFBD><EFBFBD>']:=StrToFloatdef(Edit2.Text,0);
frm_op_railwayctn_shencode.t_ch_fee['<27>ұ<EFBFBD>']:=RxDBLookupCombo1.DisplayValues[0];
frm_op_railwayctn_shencode.t_ch_fee['<27><><EFBFBD><EFBFBD>']:=StrToFloatdef(Edit3.Text,0);
frm_op_railwayctn_shencode.t_ch_fee['<27><>׼']:=wwDBComboBox13.Text;
frm_op_railwayctn_shencode.t_ch_fee['<27><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>']:=0;
frm_op_railwayctn_shencode.t_ch_fee['<27><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>']:=0;
frm_op_railwayctn_shencode.t_ch_fee['<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>']:=0;
frm_op_railwayctn_shencode.t_ch_fee['<27><><EFBFBD>뿪Ʊ']:=0;
frm_op_railwayctn_shencode.t_ch_fee['¼<><C2BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD>']:=now;
frm_op_railwayctn_shencode.t_ch_fee['<27>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD>']:=0;
frm_op_railwayctn_shencode.t_ch_fee['<27>Ƿ<EFBFBD><C7B7>渶']:=0;
frm_op_railwayctn_shencode.t_ch_fee['<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ʊ']:=0;
if wwDBComboBox1.Text<>'' then
frm_op_railwayctn_shencode.t_ch_fee['<27><><EFBFBD>㵥λ']:=wwDBComboBox1.Text;
frm_op_railwayctn_shencode.t_ch_fee['˳<><CBB3>']:=1;
frm_op_railwayctn_shencode.t_ch_fee['<27><><EFBFBD><EFBFBD>']:=0;
if RxDBLookupCombo5.DisplayValue<>'' then
frm_op_railwayctn_shencode.t_ch_fee['<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>']:=RxDBLookupCombo5.DisplayValues[1]
else
frm_op_railwayctn_shencode.t_ch_fee['<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>']:=frm_op_railwayctn_shencode.t_op_railway.fieldbyname(wwDBComboBox1.Text).AsString;
frm_op_railwayctn_shencode.t_ch_fee.Post;
end;
begin
if frm_op_railwayctn_shencode.t_op_railway.IsEmpty then
exit;
if wwDBComboBox31.Text='' then begin
ShowMessage('<27>ո<EFBFBD><D5B8><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD>գ<EFBFBD>');
exit;
end;
if RxDBLookupCombo16.DisplayValue='' then begin
ShowMessage('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ʋ<EFBFBD><C6B2><EFBFBD>Ϊ<EFBFBD>գ<EFBFBD>');
exit;
end;
if (wwDBComboBox1.Text='') and (RxDBLookupCombo5.DisplayValue='') then begin
ShowMessage('<27><><EFBFBD>㵥λ<E3B5A5>Ϳͻ<CDBF><CDBB><EFBFBD><EFBFBD>Ʋ<EFBFBD><C6B2><EFBFBD>ͬʱΪ<CAB1>գ<EFBFBD>');
exit;
end;
if wwDBComboBox13.Text='' then begin
ShowMessage('<27><><EFBFBD>ñ<EFBFBD>׼<EFBFBD><D7BC><EFBFBD><EFBFBD>Ϊ<EFBFBD>գ<EFBFBD>');
exit;
end;
if Edit7.Text='' then begin
ShowMessage('<27><><EFBFBD>õ<EFBFBD><C3B5>۲<EFBFBD><DBB2><EFBFBD>Ϊ<EFBFBD>գ<EFBFBD>');
exit;
end;
if Edit1.Text='' then begin
ShowMessage('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD>գ<EFBFBD>');
exit;
end;
if Edit2.Text='' then begin
ShowMessage('<27><><EFBFBD>ý<EFBFBD><C3BD><EFBFBD><EEB2BB>Ϊ<EFBFBD>գ<EFBFBD>');
exit;
end;
if Edit3.Text='' then begin
ShowMessage('<27><><EFBFBD>û<EFBFBD><C3BB>ʲ<EFBFBD><CAB2><EFBFBD>Ϊ<EFBFBD>գ<EFBFBD>');
exit;
end;
if RxDBLookupCombo1.DisplayValue='' then begin
ShowMessage('<27><><EFBFBD>ñұ<C3B1><D2B1><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD>գ<EFBFBD>');
exit;
end;
frm_op_railwayctn_shencode.t_ch_fee.close;
frm_op_railwayctn_shencode.t_ch_fee.DataSource:=frm_op_railwayctn_shencode.t_op_railway1;
frm_op_railwayctn_shencode.t_ch_fee.open;
if bsSkinRadioGroup1.ItemIndex=0 then begin
if frm_op_railwayctn_shencode.dxDBGrid2.SelectedCount<1 then
begin
edidataset;
end else
try
frm_op_railwayctn_shencode.t_op_railway.DisableControls;
for i:=0 to frm_op_railwayctn_shencode.dxDBGrid2.SelectedCount-1 do
begin
frm_op_railwayctn_shencode.t_op_railway.GotoBookmark(pointer(frm_op_railwayctn_shencode.dxDBGrid2.selectedrows[i]));
if frm_op_railwayctn_shencode.t_op_railway.FieldByName('<27><><EFBFBD><EFBFBD>״̬').AsString='<27><><EFBFBD>÷<EFBFBD><C3B7><EFBFBD>' then begin
ShowMessage('<27><><EFBFBD>ţ<EFBFBD>'+frm_op_railwayctn_shencode.t_op_railway.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring+',<2C>Ѳ<EFBFBD><D1B2><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ӷ<EFBFBD><D3B7><EFBFBD>!');
end else edidataset;
end;
finally
frm_op_railwayctn_shencode.t_op_railway.EnableControls;
end;
end else if bsSkinRadioGroup1.itemindex=1 then begin
frm_op_railwayctn_shencode.t_op_railway.First;
while not frm_op_railwayctn_shencode.t_op_railway.Eof do begin
if frm_op_railwayctn_shencode.t_op_railway.FieldByName('<27><><EFBFBD><EFBFBD>״̬').AsString='<27><><EFBFBD>÷<EFBFBD><C3B7><EFBFBD>' then begin
ShowMessage('<27><><EFBFBD>ţ<EFBFBD>'+frm_op_railwayctn_shencode.t_op_railway.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring+',<2C>Ѳ<EFBFBD><D1B2><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ӷ<EFBFBD><D3B7><EFBFBD>!');
end else edidataset;
frm_op_railwayctn_shencode.t_op_railway.next;
end;
end;
ShowMessage('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɣ<EFBFBD>');
end;
procedure Tfrm_op_railway_sw_piliangfee.FormShow(Sender: TObject);
begin
RxDBLookupCombo1.Value:='RMB';
end;
procedure Tfrm_op_railway_sw_piliangfee.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));
end;
end;
procedure Tfrm_op_railway_sw_piliangfee.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;
end.