Разработка программной системы «Автоматизированная записная книжка», страница 12

Form6.Show;

Edit4.Visible:=true;

ComboBox1.Visible:=false;

BitBtn3.Visible:=false;end;

procedure TForm3.BitBtn1Click(Sender: TObject);

begin

q:=q-1;

Edit1.Clear;

Edit2.Clear;

Edit3.Clear;

Memo1.Clear;

Edit4.Clear;

Edit5.Clear;

DataModule1.ADOQuery1.Close;

DataModule1.ADOQuery1.SQL.Clear;

DataModule1.ADOQuery1.SQL.Add('select ID_cont, FIO, tel, e_mail,Adress, Gruppa from Contact where ID_cont='+inttostr(q)+'');

DataModule1.ADOQuery1.Open;


q:=DataModule1.ADOQuery1.Fields[0].AsInteger;

Edit5.Text:=inttostr(q);

Edit1.Text:=DataModule1.ADOQuery1.Fields[1].AsString;

Edit2.Text:=DataModule1.ADOQuery1.Fields[2].AsString;

Edit3.Text:=DataModule1.ADOQuery1.Fields[3].AsString;

Memo1.Text:=DataModule1.ADOQuery1.Fields[4].AsString;

Edit4.Text:=DataModule1.ADOQuery1.Fields[5].AsString;

BitBtn1.Enabled:=true;

BitBtn2.Enabled:=true;

Edit4.Visible:=true;

ComboBox1.Visible:=false;

BitBtn3.Visible:=false;

if q=0 then

begin

BitBtn1.Enabled:=false;

BitBtn2.Enabled:=true; end;

if q=w then

begin

BitBtn1.Enabled:=true;

BitBtn2.Enabled:=false; end; end;

procedure TForm3.BitBtn2Click(Sender: TObject);

var l:integer;

begin

q:=q+1;

Edit1.Clear;

Edit2.Clear;

Edit3.Clear;

Memo1.Clear;

DataModule1.ADOQuery1.Close;

DataModule1.ADOQuery1.SQL.Clear;

DataModule1.ADOQuery1.SQL.Add('select ID_cont, FIO, tel, e_mail, Adress, Gruppa from Contact  where ID_cont='+inttostr(q)+'');

DataModule1.ADOQuery1.Open;

q:=DataModule1.ADOQuery1.Fields[0].AsInteger;

Edit5.Text:=inttostr(q);

Edit1.Text:=DataModule1.ADOQuery1.Fields[1].AsString;

Edit2.Text:=DataModule1.ADOQuery1.Fields[2].AsString;

Edit3.Text:=DataModule1.ADOQuery1.Fields[3].AsString;

Memo1.Text:=DataModule1.ADOQuery1.Fields[4].AsString;

Edit4.Text:=DataModule1.ADOQuery1.Fields[5].AsString;

BitBtn1.Enabled:=true;

BitBtn2.Enabled:=true;

Edit4.Visible:=true;

ComboBox1.Visible:=false;

BitBtn3.Visible:=false;

if q=0 then

begin

BitBtn1.Enabled:=false;

BitBtn2.Enabled:=true;

end;

if q=w then


begin

BitBtn1.Enabled:=true;

BitBtn2.Enabled:=false;

end; end;

procedure TForm3.BitBtn8Click(Sender: TObject);

begin

Edit4.Visible:=false;

Label6.Visible:=false;

Edit5.Visible:=false;

GradientRect (clBlue, clBlack, Canvas);

Edit1.Clear;

Edit2.Clear;

Edit3.Clear;

Edit5.Clear;

Memo1.Clear;

Form3.Refresh;

BitBtn3.Visible:=true;

BitBtn10.Visible:=true;

ComboBox1.Visible:=true;

Label1.Visible:=true;Label2.Visible:=true;

Label3.Visible:=true;

Label4.Visible:=true;

Label5.Visible:=true;

end;

procedure TForm3.FormCreate(Sender: TObject);

var

l: DWORD;

begin

l := GetWindowLong(Self.Handle, GWL_STYLE);

l := l and not (WS_MINIMIZEBOX);

l := l and not (WS_MAXIMIZEBOX);

l := SetWindowLong(Self.Handle, GWL_STYLE, l);

end;

procedure TForm3.BitBtn7Click(Sender: TObject);

begin

Label6.Visible:=false;

Edit5.Visible:=false;

GradientRect (clBlue, clBlack, Canvas);

Form3.Refresh;

BitBtn9.Visible:=true;

BitBtn10.Visible:=true;

ComboBox1.Visible:=true;

Label1.Visible:=true;

Label2.Visible:=true;

Label3.Visible:=true;

Label4.Visible:=true;

Label5.Visible:=true;

end;

procedure TForm3.BitBtn10Click(Sender: TObject);

begin

Edit1.Clear;

Edit2.Clear;


Edit3.Clear;

Edit4.Clear;

Edit5.Clear;

ComboBox1.Visible:=false;

BitBtn3.Visible:=false;

BitBtn9.Visible:=false;

BitBtn10.Visible:=false;

GradientRect (clBlue, clBlack, Canvas);

Form3.Refresh;Label1.Visible:=true;

Label2.Visible:=true;

Label3.Visible:=true;

Label4.Visible:=true;

Label5.Visible:=true;

Label6.Visible:=true;

Edit4.Visible:=true;

Edit5.Visible:=true;

Memo1.Clear;

end;

end.

4.  Unit4 название формы Form4.

interface

uses

Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,

Dialogs, StdCtrls, Grids, DBGrids, Menus, Buttons, ActnMan, ActnColorMaps;

type

TForm4 = class(TForm)

MainMenu1: TMainMenu;

N2: TMenuItem;