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

Внимание! Если размещение файла нарушает Ваши авторские права, то обязательно сообщите нам
DTPChange.Date:=IBQChangeFIODateChange.AsDateTime;
EditFamilyNew.Text:=Trim(IBQChangeFIOFamilyNew.AsString);
EditNameNew.Text:=Trim(IBQChangeFIONameNew.AsString);
EditFathersNew.Text:=Trim(IBQChangeFIOFathersNew.AsString);
EditBasis.Text:=Trim(IBQChangeFIOBasis.AsString);
EditNote.Text:=Trim(IBQChangeFIONote.AsString);
end;
DTPChange.SetFocus;
end;
procedure TFEditChangesFIO.FormClose(Sender: TObject;
var Action: TCloseAction);
begin
FEditEmployers.Enabled:=True;
end;
procedure TFEditChangesFIO.FormKeyDown(Sender: TObject; var Key: Word;
Shift: TShiftState);
var RecSave:LongInt;
begin
with DM do
case key of
13: begin
if ChangeFIOAdd then begin
IBQID.SQL.Clear;
IBQID.SQL.Append('select Gen_ID(ID_ChangeFIO,0) from ChangeFIO');
IBQID.Open;
RecSave:=IBQIDGen_ID.AsInteger+1;
IBQID.Close;
IBQExecSQL.SQL.Clear;
IBQExecSQL.SQL.Append('Insert into ChangeFIO (Employers,');
IBQExecSQL.SQL.Append('DateChange,');
IB QExec S QL .S QL .Append('FamilyN ew,');
IB QExec S QL .S QL .Append('N ameN ew,');
IB QExec S QL .S QL .Append('F athersNew,');
IBQExecSQL.SQL.Append('Basis,');
IBQExecSQL.SQL.Append('Note)');
IBQExecSQL.SQL.Append('Values ('+IntToStr(IBQEmployersID.AsInteger)+',');
IBQExecSQL.SQL.Append(chr(39)+DateToStr(DTPChange.Date)+chr(39)+',');
IBQExecSQL.SQL.Append(chr(39)+Trim(EditFamilyNew.Text)+chr(39)+',');
IB QExec S QL .S QL. Append(chr(39)+Trim(EditNameNew.Text)+chr(39)+',');
IB QExec S QL .S QL .Append(chr(39)+Trim(EditF athersN ew.T ext)+chr(39)+',');
IBQExecSQL.SQL.Append(chr(39)+Trim(EditBasis.Text)+chr(39)+',');
IBQExecSQL.SQL.Append(chr(39)+Trim(EditNote.Text)+chr(39)+')');
end else begin
RecSave :=IBQChangeFIOID.AsInteger;
IBQExecSQL.SQL.Clear;
IBQExecSQL.SQL.Append('Update ChangeFIO');
IB QExec S QL S QL Append('Set
DateChange='+chr(39)+DateToStr(DTPChange.Date)+chr(39)+',');
IBQExecSQL.SQL.Append('FamilyNew='+chr(39)+Trim(EditFamilyNew.Text)+chr(39)+',');
IBQExecSQL.SQL.Append('NameNew='+chr(39)+Trim(EditNameNew.Text)+chr(39)+',');
IBQExecSQL.SQL.Append('FathersNew='+chr(39)+Trim(EditFathersNew.Text)+chr(39)+',')
;
IBQExecSQL.SQL.Append('Basis='+chr(39)+Trim(EditBasis.Text)+chr(39)+',');
IB QExec S QL .S QL .Append('Note='+chr(39)+Trim(EditNote .Text)+chr(39));
end;
IBQExecSQL.ExecSQL;
IBQChangeFIO.Close;
IBQChangeFIO.Open;
IBQChangeFIO.Locate('ID',RecSave,[loCaseInsensitive]);
FEditChangesFIO.Close;
end;
27: FEditChangesFIO.Close;
end;
end;
end.
unit EditBookWorks;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, ComCtrls, StdCtrls, ExtCtrls, DB;
type
TFEditBookWorks = class(TForm)
PanelWorkBooks: TPanel;
SBEditWorkBooks: TStatusBar;
LabelDateOrder: TLabel;
DTPOrder: TDateTimePicker;
LabelBegin: TLabel;
DTPBegin: TDateTimePicker;
CBPedagogs: TCheckBox;
CBDateEnd: TCheckBox;
CBSpecial: TCheckBox;
DTPEnd: TDateTimePicker;
EditOrder: TEdit;
LabelJobTitle: TLabel;
LabelEnterprises: TLabel;
LabelNumberOrder: TLabel;
EditEnterprises: TEdit;
EditProfession: TEdit;
LabelProfession: TLabel;
LabelQualification: TLabel;
EditQualification: TEdit;
EditJobTitle: TEdit;
CBKxmt: TCheckBox;
EditDiploma: TEdit;
LabelDiploma: TLabel;
EditNote: TEdit;
LabelNote: TLabel;
procedure FormActivate(Sender: TObject);
procedure FormKeyDown(Sender: TObject; var Key: Word;
Shift: TShiftState);
procedure FormClose(Sender: TObject; var Action: TCloseAction);
procedure CBDateEndClick(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
FEditBookWorks: TFEditBookWorks;
BookWorkAdd:Boolean;
implementation
uses DataModule, EditEmployers;
{$R *.dfm}
procedure TFEditBookWorks.FormActivate(Sender: TObject);
begin
Left:=Round((GetSystemMetrics(SM_CXSCREEN)-Width)/2);
Top:=Round((GetSystemMetrics(SM_CYSCREEN)-Height)/2);
with DM do begin
DTPEnd.Date:=Trunc(Date);
if BookWorkAdd then begin
EditEnterprises.Text:-';
EditProfession.Text:='';
EditQualification.Text:='';
EditJobTitle.Text:='';
EditDiploma.Text:='';
EditNote.Text:-';
DTPOrder.Date:=Trunc(Date());
EditOrder.Text:='';
DTPBegin.Date:=Trunc(Date());
DTPEnd.Date:=Trunc(Date());
CBPedagogs.Checked:=False;
CB Special.Checked:=False;
CBKxmt.Checked:=False;
CBDateEnd.Checked:=True;
end else begin
EditEnterprises.Text:=Trim(IBQBookWorksEnterPrises.AsString);
EditProfession.Text:=Trim(IBQBookWorksProfession.AsString);
EditQualification.Text:=Trim(IBQBookWorksQualification.AsString);
EditJobTitle.Text:=Trim(IBQBookWorksJobTitle.AsString);
EditDiploma.Text:=Trim(IBQBookWorksDiploma.AsString);
EditNote .Text:=Trim(IB QB ookW orksN ote.AsString);
DTPOrder.Date:=Trunc(IBQBookWorksDateOrder.AsDateTime);
EditOrder.Text:=Trim(IBQBookWorksOrderNumber.AsString);
DTPBegin.Date:=Trunc(IBQBookWorksDateFrom.AsDateTime);
if IBQBookWorksDateTo.AsDateTime=0 then begin
CBDateEnd.Checked:=False;
DTPEnd.Visible:=False;
end else begin
CBDateEnd.Checked:=T rue;
DTPEnd.Visible:=True;
DTPEnd.Date:=Trunc(IBQBookWorksDateTo.AsDateTime);
end;
if IBQBookWorksPedagogical.AsInteger=1 then CBPedagogs.Checked:=True
else CBPedagogs.Checked:=False;
if IBQBookWorksSpecial.AsInteger=1 then CBSpecial.Checked:=True
else CBSpecial.Checked:=False;
if IBQBookWorksKxmt.AsInteger=1 then CBKxmt.Checked:=True
else CBKxmt.Checked:=False;
end;
EditEnterPrises.SetFocus;
end;
procedure TFEditBookWorks.FormKeyDown(Sender: TObject; var Key: Word;
Shift: TShiftState);
var RecSave:LongInt;
begin
with DM do
case key of
13: begin
if BookWorkAdd then begin
IBQID.SQL.Clear;
IBQID.SQL.Append('select Gen_ID(ID_BookWorks,0) from BookWorks');
IBQID.Open;
RecSave:=IBQIDGen_ID. AsInteger+1;
IBQID.Close;
IBQExecSQL.SQL.Clear;
IBQExecSQL.SQL.Append('Insert into BookWorks (Employers,');
IBQExecSQL.SQL.Append('EnterPrises,');
IBQExecSQL.SQL.Append('Profession,');
IBQExecSQL.SQL.Append('Qualification,');
IBQExecSQL.SQL.Append('JobTitle,');
IBQExecSQL.SQL.Append('Diploma,');
IBQExecSQL.SQL.Append('Note,');
IBQExecSQL.SQL.Append('DateOrder,');
IBQExecSQL.SQL.Append('OrderNumber,');
IBQExecSQL.SQL.Append('DateFrom,');
IBQExecSQL.SQL.Append('DateTo,');
IBQExecSQL.SQL.Append('Pedagogical,');
IBQExecSQL.SQL.Append('Special,');
IBQExecSQL.SQL.Append('Kxmt)');
IBQExecSQL.SQL.Append('Values ('+IntToStr(IBQEmployersID.AsInteger)+',');
IBQExecSQL.SQL.Append(chr(39)+Trim(EditEnterPrises.Text)+chr(39)+',');
IBQExecSQL.SQL.Append(chr(39)+Trim(EditProfession.Text)+chr(39)+',');
IBQExecSQL.SQL.Append(chr(39)+Trim(EditQualification.Text)+chr(39)+',');
IBQExecSQL.SQL.Append(chr(39)+Trim(EditJobTitle.Text)+chr(39)+',');
IBQExecSQL.SQL.Append(chr(39)+Trim(EditDiploma.Text)+chr(39)+',');
IB QExecSQL .SQL.Append(chr(39)+Trim(EditNote .Text)+chr(39)+',');
IBQExecSQL.SQL.Append(chr(39)+DateToStr(DTPOrder.Date)+chr(39)+',');
IBQExecSQL.SQL.Append(chr(39)+Trim(EditOrder.Text)+chr(39)+',');
IBQExecSQL.SQL.Append(chr(39)+DateToStr(DTPBegin.Date)+chr(39)+',');
if CBDateEnd.Checked=False then DTPEnd.DateTime:=0;
IBQExecSQL.SQL.Append(chr(39)+DateToStr(DTPEnd.Date)+chr(39)+',');
if CBPedagogs.Checked then IBQExecSQL.SQL.Append('1,')
else IBQExecSQL.SQL.Append('0,');
if CBSpecial.Checked then IBQExecSQL.SQL.Append('1,')
else IBQExecSQL.SQL.Append('0,');
if CBKxmt.Checked then IBQExecSQL.SQL.Append('1)')
else IBQExecSQL.SQL.Append('0)');
end else begin
RecSave:=IB QBookW orksID.AsInteger;
IBQExecSQL.SQL.Clear;
IBQExecSQL.SQL.Append('Update BookWorks');
IBQExecSQL.SQL.Append('Set
EnterPrises='+chr(39)+T rim(EditEnterPrises.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('JobTitle='+chr(39)+Trim(EditJobTitle.Text)+chr(39)+',');
IBQExecSQL.SQL.Append('Diploma='+chr(39)+Trim(EditDiploma.Text)+chr(39)+',');
IBQExecSQL.SQL.Append('Note='+chr(39)+Trim(EditNote.Text)+chr(39)+',');
IBQExecSQL.SQL.Append('DateOrder='+chr(39)+DateToStr(DTPOrder.Date)+chr(39)+',');
IBQExecSQL.SQL.Append('OrderNumber='+chr(39)+Trim(EditOrder.Text)+chr(39)+',');
IBQExecSQL.SQL.Append('DateFrom='+chr(39)+DateToStr(DTPBegin.Date)+chr(39)+',');
if CBDateEnd.Checked=False then DTPEnd.DateTime:=0;
IBQExecSQL.SQL.Append('DateTo='+chr(39)+DateToStr(DTPEnd.Date)+chr(39)+',');
if CBPedagogs.Checked then IBQExecSQL.SQL.Append('Pedagogical=1,')
else IBQExecSQL.SQL.Append('Pedagogical=0,');
if CBKxmt.Checked then IBQExecSQL.SQL.Append('Kxmt=1,')
else IBQExecSQL.SQL.Append('Kxmt=0,');
if CBSpecial.Checked then IBQExecSQL.SQL.Append('Special=1')
Источник: https://baza.diplomsite.ru/previewfile/2244