unit FormEan;

interface

uses
  Classes, SysUtils, Forms, Controls, Graphics, Dialogs, StdCtrls, Ean, FormEx;

type

  { TFormEan }

  TFormEan = class(TFormEx)
    ButtonOk: TButton;
    ButtonCancel: TButton;
    EditTariff: TEdit;
    EditPriceLow: TEdit;
    EditEan: TEdit;
    EditOwner: TEdit;
    EditAddress: TEdit;
    EditPriceHigh: TEdit;
    EditPriceSpot: TEdit;
    Label1: TLabel;
    Label2: TLabel;
    Label3: TLabel;
    Label4: TLabel;
    Label5: TLabel;
    Label6: TLabel;
    Label7: TLabel;
    ScrollBox1: TScrollBox;
  public
    procedure LoadData(Ean: TEan);
    procedure SaveData(Ean: TEan);
  end;


implementation

{$R *.lfm}

{ TFormEan }

procedure TFormEan.LoadData(Ean: TEan);
begin
  EditEan.Text := Ean.Number;
  EditOwner.Text := Ean.Owner;
  EditAddress.Text := Ean.Address;
  EditPriceLow.Text := FloatToStr(Ean.PriceLow);
  EditPriceHigh.Text := FloatToStr(Ean.PriceHigh);
  EditPriceSpot.Text := FloatToStr(Ean.PriceSpot);
  EditTariff.Text := Ean.DistributionTariff;
end;

procedure TFormEan.SaveData(Ean: TEan);
begin
  Ean.Number := EditEan.Text;
  Ean.Owner := EditOwner.Text;
  Ean.Address := EditAddress.Text;
  Ean.PriceLow := StrToFloat(EditPriceLow.Text);
  Ean.PriceHigh := StrToFloat(EditPriceHigh.Text);
  Ean.PriceSpot := StrToFloat(EditPriceSpot.Text);
  Ean.DistributionTariff := EditTariff.Text;
end;

end.

