Читайте также: |
|
3. Информационная система «Отдел кадров»
Функции информационной системы:
· ведения личных дел сотрудников учебного заведения
· формирования запросов на выборку информации по личным делам
· печать приказов
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, Menus;
type
TForm1 = class(TForm)
MainMenu1: TMainMenu;
N2: TMenuItem;
N3: TMenuItem;
N4: TMenuItem;
N5: TMenuItem;
N6: TMenuItem;
N7: TMenuItem;
N8: TMenuItem;
N9: TMenuItem;
N1: TMenuItem;
N10: TMenuItem;
procedure N5Click(Sender: TObject);
procedure N6Click(Sender: TObject);
procedure N7Click(Sender: TObject);
procedure N8Click(Sender: TObject);
procedure N9Click(Sender: TObject);
procedure N4Click(Sender: TObject);
procedure N2Click(Sender: TObject);
procedure N1Click(Sender: TObject);
procedure N10Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
uses Unit2, Unit3, Unit4, Unit5, Unit7, Unit8, Unit6, Unit12;
{$R *.dfm}
procedure TForm1.N5Click(Sender: TObject);
begin
form4.showmodal;
end;
procedure TForm1.N6Click(Sender: TObject);
begin
form5.showmodal;
end;
procedure TForm1.N7Click(Sender: TObject);
begin
form6.showmodal;
end;
procedure TForm1.N8Click(Sender: TObject);
begin
form7.showmodal;
end;
procedure TForm1.N9Click(Sender: TObject);
begin
form8.showmodal;
end;
procedure TForm1.N4Click(Sender: TObject);
begin
if messagedlg('Закончить работу с программой?', mtconfirmation, [mbyes, mbno],0)=mrYes then
form1.Close;
end;
procedure TForm1.N2Click(Sender: TObject);
begin
form3.showModal;
end;
procedure TForm1.N1Click(Sender: TObject);
begin
form2.ShowModal;
end;
procedure TForm1.N10Click(Sender: TObject);
begin
Form12.ShowModal;
end;
end.
unit Unit2;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, DB, ExtCtrls, DBCtrls, Grids, DBGrids, DBTables, Menus, StdCtrls;
type
TForm2 = class(TForm)
Table1: TTable;
DataSource1: TDataSource;
DBGrid1: TDBGrid;
DBNavigator1: TDBNavigator;
Table2: TTable;
DataSource2: TDataSource;
Table1Id_dela: TFloatField;
Table1FIO: TStringField;
Table1Data_rogd: TDateField;
Table1Sem_pol: TFloatField;
Table1Telefon: TIntegerField;
Table1Data_rab: TDateField;
Table1Sem: TStringField;
DataSource3: TDataSource;
DBGrid2: TDBGrid;
Table3: TTable;
Table3Id_delo: TFloatField;
Table3Id_prikaza: TFloatField;
Table3Data_prik: TDateField;
Table3Type: TFloatField;
Table4: TTable;
DataSource4: TDataSource;
Table3Type_prik: TStringField;
MainMenu1: TMainMenu;
N1: TMenuItem;
procedure DBGrid1DblClick(Sender: TObject);
procedure DBGrid1Enter(Sender: TObject);
procedure DBGrid2Enter(Sender: TObject);
procedure DBGrid2DblClick(Sender: TObject);
procedure N1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form2: TForm2;
implementation
uses Unit9, Unit10, Unit11;
{$R *.dfm}
procedure TForm2.DBGrid1DblClick(Sender: TObject);
begin
if TDBGrid(Sender).SelectedField.DataType = ftDate then
begin
Form9.ShowModal;
if Form9.Bitbtn1.modalresult=mrok then
begin
Table1.Edit;
Table1Data_rogd.Value:=Form9.MonthCalendar1.Date;
Table1.Post;
end;
if Form9.Bitbtn2.modalresult=mrok then
begin
Table1.Edit;
Table1Data_rab.Value:=Form9.MonthCalendar1.Date;
Table1.Post;
end;
end;
end;
procedure TForm2.DBGrid1Enter(Sender: TObject);
begin
DBNavigator1.DataSource:=DataSource1;
end;
procedure TForm2.DBGrid2Enter(Sender: TObject);
begin
DBNavigator1.DataSource:=DataSource3;
end;
procedure TForm2.DBGrid2DblClick(Sender: TObject);
begin
if TDBGrid(Sender).SelectedField.DataType = ftDate then
begin
Form10.ShowModal;
if Form10.showmodal=mrOk then
begin
Table3.Edit;
Table3Data_prik.Value:=Form10.MonthCalendar1.Date;
Table3.Post;
end;
end;
end;
procedure TForm2.N1Click(Sender: TObject);
begin
Form11.ShowModal;
end;
end.
unit Unit3;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, DB, ExtCtrls, DBCtrls, Grids, DBGrids, DBTables;
type
TForm3 = class(TForm)
Table1: TTable;
DataSource1: TDataSource;
DBGrid1: TDBGrid;
DBNavigator1: TDBNavigator;
Table2: TTable;
DataSource2: TDataSource;
Table1Id_dela: TFloatField;
Table1FIO: TStringField;
Table1Data_rogd: TDateField;
Table1Telefon: TIntegerField;
Table1Data_rab: TDateField;
Table1Sem: TStringField;
Table1Sem_pol: TFloatField;
Table3: TTable;
DataSource3: TDataSource;
DBGrid2: TDBGrid;
Table4: TTable;
Table5: TTable;
Table6: TTable;
DataSource4: TDataSource;
DataSource5: TDataSource;
DataSource6: TDataSource;
Table3Id_dela: TFloatField;
Table3Id_rasp: TFloatField;
Table3Stavka: TCurrencyField;
Table3Id_dolg: TFloatField;
Table3Id_kaf: TFloatField;
Table3Id_zvanie: TFloatField;
Table3Dolg: TStringField;
Table3Kaf: TStringField;
Table3Zvanie: TStringField;
procedure DBGridDblClick(Sender: TObject);
procedure DBGrid1Enter(Sender: TObject);
procedure DBGrid3Enter(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form3: TForm3;
implementation
uses Unit9;
{$R *.dfm}
procedure TForm3.DBGridDblClick(Sender: TObject);
begin
if TDBGrid(Sender).SelectedField.DataType = ftDate then
begin
Form9.ShowModal;
if Form9.Bitbtn1.modalresult=mrok then
begin
Table1.Edit;
Table1Data_rogd.Value:=Form9.MonthCalendar1.Date;
Table1.Post;
end;
if Form9.Bitbtn2.modalresult=mrok then
begin
Table1.Edit;
Table1Data_rab.Value:=Form9.MonthCalendar1.Date;
Table1.Post;
end;
end;
end;
procedure TForm3.DBGrid1Enter(Sender: TObject);
begin
DBNavigator1.DataSource:=DataSource1;
end;
procedure TForm3.DBGrid3Enter(Sender: TObject);
begin
DBNavigator1.DataSource:=DataSource3;
end;
end.
unit Unit4;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, ExtCtrls, DBCtrls, Grids, DBGrids, DB, DBTables;
type
TForm4 = class(TForm)
Table1: TTable;
DataSource1: TDataSource;
DBGrid1: TDBGrid;
DBNavigator1: TDBNavigator;
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form4: TForm4;
implementation
{$R *.dfm}
end.
unit Unit5;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, ExtCtrls, DBCtrls, Grids, DBGrids, DB, DBTables;
type
TForm5 = class(TForm)
Table1: TTable;
DataSource1: TDataSource;
DBGrid1: TDBGrid;
DBNavigator1: TDBNavigator;
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form5: TForm5;
implementation
{$R *.dfm}
end.
unit Unit6;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, ExtCtrls, DBCtrls, Grids, DBGrids, DB, DBTables;
type
TForm6 = class(TForm)
Table1: TTable;
DataSource1: TDataSource;
DBGrid1: TDBGrid;
DBNavigator1: TDBNavigator;
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form6: TForm6;
implementation
{$R *.dfm}
end.
unit Unit7;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, ExtCtrls, DBCtrls, Grids, DBGrids, DB, DBTables;
type
TForm7 = class(TForm)
Table1: TTable;
DataSource1: TDataSource;
DBGrid1: TDBGrid;
DBNavigator1: TDBNavigator;
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form7: TForm7;
implementation
{$R *.dfm}
end.
unit Unit8;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, ExtCtrls, DBCtrls, Grids, DBGrids, DB, DBTables;
type
TForm8 = class(TForm)
Table1: TTable;
DataSource1: TDataSource;
DBGrid1: TDBGrid;
DBNavigator1: TDBNavigator;
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form8: TForm8;
implementation
{$R *.dfm}
end.
unit Unit9;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, Buttons, ComCtrls;
type
TForm9 = class(TForm)
MonthCalendar1: TMonthCalendar;
BitBtn1: TBitBtn;
BitBtn2: TBitBtn;
BitBtn3: TBitBtn;
procedure BitBtn1Click(Sender: TObject);
procedure BitBtn2Click(Sender: TObject);
procedure form9Activate(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form9: TForm9;
implementation
{$R *.dfm}
procedure TForm9.BitBtn1Click(Sender: TObject);
begin
bitbtn1.ModalResult:=mrOk;
end;
procedure TForm9.BitBtn2Click(Sender: TObject);
begin
bitbtn2.ModalResult:=mrok;
end;
procedure TForm9.form9Activate(Sender: TObject);
begin
bitbtn1.ModalResult:=mrnone;
bitbtn2.ModalResult:=mrnone;
end;
end.
unit Unit10;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, Buttons, ComCtrls;
type
TForm10 = class(TForm)
MonthCalendar1: TMonthCalendar;
BitBtn1: TBitBtn;
BitBtn2: TBitBtn;
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form10: TForm10;
implementation
{$R *.dfm}
end.
unit Unit11;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, Grids, DBGrids, DB, DBTables, Menus;
type
TForm11 = class(TForm)
Query1: TQuery;
DataSource1: TDataSource;
DBGrid1: TDBGrid;
Query2: TQuery;
DataSource2: TDataSource;
MainMenu1: TMainMenu;
N1: TMenuItem;
N2: TMenuItem;
N3: TMenuItem;
procedure N3Click(Sender: TObject);
procedure N2Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form11: TForm11;
implementation
uses unit2;
{$R *.dfm}
procedure TForm11.N3Click(Sender: TObject);
begin
DBGrid1.DataSource:=DataSource2;
Form11.Caption:='Наибольшая ставка у каждого сотрудника';
end;
procedure TForm11.N2Click(Sender: TObject);
var d: TDate;
begin
form11.DBGrid1.DataSource:=DataSource1;
Form11.Caption:='Сотрудники, поступившие на работу после указанной даты';
d:=strtodate(Inputbox('Укажите дату','Дата',''));
form11.Query1.Close;
form11.Query1.ParamByName('param').value:=d;
form11.Query1.Open;
end;
end.
unit Unit12;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, Grids, DBGrids, DB, DBTables, StdCtrls, ExtCtrls, DBCtrls;
type
TForm12 = class(TForm)
Table1: TTable;
DataSource1: TDataSource;
DBGrid1: TDBGrid;
DBNavigator1: TDBNavigator;
Table2: TTable;
DataSource2: TDataSource;
Table1Id_delo: TFloatField;
Table1Id_prikaza: TFloatField;
Table1Data_prik: TDateField;
Table1Type: TFloatField;
Table1Prikaz: TStringField;
Memo1: TMemo;
Button1: TButton;
Button2: TButton;
OpenDialog1: TOpenDialog;
PrintDialog1: TPrintDialog;
procedure Button1Click(Sender: TObject);
procedure Button2Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form12: TForm12;
implementation
uses Printers;
{$R *.dfm}
procedure TForm12.Button1Click(Sender: TObject);
begin
if OpenDialog1.Execute then
Memo1.Lines.LoadFromFile(OpenDialog1.FileName)
end;
procedure TForm12.Button2Click(Sender: TObject);
var print: TextFile;
k: integer;
begin
AssignPrn(print);
Rewrite(print);
for k:=0 to Memo1.Lines.Count-1 do
WriteLn(print, Memo1.Lines[k]);
CloseFile(print);
end;
end.
Стартовое окно программы.
Пункт меню «Выход»
Пункт меню «Личные дела сотрудников»
Выводится форма, на которой в одной таблице находятся личные дела сотрудников, а в другой отображаются приказы по выбранному личному делу.
По нажатию на пункт меню «Запросы» осуществляется переход на форму, содержащую запросы на выборку информации по личным делам.
Из пункта меню «Выбор запроса» можно выбрать интересующий запрос.
В качестве примера приведено два запроса:
1. Выборка сотрудников, поступивших на работу после указанной даты.
2. Вывод наибольшей ставки по каждому сотруднику.
Пункт меню «Штатное расписание».
По каждому пункту расписания выводится карточка с личным делом данного сотрудника.
Пункт меню «Приказы».
Выводится форма, на которой можно посмотреть список всех приказов, выбрать и просмотреть документ с приказом по его номеру, отправить его не печать.
Пункт меню «Справочники».
Содержит ссылки на различные справочники.
Дата добавления: 2015-07-24; просмотров: 89 | Нарушение авторских прав
<== предыдущая страница | | | следующая страница ==> |
Функции славянизмов в языке Пушкина. | | | Исповедь религиозного фанатика |