Дипломная работа: Автоматизация управления кадрами в Местной администрации городского округа Нальчик

Внимание! Если размещение файла нарушает Ваши авторские права, то обязательно сообщите нам
procedure InitJobTitles;
begin
with DM do begin
IBQJobTitles.Close;
IBQJobTitles.SQL.Clear;
IBQJobTitles.SQL.Append('select * from JobTitles');
if Trim(FFoundJobTitles.EditString.Text)<>'' then IBQJobTitles.SQL.Append('where
JobTitle Like '+chr(39)+Trim(FFoundJobTitles.EditString.Text)+'%'+chr(39));
IBQJobTitles.SQL.Append('Order By JobTitle');
IBQJobTitles.Open;
end;
end;
procedure TFFoundJobTitles.FormActivate(Sender: TObject);
begin
Left:=Round((GetSystemMetrics(SM_CXSCREEN)-Width)/2);
Top:=Round((GetSystemMetrics(SM_CYSCREEN)-Height)/2);
with DM do begin
EditString .Text:='';
InitJobTitles;
EditString.SetFocus;
end;
end;
procedure TFFoundJobTitles.EditStringChange(Sender: TObject);
var Stroka:String;
begin
with DM do begin
IBQJobTitles.First;
if not IBQJobTitles.Locate('JobTitle',Trim(EditString.Text),[loPartialKey]) then begin
Stroka:=EditString.Text;
Stroka :=Copy(Stroka, 1,Length(Stroka)-1);
EditString .Text:=Stroka;
EditString.SelStart:=Length(Stroka);
end;
InitJobTitles;
end;
end;
procedure TFFoundJobTitles.FormClose(Sender: TObject;
var Action: TCloseAction);
begin
FJobTitles.Enabled:=True;
end;
procedure TFFoundJobTitles.FormKeyDown(Sender: TObject; var Key: Word;
Shift: TShiftState);
begin
with DM do
case key of
13: begin
RecSave:=IB QJobTitlesID.AsInteger;
EditString .Text:-';
InitJobTitles;
IBQJobTitles.Locate('ID',RecSave,[loCaseInsensitive]);
FFoundJobTitles.Close;
end;
27: begin
EditString .Text:-';
InitJobTitles;
IBQJobTitles.Locate('ID',RecSave,[loCaseInsensitive]);
FFoundJobTitles.Close;
end;
end;
end;
end.
unit FoundEmployers;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, ComCtrls, Grids, DBGrids, StdCtrls, ExtCtrls, DB;
type
TFFoundEmployers - class(TForm)
PanelFoundEmployers: TPanel;
LabelString: TLabel;
EditString: TEdit;
LabelFoundEmployers: TLabel;
DBGrFoundEmployers: TDBGrid;
SBFoundEmployers: TStatusBar;
procedure FormActivate(Sender: TObject);
procedure EditStringChange(Sender: TObject);
procedure FormKeyDown(Sender: TObject; var Key: Word;
Shift: TShiftState);
procedure FormClose(Sender: TObject; var Action: TCloseAction);
private
{ Private declarations }
public
{ Public declarations }
end;
var
FFoundEmployers: TFFoundEmployers;
RecSave: LongInt;
implementation
uses DataModule, Employers;
{$R
procedure InitEmployers;
begin
with DM do begin
IBQEmployers.Close;
IB QEmpl oyers.SQL .Clear;
IBQEmployers.SQL.Append('select * from Employers');
if FFoundEmployers.EditString.Text<>'' then IBQEmployers.SQL.Append('where Family
Like '+chr(39)+Trim(FFoundEmployers.EditString.Text)+'%'+chr(39));
IBQEmployers.SQL.Append('Order By Family');
IBQEmployers.Open;
end;
end;
procedure TFFoundEmployers.FormActivate(Sender: TObject);
begin
Left:=Round((GetSystemMetrics(SM_CXSCREEN)-Width)/2);
Top:=Round((GetSystemMetrics(SM_CYSCREEN)-Height)/2);
with DM do begin
EditString .Text:='';
InitEmployers;
EditString.SetFocus;
end;
end;
procedure TFFoundEmployers.EditStringChange(Sender: TObject);
var Stroka:String;
begin
with DM do begin
IB QEmpl oyers.First;
if not IBQEmployers.Locate('Family',Trim(EditString.Text),[loPartialKey]) then begin
Stroka:=EditString.Text;
Stroka :=Copy(Stroka, 1,Length(Stroka)-1);
EditString .Text:=Stroka;
EditString.SelStart:=Length(Stroka);
end;
InitEmployers;
end;
end;
procedure TFFoundEmployers.FormKeyDown(Sender: TObject; var Key: Word;
Shift: TShiftState);
begin
with DM do
case key of
13: begin
RecSave:=IB QEmpl oyersID.AsInteger;
EditString .Text:-';
InitEmployers;
IBQEmployers.Locate('ID',RecSave,[loCaseInsensitive]);
FFoundEmployers.Close;
end;
27: begin
EditString .Text:-';
InitEmployers;
IBQEmployers.Locate(TD',RecSave,[loCaseInsensitive]);
FFoundEmployers.Close;
end;
end;
end;
procedure TFFoundEmployers.FormClose(Sender: TObject;
var Action: TCloseAction);
begin
FEmployers.Enabled:=True;
end;
end.
unit Employers;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, ComCtrls, ExtCtrls, Grids, DBGrids, DB;
type
TFEmployers = class(TForm)
PanelEmployers: TPanel;
SBEmployers: TStatusBar;
DBGrEmployers: TDBGrid;
procedure FormClose(Sender: TObject; var Action: TCloseAction);
procedure FormKeyDown(Sender: TObject; var Key: Word;
Shift: TShiftState);
procedure FormActivate(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
FEmployers: TFEmployers;
implementation
uses DataModule, Main, EditEmployers, FoundEmployers, Select;
{$R *.dfm}
procedure InitSQL;
begin
with DM do begin
IBQFamily.SQL.Clear;
IBQFamily.SQL.Append('select * from Family');
IBQFamily.SQL.Append('where
Empl oyers='+IntToStr(IB QEmpl oyersID.AsInteger));
IBQFamily.SQL.Append('Order By DateBirth');
IBQFamily.Open;
IBQMotionEmployers. SQL.Clear;
IBQMotionEmployers.SQL.Append('select * from MotionEmployers');
IB QMoti onEmpl oyers.S QL .App end('where
Empl oyers='+IntToStr(IB QEmpl oyersID.AsInteger));
IBQMotionEmployers.SQL.Append('Order By DateFrom');
IB QMoti onEmpl oyers.Open;
IBQChangeFIO.SQL.Clear;
IBQChangeFIO.SQL.Append('select * from ChangeFIO');
IBQChangeFIO.SQL.Append('where
Empl oyers='+IntToStr(IB QEmpl oyersID.AsInteger));
IBQChangeFIO.SQL.Append('Order By DateChange');
IBQChangeFIO.Open;
{Application.MessageBox(PChar(IBQEmployersFamily.AsString),PChar(IntToStr(IB
QEmployersID.AsInteger)),MB_OK);}
IBQFormations.SQL.Clear;
IBQFormations.SQL.Append('select * from Formations');
IBQFormations.SQL.Append('where
Empl oyers='+IntToStr(IB QEmpl oyersID.AsInteger));
IBQFormations.SQL.Append('Order By YearEnd');
IBQFormations.Open;
IBQQualifications.SQL.Clear;
IBQQualifications.SQL.Append('select * from Qualifications');
IBQQualifications.SQL.Append('where
Empl oyers='+IntToStr(IB QEmpl oyersID.AsInteger));
IBQQualifications.SQL.Append('Order By Dates');
IBQQualifications.Open;
IBQIncQualifics.SQL.Clear;
IBQIncQualifics.SQL.Append('select * from IncQualifics');
IBQIncQualifics.SQL.Append('where
Empl oyers='+IntToStr(IB QEmpl oyersID.AsInteger));
IBQIncQualifics.SQL.Append('Order By DateOrder');
IBQIncQualifics.Open;
IBQBookWorks.SQL.Clear;
IBQBookWorks.SQL.Append('select * from BookWorks');
IBQBookWorks.SQL.Append('where
Empl oyers='+IntToStr(IB QEmpl oyersID.AsInteger));
IBQBookWorks.SQL.Append('Order By DateOrder');
IBQBookWorks.Open;
Источник: https://baza.diplomsite.ru/previewfile/2244