⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 u_resto_valuta.pas

📁 大型企业管理源码,JAVA类,包括销售,采购,财务,OA辅助办公处理,有学习JAVA的朋友,将是不错的参考资料!
💻 PAS
字号:
unit u_resto_valuta;

interface

uses
  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  StdCtrls, ExtCtrls, Mask, ActnList, Db, RxMemDS, DBCtrls;

type
  TResto_Valuta = class(TForm)
    GroupBox1: TGroupBox;
    GroupBox2: TGroupBox;
    Label1: TLabel;
    Label2: TLabel;
    Label4: TLabel;
    Panel1: TPanel;
    Button1: TButton;
    ActionList1: TActionList;
    Chiudi: TAction;
    Tabella: TRxMemoryData;
    TabellaContantiL: TCurrencyField;
    TabellaContantiE: TCurrencyField;
    TabellaRestoL: TCurrencyField;
    TabellaRestoE: TCurrencyField;
    DBEdit1: TDBEdit;
    DBEdit2: TDBEdit;
    DBEdit4: TDBEdit;
    DsTabella: TDataSource;
    TabellaTotaleL: TCurrencyField;
    TabellaTotaleE: TCurrencyField;
    GroupBox3: TGroupBox;
    Label5: TLabel;
    Label6: TLabel;
    DBText1: TDBText;
    DBText2: TDBText;
    procedure FormClose(Sender: TObject; var Action: TCloseAction);
    procedure ChiudiExecute(Sender: TObject);
    procedure TabellaContantiLChange(Sender: TField);
    procedure TabellaContantiEChange(Sender: TField);
    procedure FormCreate(Sender: TObject);
    procedure FormShow(Sender: TObject);
  private
    { Private declarations }
  public
    function Round2(Importo: currency): currency;
    { Public declarations }
  end;

var
  Resto_Valuta: TResto_Valuta;
  libero: boolean;

implementation

uses main;

{$R *.DFM}

procedure TResto_Valuta.FormClose(Sender: TObject;
  var Action: TCloseAction);
begin
     Tabella.Close ;
     Tabella.Free ;
     release ;
end;

procedure TResto_Valuta.ChiudiExecute(Sender: TObject);
begin
     close ;
end;

procedure TResto_Valuta.TabellaContantiLChange(Sender: TField);
begin
  if libero then
    begin
       libero := false ;
       TabellaContantiE.AsCurrency := Round2((TabellaContantiL.asCurrency / 1926.27) * 100)/100 ; 
       TabellaRestoE.AsCurrency := TabellaContantiE.AsCurrency -  TabellaTotaleE.AsCurrency ;
       libero := True ;
    end ;
end;

procedure TResto_Valuta.TabellaContantiEChange(Sender: TField);
begin
   if libero then
    begin
       libero := false ;
       TabellaContantiL.AsCurrency := Round2(TabellaContantiE.AsCurrency * 1936.27) ;
       (*
       TabellaRestoE.AsCurrency := TabellaTotaleE.AsCurrency - (TabellaContantiE.AsCurrency + (TabellaContantiL.AsCurrency / 1936.27)) ;
       TabellaRestoE.AsCurrency := TabellaRestoE.AsCurrency * (-1) ;
       *)
       TabellaRestoE.AsCurrency := TabellaContantiE.AsCurrency - TabellaTotaleE.AsCurrency ;
       libero := True ;
    end ;
end;

procedure TResto_Valuta.FormCreate(Sender: TObject);
begin
     libero := true ;
end;

function TResto_Valuta.Round2(Importo: currency): currency;
Var
   v : real ;
begin
 if importo > 0 then v := 0.5 else v := -0.5 ;
 importo := importo + v ;
 result := Int(importo) ;
end;

procedure TResto_Valuta.FormShow(Sender: TObject);
begin
     If Main_form.TTconfigValutastandard.AsString = 'L' then
      begin
       DBEdit1.SetFocus ;
       DbEdit1.SelectAll ;
      end
     else
      begin
       DBEdit2.SetFocus ;
       DbEdit2.SelectAll ;
      end;
end;

end.

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -