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

Внимание! Если размещение файла нарушает Ваши авторские права, то обязательно сообщите нам
IBQFurloughs.SQL.Clear;
IBQFurloughs.SQL.Append('select * from Furloughs');
IBQFurloughs.SQL.Append('where
Empl oyers='+IntToStr(IB QEmpl oyersID.AsInteger));
IBQFurloughs.SQL.Append('Order By DateOrder');
IBQFurloughs.Open;
IBQAwards.SQL.Clear;
IBQAwards.SQL.Append('select * from Awards');
IB QAwards.SQL .Append('where
Empl oyers='+IntToStr(IB QEmpl oyersID.AsInteger));
IBQAwards.SQL.Append('Order By DateDocum');
IBQAwards.Open;
end;
end;
procedure TFEmployers.FormClose(Sender: TObject; var Action: TCloseAction);
begin
with DM do begin
IBQMilitary.Close;
IBQEmployers.Close;
IBQJobTitles.Close;
FSelect.Enabled:=True;
end;
end;
procedure AddEmployer;
begin
EditEmployers.EmployerAdd:=True;
EditEmployers.FirstRun:=True;
FEmployers.Enabled:=False;
FEditEmployers.Show;
end;
procedure EditEmployer;
begin
with DM do
if IBQEmployers.RecordCount>0 then begin
IBQJobTitles.Locate('ID',IBQEmployersJobTitle.AsInteger,[loCaseInsensitive]);
EditEmployers.EmployerAdd:=False;
EditEmployers.FirstRun:=True;
FEmployers.Enabled:=F alse;
InitSQL;
FEditEmployers.Show;
end else Application.MessageBox('HeT данных для
редактирования...','Message' ,MB_OK);
end;
procedure DeleteEmployer;
var RecSave:LongInt;
begin
with DM do
if IBQEmployers.RecordCount>0 then begin
if Application.MessageBox(Pchar('Удалить сотрудника:
'+Trim(IBQEmployersFamily.AsString)+'?'),",ID_OK)=ID_OK then begin
if IBQEmployers.RecordCount>1 then RecSave:=IBQEmployers.RecNo-1;
IBQExecSQL.SQL.Clear;
IBQExecSQL.SQL.Append('Delete from Family');
IBQExecSQL.SQL.Append('where
Empl oyers='+IntToStr(IB QEmpl oyersID.AsInteger));
IBQExecSQL.ExecSQL;
IBQExecSQL.SQL.Clear;
IBQExecSQL.SQL.Append('Delete from ChangeFIO');
IBQExecSQL.SQL.Append('where
Empl oyers='+IntToStr(IB QEmpl oyersID.AsInteger));
IBQExecSQL.ExecSQL;
IBQExecSQL.SQL.Clear;
IBQExecSQL.SQL.Append('Delete from BookWorks');
IBQExecSQL.SQL.Append('where
Empl oyers='+IntToStr(IB QEmpl oyersID.AsInteger));
IBQExecSQL.ExecSQL;
IBQExecSQL.SQL.Clear;
IBQExecSQL.SQL.Append('Delete from Qualifications');
IBQExecSQL.SQL.Append('where
Empl oyers='+IntToStr(IB QEmpl oyersID.AsInteger));
IBQExecSQL.ExecSQL;
IBQExecSQL.SQL.Clear;
IBQExecSQL.SQL.Append('Delete from Formations');
IBQExecSQL.SQL.Append('where
Empl oyers='+IntToStr(IB QEmpl oyersID.AsInteger));
IBQExecSQL.ExecSQL;
IBQExecSQL.SQL.Clear;
IBQExecSQL.SQL.Append('Delete from Furloughs');
IBQExecSQL.SQL.Append('where
Empl oyers='+IntToStr(IB QEmpl oyersID.AsInteger));
IBQExecSQL.ExecSQL;
IBQExecSQL.SQL.Clear;
IBQExecSQL.SQL.Append('Delete from MotionEmployers');
IBQExecSQL.SQL.Append('where
Empl oyers='+IntToStr(IB QEmpl oyersID.AsInteger));
IBQExecSQL.ExecSQL;
IBQExecSQL.SQL.Clear;
IBQExecSQL.SQL.Append('Delete from IncQualifics');
IBQExecSQL.SQL.Append('where
Empl oyers='+IntToStr(IB QEmpl oyersID.AsInteger));
IBQExecSQL.ExecSQL;
IBQExecSQL.SQL.Clear;
IBQExecSQL.SQL.Append('Delete from Military');
IBQExecSQL.SQL.Append('where ID='+IntToStr(IBQEmployersID.AsInteger));
IBQExecSQL.ExecSQL;
IBQExecSQL.SQL.Clear;
IBQExecSQL.SQL.Append('Delete from Employers');
IB QExec S QL .S QL .Append('where ID='+IntT oStr(IB QEmpl oyersID.AsInteger));
IBQExecSQL.ExecSQL;
IBQEmployers.Close;
IBQEmployers.Open;
IB QEmpl oyers.RecNo:=Rec Save;
end;
end else Application.MessageBox('HeT данных для
удаления','Сообщение',МВ_ОК);
end;
procedure EmployerFound;
begin
with DM do FoundEmployers.RecSave:=IBQEmployersID.AsInteger;
FEmployers.Enabled:=False;
FFoundEmployers.Show;
end;
procedure TFEmployers.FormKeyDown(Sender: TObject; var Key: Word;
Shift: TShiftState);
begin
case key of
VK_F2: AddEmployer;
VK_F4: EditEmployer;
VK_F7: EmployerFound;
VK_F8: DeleteEmployer;
VK_ESCAPE: FEmployers.Close;
end;
end;
procedure TFEmployers.FormActivate(Sender: TObject);
begin
Left:=Round((GetSystemMetrics(SM_CXSCREEN)-Width)/2);
Top:=Round((GetSystemMetrics(SM_CYSCREEN)-Height)/2)-6;
end;
end.
unit EditQualifications;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, ExtCtrls, StdCtrls, ComCtrls, DB;
type
TFEditQualifications = class(TForm)
LabelDateOrder: TLabel;
LabelDate: TLabel;
LabelNumberProtocol: TLabel;
LabelDecision: TLabel;
LabelNumberOrder: TLabel;
LabelProfession: TLabel;
LabelCategoryShort: TLabel;
SBEditWorkBooks: TStatusBar;
DTPOrder: TDateTimePicker;
DTPDate: TDateTimePicker;
EditNumberOrder: TEdit;
EditDecision: TEdit;
EditCategory: TEdit;
EditCategoryShort: TEdit;
EditNumberProtocol: TEdit;
PanelQualification: TPanel;
Lab elDateProtocol: TLab el;
DTPProtocol: TDateTimePicker;
procedure FormActivate(Sender: TObject);
procedure FormClose(Sender: TObject; var Action: TCloseAction);
procedure FormKeyDown(Sender: TObject; var Key: Word;
Shift: TShiftState);
private
{ Private declarations }
public
{ Public declarations }
end;
var
FEditQualifications: TFEditQualifications;
QualificationAdd:Boolean;
implementation
uses EditEmployers, DataModule;
{$R *.dfm}
procedure TFEditQualifications.FormActivate(Sender: TObject);
begin
Left:=Round((GetSystemMetrics(SM_CXSCREEN)-Width)/2);
Top:=Round((GetSystemMetrics(SM_CYSCREEN)-Height)/2);
with DM do
if QualificationAdd then begin
DTPDate.DateTime:=Trunc(Date());
EditDecision.Text:='';
EditC ategory .Text:-';
EditC ategoryShort.Text:='';
EditNumberProtocol.Text:='';
DTPProtocol.DateTime:=Trunc(Date());
EditNumberOrder.T ext:='';
DTPOrder.DateTime:=Trunc(Date());
end else begin
DTPDate.DateTime:=IBQQualificationsDates.AsDateTime;
EditDecision.Text:=Trim(IBQQualificationsDecision.AsString);
EditCategory.Text:=Trim(IBQQualificationsCategory.AsString);
EditCategoryShort.Text:=Trim(IBQQualificationsCategoryShort.AsString);
EditNumberProtocol.Text:=Trim(IBQQualificationsNumberProtocol.AsString);
DTPProtocol.DateTime:=IBQQualificationsDateProtocol.AsDateTime;
EditNumberOrder.Text:=Trim(IBQQualificationsNumberOrder.AsString);
DTPOrder.DateTime:=IBQQualificationsDateOrder.AsDateTime;
end;
DTPDate.SetFocus;
end;
procedure TFEditQualifications.FormClose(Sender: TObject;
var Action: TCloseAction);
begin
FEditEmployers.Enabled:=True;
end;
procedure TFEditQualifications.FormKeyDown(Sender: TObject; var Key: Word;
Shift: TShiftState);
var RecSave:LongInt;
begin
with DM do
case key of
13: begin
if QualificationAdd then begin
IBQID.SQL.Clear;
IBQID.SQL.Append('select Gen_ID(ID_Qualifications,0) from Qualifications');
IBQID.Open;
RecSave:=IBQIDGen_ID.AsInteger+1;
IBQID.Close;
IBQExecSQL.SQL.Clear;
IBQExecSQL.SQL.Append('Insert into Qualifications (Employers,');
IBQExecSQL.SQL.Append('Dates,');
IBQExecSQL.SQL.Append('Decision,');
IBQExecSQL.SQL.Append('Category,');
IBQExecSQL.SQL.Append('CategoryShort,');
IBQExecSQL.SQL.Append('NumberProtocol,');
IBQExecSQL SQL.Append('DateProtocol,');
IBQExecSQL.SQL.Append('NumberOrder,');
IBQExecSQL.SQL.Append('DateOrder)');
IBQExecSQL.SQL.Append('Values
('+IntToStr(IB QEmpl oyersID.AsInteger)+',');
IBQExecSQL.SQL.Append(chr(39)+DateToStr(DTPDate.Date)+char(39)+',');
IBQExecSQL.SQL.Append(chr(39)+Trim(EditDecision.Text)+char(39)+',');
IB QExecSQL .SQL.Append(chr(39)+Trim(EditC ategory .T ext)+char(39)+',');
IBQExecSQL.SQL.Append(chr(39)+Trim(EditCategoryShort.Text)+char(39)+',');
Источник: https://baza.diplomsite.ru/previewfile/2244