unit Unit2;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls, ZamknijSystem;

type
  TForm1 = class(TForm)
    Label1: TLabel;
    Edit1: TEdit;
    Label2: TLabel;
    ComboBox1: TComboBox;
    Label3: TLabel;
    Edit2: TEdit;
    CheckBox1: TCheckBox;
    CheckBox2: TCheckBox;
    Button1: TButton;
    Button2: TButton;
    procedure Button2Click(Sender: TObject);
    procedure Button1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}

procedure TForm1.Button1Click(Sender: TObject);
  var IloscSekund :Integer;
begin
  IloscSekund:=0;
  case (ComboBox1.ItemIndex) of
    0: IloscSekund:=0;
    1: IloscSekund:=5;
    2: IloscSekund:=15;
    3: IloscSekund:=30;
    4: IloscSekund:=60;
    5: IloscSekund:=900;
    6: IloscSekund:=3600;
    7: IloscSekund:=86400;
    8: IloscSekund:=604800;
    else
    begin
      ShowMessage('Wybierz opóźnienie');
      Exit;
    end;
  end;

    ZamknijSystem2(
      true,
      Edit1.Text,
      Edit2.Text,
      IloscSekund,
      CheckBox1.Checked,
      CheckBox2.Checked);
end;

procedure TForm1.Button2Click(Sender: TObject);
begin
    //istotny jest tylko pierwszy i drugi argument
    ZamknijSystem2(false,Edit1.Text,'',0,false,false);
end;

end.
