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

end;

if Column.FieldName = 'FIO_avtora' then

begin

DBGrid1.Canvas.Brush.Color := clInactiveCaption;

DBGrid1.DefaultDrawColumnCell(Rect, DataCol, Column, State);

DBGrid1.Canvas.Brush.Color := holdColor;

end; end;

procedure TForm4.N6Click(Sender: TObject);

begin

Label4.Visible:=false;

Label6.Visible:=false;

Edit3.Visible:=false;

BitBtn6.Visible:=false;

BitBtn7.Visible:=false;

BitBtn8.Visible:=false;

BitBtn9.Visible:=false;

BitBtn10.Visible:=false;

BitBtn11.Visible:=false;

Edit4.Visible:=false;

GradientRect (clBlue, clBlack, Canvas);

Form4.Refresh;

Label1.Visible:=true;

Label2.Visible:=true;

Label3.Visible:=true;

Edit1.Visible:=true;

Edit2.Visible:=true;

ComboBox2.Visible:=true;

Label5.Visible:=true;

BitBtn5.Visible:=true;

BitBtn12.Visible:=true;

Edit1.Clear;

Edit2.Clear;

Edit3.Clear;

end;


procedure TForm4.BitBtn6Click(Sender: TObject);

var t: integer;

begin

Edit4.Clear;

DataModule1.ADOQuery3.Close;

DataModule1.ADOQuery3.SQL.Clear;

DataModule1.ADOQuery3.SQL.Add('delete from books where Nazvanie='''+Edit1.Text+''' ');

DataModule1.ADOQuery3.ExecSQL;

Label1.Visible:=false;

Label2.Visible:=false;

Label3.Visible:=false;

Label4.Visible:=false;

Label6.Visible:=false;

Edit1.Visible:=false;

Edit2.Visible:=false;

Edit3.Visible:=false;

BitBtn6.Visible:=false;

BitBtn12.Visible:=false;

GradientRect (clBlue, clBlack, Canvas);

Form4.Refresh;

Label5.Visible:=true;

end;

procedure TForm4.BitBtn7Click(Sender: TObject);

var v:integer;

begin

DataModule1.ADOQuery3.Close;

DataModule1.ADOQuery3.SQL.Clear;

DataModule1.ADOQuery3.SQL.Add('select * from books where Nazvanie='''+Edit4.Text+''' ');

DataModule1.ADOQuery3.Open;

v:=DataModule1.ADOQuery3.Fields[0].AsInteger;

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

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

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

Label4.Visible:=false;

Edit4.Visible:=false;

BitBtn7.Visible:=false;

GradientRect (clBlue, clBlack, Canvas);

Form4.Refresh;

Label5.Visible:=true;

BitBtn12.Visible:=true;

Label1.Visible:=true;

Label2.Visible:=true;

Label3.Visible:=true;

Edit1.Visible:=true;

Edit2.Visible:=true;

Edit3.Visible:=true;

BitBtn6.Visible:=true;

end;

procedure TForm4.FormActivate(Sender: TObject);

begin


Form4.Left:=335;

Form4.Top:=140;

DataModule1.ADOQuery3.Close;

DataModule1.ADOQuery3.SQL.Clear;

DataModule1.ADOQuery3.SQL.Add('select distinct razdel from books');

DataModule1.ADOQuery3.Open;

DataModule1.ADOQuery3.First;

ComboBox1.Clear;

while not DataModule1.ADOQuery3.Eof do

begin ComboBox1.Items.Add(DataModule1.ADOQuery3.Fields[0].AsString);

DataModule1.ADOQuery3.Next;

end;

DataModule1.ADOQuery3.Close;

end;

procedure TForm4.N16Click(Sender: TObject);

begin

BitBtn5.Visible:=false;

BitBtn6.Visible:=false;

BitBtn7.Visible:=false;

BitBtn9.Visible:=false;

BitBtn10.Visible:=false;

BitBtn11.Visible:=false;

BitBtn12.Visible:=false;

ComboBox2.Visible:=false;

Edit1.Visible:=false;

Edit2.Visible:=false;

Edit3.Visible:=false;

Label2.Visible:=false;

Label3.Visible:=false;

Label6.Visible:=false;

GradientRect (clBlue, clBlack, Canvas);

Form4.Refresh;

BitBtn8.Visible:=true;

Edit4.Visible:=true;

Label1.Visible:=true;

Label5.Visible:=true;

Label4.Visible:=true;

end;

procedure TForm4.BitBtn8Click(Sender: TObject);

begin

DataModule1.ADOQuery3.Close;

DataModule1.ADOQuery3.SQL.Clear;

DataModule1.ADOQuery3.SQL.Add('select * from books where Nazvanie='''+Edit4.Text+''' ');

DataModule1.ADOQuery3.Open;

a:=DataModule1.ADOQuery3.Fields[0].AsInteger;

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

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

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

Label4.Visible:=false;

Edit4.Visible:=false;

BitBtn7.Visible:=false;


BitBtn6.Visible:=false;

BitBtn5.Visible:=false;

BitBtn8.Visible:=false;