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
208 lines
7.0 KiB
Plaintext
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['񅧏']:=frm_op_railwayctn_shencode.t_ch_fee.DataSource.DataSet['񅧏'];
|
|
frm_op_railwayctn_shencode.t_ch_fee['ÀàÐÍ']:=wwDBComboBox31.Text;
|
|
frm_op_railwayctn_shencode.t_ch_fee['·ÑÓÃ״̬']:='¼Èë״̬';
|
|
frm_op_railwayctn_shencode.t_ch_fee['¼ÈëÈË']:=employee;
|
|
frm_op_railwayctn_shencode.t_ch_fee['½áËã½ð¶î']:=0;
|
|
frm_op_railwayctn_shencode.t_ch_fee['·ÑÓÃÃû³Æ']:=RxDBLookupCombo16.DisplayValues[1];
|
|
frm_op_railwayctn_shencode.t_ch_fee['µ¥¼Û']:=StrToFloatdef(Edit7.Text,0);
|
|
frm_op_railwayctn_shencode.t_ch_fee['ÊýÁ¿']:=StrToIntDef(Edit1.Text,0);;
|
|
frm_op_railwayctn_shencode.t_ch_fee['½ð¶î']:=StrToFloatdef(Edit2.Text,0);
|
|
frm_op_railwayctn_shencode.t_ch_fee['±Ò±ð']:=RxDBLookupCombo1.DisplayValues[0];
|
|
frm_op_railwayctn_shencode.t_ch_fee['»ãÂÊ']:=StrToFloatdef(Edit3.Text,0);
|
|
frm_op_railwayctn_shencode.t_ch_fee['±ê×¼']:=wwDBComboBox13.Text;
|
|
frm_op_railwayctn_shencode.t_ch_fee['¿ªÆ±½ð¶î']:=0;
|
|
frm_op_railwayctn_shencode.t_ch_fee['³åµÖ½ð¶î']:=0;
|
|
frm_op_railwayctn_shencode.t_ch_fee['ÉêÇë½ð¶î']:=0;
|
|
frm_op_railwayctn_shencode.t_ch_fee['ÉêÇ뿪Ʊ']:=0;
|
|
frm_op_railwayctn_shencode.t_ch_fee['¼ÈëÈÕÆÚ']:=now;
|
|
frm_op_railwayctn_shencode.t_ch_fee['ÊÇ·ñ¶ÔÕÊ']:=0;
|
|
frm_op_railwayctn_shencode.t_ch_fee['ÊÇ·ñµæ¸¶']:=0;
|
|
frm_op_railwayctn_shencode.t_ch_fee['²»¿ª·¢Æ±']:=0;
|
|
if wwDBComboBox1.Text<>'' then
|
|
frm_op_railwayctn_shencode.t_ch_fee['½áË㵥λ']:=wwDBComboBox1.Text;
|
|
frm_op_railwayctn_shencode.t_ch_fee['˳Ðò']:=1;
|
|
frm_op_railwayctn_shencode.t_ch_fee['»úÃÜ']:=0;
|
|
if RxDBLookupCombo5.DisplayValue<>'' then
|
|
frm_op_railwayctn_shencode.t_ch_fee['¿Í»§Ãû³Æ']:=RxDBLookupCombo5.DisplayValues[1]
|
|
else
|
|
frm_op_railwayctn_shencode.t_ch_fee['¿Í»§Ãû³Æ']:=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('ÊÕ¸¶Àà±ð²»ÄÜΪ¿Õ£¡');
|
|
exit;
|
|
end;
|
|
if RxDBLookupCombo16.DisplayValue='' then begin
|
|
ShowMessage('·ÑÓÃÃû³Æ²»ÄÜΪ¿Õ£¡');
|
|
exit;
|
|
end;
|
|
if (wwDBComboBox1.Text='') and (RxDBLookupCombo5.DisplayValue='') then begin
|
|
ShowMessage('½áË㵥λºÍ¿Í»§Ãû³Æ²»ÄÜͬʱΪ¿Õ£¡');
|
|
exit;
|
|
end;
|
|
if wwDBComboBox13.Text='' then begin
|
|
ShowMessage('·ÑÓñê×¼²»ÄÜΪ¿Õ£¡');
|
|
exit;
|
|
end;
|
|
if Edit7.Text='' then begin
|
|
ShowMessage('·ÑÓõ¥¼Û²»ÄÜΪ¿Õ£¡');
|
|
exit;
|
|
end;
|
|
if Edit1.Text='' then begin
|
|
ShowMessage('·ÑÓÃÊýÁ¿²»ÄÜΪ¿Õ£¡');
|
|
exit;
|
|
end;
|
|
if Edit2.Text='' then begin
|
|
ShowMessage('·ÑÓýð¶î²»ÄÜΪ¿Õ£¡');
|
|
exit;
|
|
end;
|
|
if Edit3.Text='' then begin
|
|
ShowMessage('·ÑÓûãÂʲ»ÄÜΪ¿Õ£¡');
|
|
exit;
|
|
end;
|
|
if RxDBLookupCombo1.DisplayValue='' then begin
|
|
ShowMessage('·ÑÓñұð²»ÄÜΪ¿Õ£¡');
|
|
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('·ÑÓÃ״̬').AsString='·ÑÓ÷âÕÊ' then begin
|
|
ShowMessage('ÏäºÅ£º'+frm_op_railwayctn_shencode.t_op_railway.fieldbyname('ÏäºÅ').asstring+',ÒѲÆÎñ·âÕÊ,²»ÔÊÐíÌí¼Ó·ÑÓÃ!');
|
|
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('·ÑÓÃ״̬').AsString='·ÑÓ÷âÕÊ' then begin
|
|
ShowMessage('ÏäºÅ£º'+frm_op_railwayctn_shencode.t_op_railway.fieldbyname('ÏäºÅ').asstring+',ÒѲÆÎñ·âÕÊ,²»ÔÊÐíÌí¼Ó·ÑÓÃ!');
|
|
end else edidataset;
|
|
frm_op_railwayctn_shencode.t_op_railway.next;
|
|
end;
|
|
end;
|
|
ShowMessage('·ÑÓÃÌí¼ÓÍê³É£¡');
|
|
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('±Ò±ð',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('»ãÂÊ').asfloat);
|
|
end;
|
|
|
|
end;
|
|
end;
|
|
|
|
end.
|