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

Внимание! Если размещение файла нарушает Ваши авторские права, то обязательно сообщите нам
PanelFamily: TPanel;
LabelRelatives: TLabel;
LabelFamilys: TLabel;
EditRelatives: TEdit;
LabelDateBirth: TLabel;
SBEditFamily: TStatusBar;
EditFamilys: TEdit;
EditDateBirth: TEdit;
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
FEditFamilys: TFEditFamilys;
FamilyAdd:Boolean;
implementation
uses DataModule, EditEmployers;
{$R *.dfm}
procedure TFEditFamilys.FormActivate(Sender: TObject);
begin
Left:=Round((GetSystemMetrics(SM_CXSCREEN)-Width)/2);
Top:=Round((GetSystemMetrics(SM_CYSCREEN)-Height)/2);
with DM do begin
if FamilyAdd then begin
EditRelatives.Text:='';
EditFamilys.Text:='';
EditDateBirth.Text:=copy(DateToStr(Date()),7,4);
end else begin
EditRelatives.Text:=Trim(IBQFamilyRelatives.AsString);
EditFamilys.Text:=Trim(IBQFamilyFamilys.AsString);
EditDateBirth.Text:=IntToStr(IBQFamilyDateBirth.AsInteger);
end;
EditFamilys.SetFocus;
end;
end;
procedure TFEditFamilys.FormClose(Sender: TObject;
var Action: TCloseAction);
begin
FEditEmployers.Enabled:=T rue;
end;
procedure TFEditFamilys.FormKeyDown(Sender: TObject; var Key: Word;
Shift: TShiftState);
var RecSave,Dig:LongInt;
Continues:Boolean;
begin
with DM do
case key of
13: begin
Continues:=True;
try
Dig:=StrToInt(EditDateBirth.T ext);
except
Continues:=False;
Application.MessageBox('Неправиный формат года
рождения...','Message',MB_OK);
EditDateBirth.Text:=copy(DateToStr(Date()),7,4);
EditDateBirth.Text;
end;
if Continues then begin
if FamilyAdd then begin
IBQID.SQL.Clear;
IBQID.SQL.Append('select Gen_ID(ID_Family,0) from Family');
IBQID.Open;
RecSave:=IBQIDGen_ID. AsInteger+1;
IBQID.Close;
IBQExecSQL.SQL.Clear;
IBQExecSQL.SQL.Append('Insert into Family (Employers,');
IBQExecSQL.SQL.Append('Relatives,');
IBQExecSQL.SQL.Append('Familys,');
IBQExecSQL.SQL.Append('DateBirth)');
IBQExecSQL.SQL.Append('Values ('+IntToStr(IBQEmployersID.AsInteger)+',');
IBQExecSQL.SQL.Append(chr(39)+Trim(EditRelatives.Text)+chr(39)+',');
IBQExecSQL.SQL.Append(chr(39)+Trim(EditFamilys.Text)+chr(39)+',');
IBQExecSQL.SQL.Append(Trim(EditDateBirth.Text)+')');
end else begin
RecSave:=IBQFamilyID.AsInteger;
IBQExecSQL.SQL.Clear;
IBQExecSQL.SQL.Append(Update Family');
IBQExecSQL.SQL.Append('Set
Relatives='+chr(39)+Trim(EditRelatives.Text)+chr(39)+',');
IBQExecSQL.SQL.Append(Tamilys-+chr(39)+Trim(EditFamilys.Text)+chr(39)+7);
IBQExecSQL.SQL.Append('DateBirth='+Trim(EditDateBirth.Text));
IBQExecSQL.SQL.Append('where ID='+IntToStr(RecSave));
end;
IBQExecSQL.ExecSQL;
IBQFamily.Close;
IBQFamily.Open;
IBQFamily.Locate('ID',RecSave,[loCaseInsensitive]);
FEditFamilys.Close;
end;
end;
27: FEditFamilys.Close;
end;
end;
end.
unit EditEnterPrises;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, ComCtrls, ExtCtrls, StdCtrls;
type
TFEditEnterPrises = class(TForm)
PanelEditEnterPrises: TPanel;
SBEditEnterPrises: TStatusBar;
EditEnterPrises: TEdit;
LabelEnterPrises: TLabel;
LabelOKPO: TLabel;
EditOKPO: TEdit;
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
FEditEnterPrises: TFEditEnterPrises;
implementation
uses DataModule, Select;
{$R *.dfm}
procedure TFEditEnterPrises.FormActivate(Sender: TObject);
begin
Left:=Round((GetSystemMetrics(SM_CXSCREEN)-Width)/2);
Top:=Round((GetSystemMetrics(SM_CYSCREEN)-Height)/2);
with DM do begin
if IBQEnterPrises.RecordCount>0 then begin
EditEnterprises.Text:=Trim(IBQEnterprisesName.AsString);
EditOKPO.Text:=Trim(IBQEnterprisesOKPO.AsString);
end else begin
EditEnterprises.Text:='';
EditOKPO.Text:='';
end;
EditEnterPrises.SetFocus;
end;
end;
procedure TFEditEnterPrises.FormClose(Sender: TObject;
var Action: TCloseAction);
begin
with DM do begin
IB QEnterprises.Close;
FSelect.Enabled:=True;
end;
end;
procedure TFEditEnterPrises.FormKeyDown(Sender: TObject; var Key: Word;
Shift: TShiftState);
begin
with DM do
case key of
13: begin
if IBQEnterPrises.RecordCount>0 then begin
IBQExecSQL.SQL.Clear;
IBQExecSQL.SQL.Append('Update EnterPrises');
IB QExec S QL S QL Append('Set
Name='+chr(39)+T rim(EditEnterPrises.Text)+chr(39)+',');
IBQExecSQL.SQL.Append('OKPO='+chr(39)+Trim(EditOKPO.Text)+chr(39));
end else begin
IBQExecSQL.SQL.Clear;
IBQExecSQL.SQL.Append('Insert Into EnterPrises (Name,OKPO)');
IBQExecSQL.SQL.Append('Values ('+chr(39)+Trim(EditEnterPrises.Text)+chr(39)+',');
IBQExecSQL.SQL.Append(chr(39)+Trim(EditOKPO.Text)+chr(39)+')');
end;
IBQExecSQL.ExecSQL;
FEditEnterPrises.Close;
end;
27: FEditEnterPrises.Close;
end;
end;
end.
unit EditEmployers;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, DBCtrls, StdCtrls, Grids, DBGrids, ComCtrls, ExtCtrls, jpeg, DB,
Mask, word2000;
type
TFEditEmployers = class(TForm)
TCEmployer: TTabControl;
SBEditEmployers: TStatusBar;
PanelMain: TPanel;
LabelCode: TLabel;
PanelEmployer: TPanel;
LabelFamily: TLabel;
LabelName: TLabel;
LabelFathers: TLabel;
LabelFloor: TLabel;
LabelBirth: TLabel;
LabelPlaceBirth: TLabel;
LabelMotion: TLabel;
LabelDateAgrement: TLabel;
LabelAgrement: TLabel;
LabelNatureWorks: TLabel;
LabelTypeWorks: TLabel;
LabelCitizenChip: TLabel;
LabelLanguage: TLabel;
EditFamily: TEdit;
EditName: TEdit;
EditFathers: TEdit;
DTPBirth: TDateTimePicker;
CBPlaceBirth: TComboBox;
DBGMotion: TDBGrid;
CBFloor: TComboBox;
DTPAgreement: TDateTimePicker;
EditAgreement: TEdit;
CBNatureWorks: TComboBox;
CBTypeWorks: TComboBox;
PanelPhoto: TPanel;
ImagePhoto: TImage;
CBCitizenchip: TComboBox;
CBLanguage: TComboBox;
CBLoads: TCheckBox;
PanelPrivate: TPanel;
LabelINN: TLabel;
LabelPolis: TLabel;
LabelPension: TLabel;
LabelInsurance: TLabel;
LabelNote: TLabel;
EditNote: TEdit;
EditINN: TEdit;
EditPolis: TEdit;
EditPension: TEdit;
EditInsurance: TEdit;
LabelLoads: TLabel;
GBPasport: TGroupBox;
LabelPasportSerial: TLabel;
EditPasportSerial: TEdit;
LabelPasportNumber: TLabel;
EditPasportNumber: TEdit;
DTPPasport: TDateTimePicker;
Источник: https://baza.diplomsite.ru/previewfile/2244