- •Implementation
- •Interface
- •Implementation
- •Interface
- •Implementation
- •Interface
- •Implementation
- •Interface
- •Implementation
- •Interface
- •Implementation
- •Interface
- •Implementation
- •Interface
- •Image1: tImage;
- •Implementation
- •Interface
- •Implementation
- •Interface
- •Implementation
- •Interface
- •Implementation
- •Interface
- •Implementation
- •Interface
- •Implementation
- •Interface
- •Implementation
- •Interface
- •Implementation
Interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, ExtCtrls, DBCtrls, Mask, Grids, DBGrids, DB, ADODB;
type
TForm18 = class(TForm)
Label1: TLabel;
Label2: TLabel;
Button1: TButton;
ADOConnection1: TADOConnection;
ADODataSet1: TADODataSet;
DataSource1: TDataSource;
DBGrid1: TDBGrid;
DBEdit1: TDBEdit;
DBEdit2: TDBEdit;
DBRadioGroup1: TDBRadioGroup;
Button2: TButton;
procedure Button1Click(Sender: TObject);
procedure Button2Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form18: TForm18;
Implementation
uses Unit19, Unit17;
{$R *.dfm}
procedure TForm18.Button1Click(Sender: TObject);
begin
if (DBradiogroup1.ItemIndex = 1)
then
form19.show
else
begin
adodataset1.post;
adodataset1.append;
end ;
form17.ADOTable1.Active := false;
form17.ADOTable1.Active := true;
form18.Hide;
form17.Show;
end;
procedure TForm18.Button2Click(Sender: TObject);
begin
form17.ADOTable1.Active := false;
form17.ADOTable1.Active := true;
form18.Hide;
form17.Show;
end;
end.
unit Unit19;
Interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;
type
TForm19 = class(TForm)
Edit1: TEdit;
Label1: TLabel;
Button1: TButton;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form19: TForm19;
Implementation
uses Unit18, Unit17;
{$R *.dfm}
procedure TForm19.Button1Click(Sender: TObject);
begin
if edit1.Text = '228'
then
begin
form18.adodataset1.post;
showmessage ('вы успешно зарегистрировали пользователя');
form19.Hide; form17.ADOTable1.Active := false;
form17.ADOTable1.Active := true;
form19.Hide;
form17.Show;end
else
begin
form18.ADODataSet1.Delete;
showmessage ('ошибка');
form18.adodataset1.append;
form17.ADOTable1.Active := false;
form17.ADOTable1.Active := true;
form19.Hide; form18.Show;
end
end;
end.
end.
unit Unit20;
Interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, DB, ADODB, Grids, DBGrids, StdCtrls, DBCtrls, ExtCtrls;
type
TForm20 = class(TForm)
DBGrid1: TDBGrid;
ADOConnection1: TADOConnection;
ADODataSet1: TADODataSet;
DataSource1: TDataSource;
DBNavigator1: TDBNavigator;
DBMemo1: TDBMemo;
DBMemo2: TDBMemo;
DBMemo3: TDBMemo;
DBText1: TDBText;
Label1: TLabel;
Label2: TLabel;
Label3: TLabel;
Label4: TLabel;
Edit1: TEdit;
ComboBox1: TComboBox;
procedure Edit1Change(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form20: TForm20;
Implementation
{$R *.dfm}
procedure TForm20.Edit1Change(Sender: TObject);
begin
if Combobox1.ItemIndex = 0 then
begin
AdoDataset1.close;
AdoDataset1.CommandText :='select * from Статус where ' + ' Организация like ''%' + Edit1.Text + '%''';
AdoDataset1.open;
end;
if Combobox1.ItemIndex = 1 then
begin
AdoDataset1.close;
AdoDataset1.CommandText :='select * from Статус where ' + ' ФИО like ''%' + Edit1.Text + '%''';
AdoDataset1.open;
end;
if Combobox1.ItemIndex = 2 then
begin
AdoDataset1.close;
AdoDataset1.CommandText :='select * from Статус where ' + ' Должность like ''%' + Edit1.Text + '%''';
AdoDataset1.open;
end;
end;
end.
