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

BitBtn15.Visible:=false;

BitBtn16.Visible:=false;

GradientRect (clBlue, clBlack, Canvas);

end;

procedure TForm5.BitBtn11Click(Sender: TObject);

begin

BitBtn10.Visible:=false;

BitBtn6.Visible:=false;

BitBtn13.Visible:=false;

BitBtn15.Visible:=false;

BitBtn16.Visible:=false;

Edit3.Visible:=false;

ComboBox1.Visible:=false;

Label1.Visible:=false;

Label2.Visible:=false;

Label3.Visible:=false;

MaskEdit1.Visible:=false;

MaskEdit3.Visible:=false;

GradientRect (clBlue, clBlack, Canvas);

Form5.Refresh;

BitBtn12.Visible:=true;

Edit2.Clear;

Edit2.Visible:=true;

Label4.Visible:=true;

end;

procedure TForm5.BitBtn12Click(Sender: TObject);

begin

GradientRect (clBlue, clBlack, Canvas);

if Edit2.Text<>'' then


begin

DataModule1.ADOQuery5.Close;

DataModule1.ADOQuery5.SQL.Clear;

DataModule1.ADOQuery5.SQL.Add('select * from Organajzer where ID_zapisi='+Edit2.text+' ');

DataModule1.ADOQuery5.Open;

n:=DataModule1.ADOQuery5.Fields[0].AsInteger;

MaskEdit1.Text:=DataModule1.ADOQuery5.Fields[2].AsString;

MaskEdit3.Text:=DataModule1.ADOQuery5.Fields[1].AsString;

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

Edit2.Visible:=false;

BitBtn12.Visible:=false;

Label4.Visible:=false;

BitBtn15.Visible:=false;

BitBtn16.Visible:=false;

GradientRect (clBlue, clBlack, Canvas);

Form5.Refresh;

Label1.Visible:=true;

Label2.Visible:=true;

Label3.Visible:=true;

MaskEdit1.Visible:=true;

MaskEdit3.Visible:=true;

BitBtn10.Visible:=true;

BitBtn13.Visible:=true;

Edit3.Visible:=true;

end

else

Application.MessageBox('введите номер записи','');

end;

end.

6.  Unit6 название формы Form6

interface

uses

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

type

TForm6 = class(TForm)

DBGrid1: TDBGrid;

Label1: TLabel;

ComboBox1: TComboBox;

BitBtn1: TBitBtn;

BitBtn3: TBitBtn;

BitBtn4: TBitBtn;

BitBtn2: TBitBtn;

BitBtn5: TBitBtn;

BitBtn6: TBitBtn;

BitBtn7: TBitBtn;

BitBtn8: TBitBtn;

BitBtn9: TBitBtn;

Edit1: TEdit;

CheckBox1: TCheckBox;


CheckBox2: TCheckBox;

BitBtn10: TBitBtn;

BitBtn11: TBitBtn;

procedure paint(Sender: TObject);

procedure FormCreate(Sender: TObject);

procedure FormActivate(Sender: TObject);

procedure DBGrid1DrawColumnCell(Sender: TObject; const Rect:

TRect; DataCol: Integer; Column: TColumn; State: TGridDrawState);

procedure BitBtn1Click(Sender: TObject);

procedure ComboBox1Change(Sender: TObject);

procedure BitBtn3Click(Sender: TObject);

procedure BitBtn4Click(Sender: TObject);

procedure Button1Click(Sender: TObject);

procedure BitBtn2Click(Sender: TObject);

procedure BitBtn7Click(Sender: TObject);

procedure BitBtn6Click(Sender: TObject);

procedure BitBtn5Click(Sender: TObject);

procedure BitBtn8Click(Sender: TObject);

procedure BitBtn9Click(Sender: TObject);

procedure BitBtn11Click(Sender: TObject);

procedure BitBtn10Click(Sender: TObject);

procedure FormMouseDown(Sender: TObject; Button: TMouseButton;Shift: TShiftState; X, Y: Integer);

procedure FormMouseUp(Sender: TObject; Button: TMouseButton;

Shift: TShiftState; X, Y: Integer);

private

{ Private declarations }

public

{ Public declarations }

procedure GradientRect(FromRGB, ToRGB: TColor; Canvas: TCanvas);

end;

var

Form6: TForm6;

implementation

uses unit1, unit2,unit3, unit4,unit5;

{$R *.dfm}

procedure TForm6.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);

DataModule1.ADOQuery1.Active:=true;

end;

procedure TForm6.FormActivate(Sender: TObject);

begin

Form6.Left:=290;

Form6.Top:=150;

DataModule1.ADOQuery2.Close;

DataModule1.ADOQuery2.SQL.Clear;


DataModule1.ADOQuery2.SQL.Add('select distinct Gruppa from Contact');