unit UJustificativa;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, DB, StdCtrls, DBCtrls, Grids, DBGrids, ComCtrls, ExtCtrls,
  Buttons;

type
  TFJustificativa = class(TForm)
    Panel1: TPanel;
    Data1: TDateTimePicker;
    Data2: TDateTimePicker;
    Label1: TLabel;
    Label2: TLabel;
    DBGrid1: TDBGrid;
    Panel2: TPanel;
    DBMemo1: TDBMemo;
    Label3: TLabel;
    DSExclusoes: TDataSource;
    Button1: TSpeedButton;
    Button2: TSpeedButton;
    procedure FormCreate(Sender: TObject);
    procedure FormClose(Sender: TObject; var Action: TCloseAction);
    procedure Button1Click(Sender: TObject);
    procedure Button2Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  FJustificativa: TFJustificativa;

implementation
uses
  UDataModulo;

{$R *.dfm}

procedure TFJustificativa.FormCreate(Sender: TObject);
begin
  Modulo.TbExclusoes.Open;
  Data1.Date:=Date;
  Data2.Date:=Date;
end;

procedure TFJustificativa.FormClose(Sender: TObject;
  var Action: TCloseAction);
begin
  FJustificativa.Close;
end;

procedure TFJustificativa.Button1Click(Sender: TObject);
begin
  Modulo.TbExclusoes.Filtered:=False;
  Modulo.TbExclusoes.Filter:= 'DataExclusao >='''+DateToStr(Data1.Date)+
                              ''' and DataExclusao <='''+DateToStr(Data2.Date)+'''';
  Modulo.TbExclusoes.Filtered:=True;
end;

procedure TFJustificativa.Button2Click(Sender: TObject);
begin
  Modulo.TbExclusoes.Filtered:=False;
end;

end.
