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

Внимание! Если размещение файла нарушает Ваши авторские права, то обязательно сообщите нам
uses DataModule, EditEmployers, Main;
{$R *.dfm}
procedure TFEditFurloughs.FormActivate(Sender: TObject);
begin
Left:=Round((GetSystemMetrics(SM_CXSCREEN)-Width)/2);
Top:=Round((GetSystemMetrics(SM_CYSCREEN)-Height)/2);
with DM do begin
if AddFurlough then begin
CBTypes.Text:-';
DTPBeginWorks.DateTime:=Trunc(Date());
DTPEndWorks.DateTime:=Trunc(Date());
DTPBegin.DateTime:=Trunc(Date());
DTPEnd.DateTime:=Trunc(Date());
MaskEditCountDays.Text:='28';
EditNumberOrder.Text:='';
DTPOrder.DateTime:=Trunc(Date());
end else begin
CBTypes.Text:=Trim(IBQFurloughsTypes.AsString);
DTPBeginWorks.DateTime:=IBQFurloughsDateWorksFrom.AsDateTime;
DTPEndWorks.DateTime:=IBQFurloughsDateWorksTo.AsDateTime;
DTPBegin.DateTime:=IBQFurloughsDateFrom.AsDateTime;
DTPEnd.DateTime:=IBQFurloughsDateTo.AsDateTime;
MaskEditCountDays.Text:=IntToStr(IBQFurloughsCountDays.AsInteger);
EditNumberOrder.Text:=Trim(IBQFurloughsNumberOrder.AsString);
DTPOrder.DateTime:=IBQFurloughsDateOrder.AsDateTime;
end;
DTPBeginWorks.SetFocus;
end;
end;
procedure TFEditFurloughs.FormKeyDown(Sender: TObject; var Key: Word;
Shift: TShiftState);
var RecSave:LongInt;
CountDays:integer;
Stroka:String;
begin
with DM do
case key of
VK_RETURN: begin
Stroka:=MaskEditCountDays.T ext;
if AllTrim(Stroka)-' then
CountDays:=28
else CountDays:=StrToInt(AllTrim(Stroka));
if AddFurlough then begin
IBQID.SQL.Clear;
IBQID.SQL.Append('select Gen_ID(ID_Furloughs,0) from Furloughs');
IBQID.Open;
RecSave:=IBQIDGen_ID.AsInteger+1;
IBQID.Close;
IBQExecSQL.SQL.Clear;
IBQExecSQL.SQL.Append('Insert Into Furloughs (Employers,');
IBQExecSQL.SQL.Append('Types,');
IBQExecSQL.SQL.Append('DateWorksFrom,');
IBQExecSQL.SQL.Append('DateWorksTo,');
IBQExecSQL.SQL.Append('DateFrom,');
IBQExecSQL.SQL.Append('DateTo,');
IBQExecSQL.SQL.Append('CountDays,');
IB QExec S QL .S QL .Append('Numb erOrder,');
IBQExecSQL.SQL.Append('DateOrder)');
IBQExecSQL.SQL.Append('Values ('+IntToStr(IBQEmployersID.AsInteger)+',');
IBQExecSQL.SQL.Append(chr(39)+Trim(CBTypes.Text)+chr(39)+',');
IBQExecSQL.SQL.Append(chr(39)+DateToStr(DTPBeginWorks.Date)+chr(39)+',');
IBQExecSQL.SQL.Append(chr(39)+DateToStr(DTPEndWorks.Date)+chr(39)+',');
IBQExecSQL.SQL.Append(chr(39)+DateToStr(DTPBegin.Date)+chr(39)+',');
IBQExecSQL.SQL.Append(chr(39)+DateToStr(DTPEnd.Date)+chr(39)+',');
IBQExecSQL.SQL.Append(IntToStr(CountDays)+',');
IBQExecSQL.SQL.Append(chr(39)+Trim(EditNumberOrder.Text)+chr(39)+',');
IBQExecSQL.SQL.Append(chr(39)+DateToStr(DTPOrder.Date)+chr(39)+')');
end else begin
RecSave:=IB QF urloughsID .AsInteger;
IBQExecSQL.SQL.Clear;
IBQExecSQL.SQL.Append('Update Furloughs');
IBQExecSQL.SQL.Append('Set Types='+chr(39)+Trim(CBTypes.Text)+chr(39)+',');
IB QExec S QL .S QL .Append('DateWorksFrom='+chr(39)+DateT oStr(DTPB eginW orks.Date)+
chr(39)+',');
IBQExecSQL.SQL.Append('DateWorksTo='+chr(39)+DateToStr(DTPEndWorks.Date)+chr(
39)+',');
IBQExecSQL.SQL.Append('DateFrom='+chr(39)+DateToStr(DTPBegin.Date)+chr(39)+',');
IBQExecSQL.SQL.Append('DateTo='+chr(39)+DateToStr(DTPEnd.Date)+chr(39)+',');
IBQExecSQL.SQL.Append('CountDays='+IntToStr(CountDays)+',');
IB QExec S QL .S QL .Append('NumberOrder='+chr(39)+Trim(EditNumberOrder.Text)+chr(39)
+',');
IBQExecSQL.SQL.Append('DateOrder='+chr(39)+DateToStr(DTPOrder.Date)+chr(39));
IBQExecSQL.SQL.Append('Where ID='+IntToStr(RecSave));
end;
IBQExecSQL.ExecSQL;
IBQFurloughs.Close;
IBQFurloughs.Open;
IBQFurloughs.Locate('ID',RecSave,[loCaseInsensitive]);
FEditFurloughs.Close;
end;
VK_ESCAPE: FEditFurloughs.Close;
end;
end;
procedure TFEditFurloughs.FormClose(Sender: TObject;
var Action: TCloseAction);
begin
FEditEmployers.Enabled:=True;
end;
end.
unit EditFormations;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, ComCtrls, ExtCtrls, StdCtrls, DB, Mask;
type
TFEditFormations = class(TForm)
LabelProfession: TLabel;
LabelInstitution: TLabel;
LabelQualification: TLabel;
LabelSerialDoc: TLabel;
LabelNumberDoc: TLabel;
LabelYearEnd: TLabel;
EditProfession: TEdit;
EditQualification: TEdit;
EditSerialDoc: TEdit;
EditNumberDoc: TEdit;
PanelEditFormation: TPanel;
SBEditFormation: TStatusBar;
EditInstitution: TEdit;
MaskEditYearEnd: TMaskEdit;
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
FEditFormations: TFEditFormations;
FormationAdd:Boolean;
implementation
uses EditEmployers, DataModule, Main;
{$R *.dfm}
procedure TFEditFormations.FormActivate(Sender: TObject);
begin
Left:=Round((GetSystemMetrics(SM_CXSCREEN)-Width)/2);
Top:=Round((GetSystemMetrics(SM_CYSCREEN)-Height)/2);
with DM do
if FormationAdd then begin
EditInstitution.Text:-';
EditProfessi on.Text:='';
EditQualification.Text:-';
EditSerialDoc.Text:-';
EditNumberDoc .Text:='';
MaskEditYearEnd.Text:=Copy(DateToStr(Date()),7,4);
end else begin
EditInstitution.Text:=Trim(IBQFormationsInstitution.AsString);
EditProfession.Text:=Trim(IBQFormationsProfession.AsString);
EditQualification.Text:=Trim(IBQFormationsQualification.AsString);
EditSerialDoc.Text:=Trim(IBQFormationsSerialDoc.AsString);
EditNumberDoc.Text:=Trim(IBQFormationsNumberDoc.AsString);
MaskEditYearEnd.Text: =IntToStr(IB QF ormati onsYearEnd.AsInteger);
end;
EditInstitution.SetFocus;
end;
procedure TFEditFormations.FormClose(Sender: TObject;
var Action: TCloseAction);
begin
FEditEmployers.Enabled:=True;
end;
procedure TFEditFormations.FormKeyDown(Sender: TObject; var Key: Word;
Shift: TShiftState);
var RecSave:LongInt;
YearEnd:Integer;
Stroka:String;
begin
with DM do
case key of
VK_RETURN: begin
Stroka :=MaskEditYearEnd.Text;
if AllTrim(Stroka)=M then
YearEnd:=StrToInt(Copy(DateToStr(Date()),7,4))
else Y earEnd:=StrT oInt(AllTrim(Stroka));
if FormationAdd then begin
IBQID.SQL.Clear;
IBQID.SQL.Append('select Gen_ID(ID_Formations,0) from Formations');
IBQID.Open;
RecSave:=IBQIDGen_ID.AsInteger+1;
IBQID.Close;
IBQExecSQL.SQL.Clear;
IBQExecSQL.SQL.Append('Insert into Formations (Employers,');
IB QExec S QL .SQL.Append('Institution,');
IBQExecSQL.SQL.Append('Profession,');
IBQExecSQL.SQL.Append('Qualification,');
IBQExecSQL.SQL.Append('SerialDoc,');
IBQExecSQL.SQL.Append('NumberDoc,');
IBQExecSQL.SQL.Append('YearEnd)');
IBQExecSQL.SQL.Append('Values ('+IntToStr(IBQEmployersID.AsInteger)+',');
IBQExecSQL.SQL.Append(chr(39)+Trim(EditInstitution.Text)+chr(39)+',');
IBQExecSQL.SQL.Append(chr(39)+Trim(EditProfession.Text)+chr(39)+',');
IB QExec S QL .S QL .Append(chr(39)+Trim(EditQualification.Text)+chr(39)+',');
IB QExec S QL .S QL .Append(chr(39)+Trim(EditSerialDoc.Text)+chr(39)+',');
IBQExecSQL.SQL.Append(chr(39)+Trim(EditNumberDoc.Text)+chr(39)+',');
IB QExec S QL .S QL .Append(IntToStr(YearEnd)+')');
end else begin
RecSave:=IB QF ormati onsID.AsInteger;
IBQExecSQL.SQL.Clear;
IBQExecSQL.SQL.Append('Update Formations');
IB QExec S QL S QL Append('Set
Institution='+chr(39)+Trim(EditInstitution.Text)+chr(39)+',');
IBQExecSQL.SQL.Append('Profession='+chr(39)+Trim(EditProfession.Text)+chr(39)+',');
IBQExecSQL.SQL.Append('Qualification='+chr(39)+Trim(EditQualification.Text)+chr(39)+'
,');
IBQExecSQL.SQL.Append('SerialDoc='+chr(39)+Trim(EditSerialDoc.Text)+chr(39)+',');
IBQExecSQL.SQL.Append('NumberDoc='+chr(39)+Trim(EditNumberDoc.Text)+chr(39)+','
);
IB QExec S QL .S QL .Append('YearEnd='+IntToStr(YearEnd));
IBQExecSQL.SQL.Append('where ID='+IntToStr(RecSave));
end;
IBQExecSQL.ExecSQL;
IBQFormations.Close;
IBQFormations.Open;
IBQFormations.Locate('ID',RecSave,[loCaseInsensitive]);
FEditFormations.Close;
{ end;}
end;
VK_ESCAPE: FEditFormations.Close;
end;
end;
end.
unit EditFamilys;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, ComCtrls, StdCtrls, ExtCtrls, DB;
type
TFEditFamilys = class(TForm)
Источник: https://baza.diplomsite.ru/previewfile/2244