unit ImportExcelHintFrm;

interface

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

type
  TImportExcelHintForm = class(TForm)
    lblHint: TLabel;
    cbWithoutGclBills: TCheckBox;
    btnOk: TButton;
    btnCancel: TButton;
    cbWithoutLevelCode: TCheckBox;
    procedure cbWithoutLevelCodeClick(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

function HintAndImportTypeSelect(var AWithLevelCode, AWithoutGclBills: Boolean): Boolean;

implementation

function HintAndImportTypeSelect(var AWithLevelCode, AWithoutGclBills: Boolean): Boolean;
var
  HintForm: TImportExcelHintForm;
begin
  HintForm := TImportExcelHintForm.Create(nil);
  try
    if HintForm.ShowModal = mrOk then
    begin
      Result := True;
      AWithLevelCode := not HintForm.cbWithoutLevelCode.Checked;
      AWithoutGclBills := HintForm.cbWithoutGclBills.Checked;
    end;
  finally
    HintForm.Free;
  end;
end;

{$R *.dfm}

procedure TImportExcelHintForm.cbWithoutLevelCodeClick(Sender: TObject);
begin
  cbWithoutGclBills.Enabled := cbWithoutLevelCode.Checked;
  if not cbWithoutLevelCode.Checked then
    cbWithoutGclBills.Checked := False;
end;

end.
