Выбор материала и расчет параметров обделок вертикальных стволов метрополитенов
Страница 30

Controls, Forms, Dialogs, DBCtrls, ExtCtrls, DBTables, DB, Grids,

DBGrids, RXDBCtrl, Placemnt, StdCtrls, Buttons;

type

TUserListForm = class(TForm)

UsersTable: TTable;

dsUsers: TDataSource;

UsersGrid: TrxDBGrid;

UsersTablePassword: TStringField;

Panel1: TPanel;

DBNavigator: TDBNavigator;

FormPlacement: TFormPlacement;

UsersTableID: TFloatField;

UsersTableUserName: TStringField;

UsersTableFullName: TStringField;

UsersTableUserLevel: TFloatField;

BitBtn1: TBitBtn;

procedure DBNavigatorClick(Sender: TObject; Button:

TNavigateBtn);

procedure UsersGridDblClick(Sender: TObject);

procedure FormPlacementSavePlacement(Sender: TObject);

procedure FormPlacementRestorePlacement(Sender: TObject);

procedure FormCreate(Sender: TObject);

procedure FormClose(Sender: TObject; var Action: TCloseAction);

end;

var

UserListForm: TUserListForm;

implementation

uses

EditUser, IniFiles, Global;

const

SAccessDenied = 'Недостаточно прав. Доступ запрещен';

{$R *.DFM}

procedure TUserListForm.DBNavigatorClick(Sender: TObject;

Button: TNavigateBtn);

begin

case Button of

nbInsert:

begin

EditUserData('', UsersTable, True);

end;

nbEdit:

begin

EditUserData('', UsersTable, False);

end;

end;

end;

procedure TUserListForm.UsersGridDblClick(Sender: TObject);

begin

EditUserData('', UsersTable, False);

end;

procedure TUserListForm.FormPlacementSavePlacement(Sender: TObject);

var

IniFile: TIniFile;

I: Integer;

begin

IniFile := TIniFile.Create(FormPlacement.IniFileName);

try

for I := 0 to ComponentCount - 1 do begin

if Components[I] is TrxDBGrid then

TrxDBGrid(Components[I]).SaveLayout(IniFile);

end;

finally

IniFile.Free;

end;

end;

procedure TUserListForm.FormPlacementRestorePlacement(Sender:

TObject);

var

IniFile: TIniFile;

I: Integer;

begin

IniFile := TIniFile.Create(FormPlacement.IniFileName);

try

for I := 0 to ComponentCount - 1 do begin

if Components[I] is TrxDBGrid then

TrxDBGrid(Components[I]).RestoreLayout(IniFile);

end;

finally

Страницы: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31