unit Unit5;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, TodoList, DBTodoList, ExtCtrls, AdvPanel, RzButton, StdCtrls,
  Mask, DBCtrls, Grids, DBGrids, DB, ADODB, AppEvnts;

type
  TForm5 = class(TForm)
    AdvPanel1: TAdvPanel;
    Label1: TLabel;
    RzToolButton1: TRzToolButton;
    Label2: TLabel;
    RzToolButton2: TRzToolButton;
    RzToolButton4: TRzToolButton;
    DBEdit1: TDBEdit;
    ApplicationEvents1: TApplicationEvents;
    Memo1: TMemo;
    Edit1: TEdit;
    Timer1: TTimer;
    procedure RzToolButton1Click(Sender: TObject);
    procedure AdvPanel1MouseMove(Sender: TObject; Shift: TShiftState; X,
      Y: Integer);
    procedure RzToolButton4Click(Sender: TObject);
    procedure RzToolButton2Click(Sender: TObject);
    procedure Label1MouseMove(Sender: TObject; Shift: TShiftState; X,
      Y: Integer);
    procedure ApplicationEvents1Exception(Sender: TObject; E: Exception);
    procedure FormShow(Sender: TObject);
    procedure Timer1Timer(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form5: TForm5;

implementation

uses Unit3, Unit1, Unit4;

{$R *.dfm}

procedure TForm5.RzToolButton1Click(Sender: TObject);
begin
form5.Close;
end;

procedure TForm5.AdvPanel1MouseMove(Sender: TObject; Shift: TShiftState; X,
  Y: Integer);
begin
releasecapture;
perform(wm_syscommand,$f012,0);
end;

procedure TForm5.RzToolButton4Click(Sender: TObject);
var
  i:integer;
begin
form1.adotable1.First;
For i := 0 to form1.adotable1.RecordCount-1 do
  begin
    if date>strtodate(form3.dbedit8.text) then
    begin
      form1.ADOTable1.Edit;
      dbedit1.text:='TRUE';
      edit1.text:='2';
      form1.ADOTable1.Post;
      end;
    if StrToTime(form3.edit3.text)>strtotime(form3.dbedit7.text) then
    begin
      form1.ADOTable1.Edit;
      dbedit1.text:='TRUE';
      edit1.text:='2';
      form1.ADOTable1.Post;
      end;
      form1.adotable1.Next;
  end;
end;

procedure TForm5.RzToolButton2Click(Sender: TObject);
var
  i:integer;
begin
for i:=0 to form1.ADOTable1.RecordCount-1 do
begin
edit1.text:='1';
form1.ADOTable1.Locate('COMPLETE','TRUE',[]);
form1.ADOTable1.Delete;
end;
end;

procedure TForm5.Label1MouseMove(Sender: TObject; Shift: TShiftState; X,
  Y: Integer);
begin
releasecapture;
perform(wm_syscommand,$f012,0);
end;

procedure TForm5.ApplicationEvents1Exception(Sender: TObject;
  E: Exception);
begin
memo1.Lines.add('Hata : ' + e.ClassName);
Memo1.Lines.Add('Açıklama : ' + e.message);
end;
procedure TForm5.FormShow(Sender: TObject);
begin
edit1.Text:='';
timer1.Enabled:=true;
end;

procedure TForm5.Timer1Timer(Sender: TObject);
begin
if edit1.Text='1' then
begin
timer1.Enabled:=false;
form1.ADOConnection1.Connected:=false;
form1.ADOConnection1.Connected:=true;
form1.ADOTable1.Active:=true;
form3.ADOTable1.Active:=true;
form5.Close;
end;
if edit1.Text='2' then
begin
form1.ADOConnection1.Connected:=false;
form1.ADOConnection1.Connected:=true;
form1.ADOTable1.Active:=true;
form3.ADOTable1.Active:=true;
end;
end;

end.
