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

Внимание! Если размещение файла нарушает Ваши авторские права, то обязательно сообщите нам
FEditJobTitles: TFEditJobTitles;
JobTitleAdd:Boolean;
implementation
uses DataModule, JobTitles;
{$R *.dfm}
procedure TFEditJobTitles.FormActivate(Sender: TObject);
begin
Left:=Round((GetSystemMetrics(SM_CXSCREEN)-Width)/2);
Top:=Round((GetSystemMetrics(SM_CYSCREEN)-Height)/2);
with DM do
if JobTitleAdd then EditJobTitles.Text:=''
else EditJobTitles.Text:=Trim(IBQJobTitlesJobTitle.AsString);
EditJobTitles.SetFocus;
end;
procedure TFEditJobTitles.FormKeyDown(Sender: TObject; var Key: Word;
Shift: TShiftState);
var RecSave:LongInt;
begin
with DM do
case key of
13: begin
if JobTitleAdd then begin
IBQID.SQL.Clear;
IBQID.SQL.Append('select Gen_ID(ID_JobTitles,0) from JobTitles');
IBQID.Open;
RecSave:=IBQIDGen_ID.AsInteger+1;
IBQID.Close;
IBQExecSQL.SQL.Clear;
IBQExecSQL.SQL.Append('Insert into JobTitles (JobTitle)');
IBQExecSQL.SQL.Append('Values ('+chr(39)+Trim(EditJobTitles.Text)+chr(39)+')');
end else begin
RecSave:=IBQJobTitlesID. AsInteger;
IBQExecSQL.SQL.Clear;
IBQExecSQL.SQL.Append(Update JobTitles');
IBQExecSQL.SQL.Append('Set JobTitle='+chr(39)+Trim(EditJobTitles.Text)+chr(39));
IBQExecSQL.SQL.Append('where ID-+IntToStr(IBQJobTitlesID.AsInteger));
end;
IBQExecSQL.ExecSQL;
IBQJobTitles.Close;
IBQJobTitles.Open;
IBQJobTitles.Locate('ID',RecSave,[loCaseInsensitive]);
FEditJobTitles.Close;
end;
27: FEditJobTitles.Close;
end;
end;
procedure TFEditJobTitles.FormClose(Sender: TObject;
var Action: TCloseAction);
begin
FJobTitles.Enabled:=True;
end;
end.
unit EditIncQualifics;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, ComCtrls, StdCtrls, ExtCtrls, DB;
type
TFEditIncQualifics = class(TForm)
PanelIncQualifics: TPanel;
LabelInstitution: TLabel;
EditInstitution: TEdit;
EditTypeQualific: TEdit;
LabelTypeQualific: TLabel;
LabelDocuments: TLabel;
EditDocuments: TEdit;
LaelSerial: TLabel;
EditSerialDoc: TEdit;
DTPOrder: TDateTimePicker;
LabelDateOrder: TLabel;
LabelNumberOrder: TLabel;
LabelDateDocum: TLabel;
DTPDocum: TDateTimePicker;
EditBasis: TEdit;
SBEditIncQualifics: TStatusBar;
LabelBegin: TLabel;
DTPBegin: TDateTimePicker;
LabelEnd: TLabel;
DTPEnd: 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
FEditIncQualifics: TFEditIncQualifics;
AddIncQualific:Boolean;
implementation
uses DataModule, EditEmployers;
{$R *.dfm}
procedure TFEditIncQualifics.FormActivate(Sender: TObject);
begin
Left:=Round((GetSystemMetrics(SM_CXSCREEN)-Width)/2);
Top:=Round((GetSystemMetrics(SM_CYSCREEN)-Height)/2);
with DM do
if AddIncQualific then begin
DTPBegin.DateTime:=Trunc(Date());
DTPEnd.DateTime:=Trunc(Date());
EditTypeQualific.Text:-';
EditInstitution.Text:='';
EditDocuments.Text:='';
EditSerialDoc.Text:='';
DTPDocum.DateTime:=Trunc(Date());
EditBasis.Text:='';
DTPOrder.DateTime:=Trunc(Date());
end else begin
DTPBegin.DateTime:=Trunc(IBQIncQualificsDateFrom.AsDateTime);
DTPEnd.DateTime:=Trunc(IBQIncQualificsDateTo.AsDateTime);
EditTypeQualific.Text:=Trim(IBQIncQualificsTypeQualific.AsString);
EditInstitution.Text:=Trim(IBQIncQualificsInstitution.AsString);
EditDocuments.Text:=Trim(IBQIncQualificsDocuments.AsString);
EditSerialDoc.Text:=Trim(IBQIncQualificsSerialDoc.AsString);
DTPDocum.DateTime:=Trunc(IBQIncQualificsDateDocum.AsDateTime);
EditBasis.Text:=Trim(IBQIncQualificsBasis.AsString);
DTPOrder.DateTime:=Trunc(IBQIncQualificsDateOrder.AsDateTime);
end;
DTPBegin.SetFocus;
end;
procedure TFEditIncQualifics.FormClose(Sender: TObject;
var Action: TCloseAction);
begin
FEditEmployers.Enabled:=True;
end;
procedure TFEditIncQualifics.FormKeyDown(Sender: TObject; var Key: Word;
Shift: TShiftState);
var RecSave:LongInt;
begin
with DM do
case key of
13: begin
if AddIncQualific then begin
IBQID.SQL.Clear;
IBQID.SQL.Append('select Gen_ID(ID_IncQualifics,0) from IncQualifics');
IBQID.Open;
RecSave:=IBQIDGen_ID.AsInteger+1;
IBQID.Close;
IBQExecSQL.SQL.Clear;
IBQExecSQL.SQL.Append('Insert into IncQualifics (Employers,');
IBQExecSQL.SQL.Append('DateFrom,');
IBQExecSQL.SQL.Append('DateTo,');
IBQExecSQL.SQL.Append('TypeQualific,');
IBQExecSQL.SQL.Append('Institution,');
IBQExecSQL.SQL.Append('Documents,');
IBQExecSQL.SQL.Append('SerialDoc,');
IB QExec S QL SQL.Append('D ateDocum,');
IBQExecSQL.SQL.Append('Basis,');
IBQExecSQL.SQL.Append('DateOrder)');
IBQExecSQL.SQL.Append('Values ('+IntToStr(IBQEmployersID.AsInteger)+',');
IBQExecSQL.SQL.Append(chr(39)+DateToStr(DTPBegin.Date)+chr(39)+',');
IBQExecSQL.SQL.Append(chr(39)+DateToStr(DTPEnd.Date)+chr(39)+',');
IBQExecSQL.SQL.Append(chr(39)+Trim(EditTypeQualific.Text)+chr(39)+',');
IB QExec S QL .S QL. Append(chr(39)+Trim(EditInstitution.Text)+chr(39)+',');
IB QExec S QL .S QL. Append(chr(39)+Trim(EditDocuments.Text)+chr(39)+',');
IBQExecSQL.SQL.Append(chr(39)+Trim(EditSerialDoc.Text)+chr(39)+',');
IBQExecSQL.SQL.Append(chr(39)+DateToStr(DTPDocum.Date)+chr(39)+',');
IB QExec S QL .S QL. Append(chr(39)+Trim(EditBasis.Text)+chr(39)+',');
IBQExecSQL.SQL.Append(chr(39)+DateToStr(DTPOrder.Date)+chr(39)+')');
end else begin
RecSave :=IBQIncQualificsID.AsInteger;
IBQExecSQL.SQL.Clear;
IBQExecSQL.SQL.Append('Update IncQualifics');
IB QExec S QL S QL Append('Set
DateFrom='+chr(39)+DateToStr(DTPBegin.Date)+chr(39)+',');
IBQExecSQL.SQL.Append('DateTo='+chr(39)+DateToStr(DTPEnd.Date)+chr(39)+',');
IBQExecSQL.SQL.Append('TypeQualific='+chr(39)+Trim(EditTypeQualific.Text)+chr(39)+
',');
IBQExecSQL.SQL.Append('Institution='+chr(39)+Trim(EditInstitution.Text)+chr(39)+',');
IBQExecSQL.SQL.Append('Documents='+chr(39)+Trim(EditDocuments.Text)+chr(39)+',');
IBQExecSQL.SQL.Append('SerialDoc='+chr(39)+Trim(EditSerialDoc.Text)+chr(39)+',');
IBQExecSQL.SQL.Append('DateDocum='+chr(39)+DateToStr(DTPDocum.Date)+chr(39)+',
');
IBQExecSQL.SQL.Append('Basis='+chr(39)+Trim(EditBasis.Text)+chr(39)+',');
IBQExecSQL.SQL.Append('DateOrder='+chr(39)+DateToStr(DTPOrder.Date)+chr(39));
IB QExec S QL S QL. Append('Where ID='+IntToStr(Rec Save));
end;
IBQExecSQL.ExecSQL;
IBQIncQualifics.Close;
IBQIncQualifics.Open;
IBQIncQualifics.Locate('ID',RecSave,[loCaseInsensitive]);
FEditlncQualifics.Close
end;
27: FEditlncQualifics.Close;
end;
end;
end.
unit EditFurloughs;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, ComCtrls, ExtCtrls, StdCtrls, DB, Mask;
type
TFEditFurloughs = class(TForm)
LabelTypes: TLabel;
LabelCountDays: TLabel;
LabelDateOrder: TLabel;
LabelNumberOrder: TLabel;
LabelBeginWorks: TLabel;
LabelEndWorks: TLabel;
DTPOrder: TDateTimePicker;
EditNumberOrder: TEdit;
DTPBeginWorks: TDateTimePicker;
DTPEndWorks: TDateTimePicker;
PanelFurloughs: TPanel;
SBEditFurloughs: TStatusBar;
DTPBegin: TDateTimePicker;
LabelBegin: TLabel;
LabelEnd: TLabel;
DTPEnd: TDateTimePicker;
CBTypes: TComboBox;
MaskEditCountDays: TMaskEdit;
procedure FormActivate(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
FEditFurloughs: TFEditFurloughs;
AddFurlough:Boolean;
implementation
Источник: https://baza.diplomsite.ru/previewfile/2244