Автоматизована система "Облік паспортних даних"
Курсовой проект - Компьютеры, программирование
Другие курсовые по предмету Компьютеры, программирование
Sender: TObject);
procedure DBNavigator1Click(Sender: TObject; Button: TNavigateBtn);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form2: TForm2;
implementation
uses Unit8, Unit9, Unit10, Unit11;
{$R *.dfm}
function CalculateAge(Birthday, CurrentDate: TDate): Integer;
var
Month, Day, Year, CurrentYear, CurrentMonth, CurrentDay: Word;
begin
DecodeDate(Birthday, Year, Month, Day);
DecodeDate(CurrentDate, CurrentYear, CurrentMonth, CurrentDay);
if (Year = CurrentYear) and (Month = CurrentMonth) and (Day = CurrentDay) then
begin
Result := 0;
end
else
begin
Result := CurrentYear - Year;
if (Month > CurrentMonth) then
Dec(Result)
else
begin
if Month = CurrentMonth then
if (Day > CurrentDay) then
Dec(Result);
end;
end;
end;
procedure TForm2.DBEdit4Change(Sender: TObject);
begin
if length(dbedit4.Text)=10 then
dbedit5.Text:= Format(%d,
[CalculateAge(StrToDate(dbedit4.Text), Date)]);
end;
procedure TForm2.BitBtn1Click(Sender: TObject);
begin
if openpicturedialog1.Execute then
dbimage1.Picture.LoadFromFile(OpenPictureDialog1.FileName);
end;
procedure TForm2.FormCreate(Sender: TObject);
begin
openpicturedialog1.Filter:= (*.bmp;*.ico;*.emf;*.wmf)|*.bmp;*.ico;*.emf;*.wmf;
savepicturedialog1.Filter:=*.bmp|*.bmp;
end;
procedure TForm2.BitBtn2Click(Sender: TObject);
var bm:string;
zv:TBookmark;
begin
zv:=Table1.GetBookmark;
form11.show;
end;
procedure TForm2.Edit1Change(Sender: TObject);
var strField:string;
begin
strField:=Prizvuge;
table1.Locate(strField, Edit1.Text,[loCaseInsensitive,loPartialKey]);
end;
procedure TForm2.BitBtn3Click(Sender: TObject);
var bm:string;
zv:TBookmark;
begin
zv:=Table1.GetBookmark;
form9.QuickRep1.Preview;
end;
procedure TForm2.FormActivate(Sender: TObject);
begin
form2.DBEdit1.SetFocus;
end;
unit vyl;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, DB, DBTables, ExtCtrls, DBCtrls, Grids, DBGrids, StdCtrls, Mask,
jpeg;
type
TForm3 = class(TForm)
DataSource1: TDataSource;
DBGrid1: TDBGrid;
DBNavigator1: TDBNavigator;
Table1: TTable;
DBComboBox1: TDBComboBox;
DBEdit1: TDBEdit;
Image1: TImage;
Label1: TLabel;
Label2: TLabel;
Label3: TLabel;
Label4: TLabel;
Label5: TLabel;
Label6: TLabel;
Label7: TLabel;
Label8: TLabel;
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form3: TForm3;
implementation
{$R *.dfm}
end.
unit Unit4;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, DB,QuickRpt, Grids, DBGrids, DBTables, DBCtrls, StdCtrls, ExtCtrls;
type
TForm4 = class(TForm)
Table1: TTable;
DBGrid2: TDBGrid;
Button1: TButton;
Edit1: TEdit;
DataSource2: TDataSource;
Query11: TQuery;
Label1: TLabel;
DataSource1: TDataSource;
Table1Prizvuge: TStringField;
Table1Imia: TStringField;
Table1Po_batkovi: TStringField;
Table1Rik_nar: TDateField;
Table1Vik: TFloatField;
Table1Stat: TStringField;
Table1Adress: TStringField;
Table1Vylucia: TStringField;
Table1Nom_byd: TFloatField;
Table1Nom_kva: TFloatField;
Table1Ser_pasp: TStringField;
Table1Nom_pasp: TFloatField;
Table1Data_vud_pasp: TDateField;
Table1Kum_vud_pasp: TStringField;
Table1Viiskovo_zobov: TStringField;
Table1Photo: TGraphicField;
Table1Pensioner: TStringField;
procedure Button1Click(Sender: TObject);
procedure FormCreate(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form4: TForm4;
implementation
uses p_st, Unit8, pasp_st, Unit9;
{$R *.dfm}
procedure TForm4.Button1Click(Sender: TObject);
var fam: string[30];
begin
fam:=edit1.Text;
dbgrid2.Visible:=true;
if fam <>
then
begin
with form4.Query11 do begin
Close;
SQL.Clear;
SQL.Add(SELECT prizvuge,Imia, po_batkovi, rik_nar,vik, Stat,adress, vylucia, Nom_byd, nom_kva,ser_pasp,nom_pasp,data_vud_pasp, kum_vud_pasp,viiskovo_zobov);
SQL.Add(FROM Pasp_st.db);
SQL.Add(WHERE Prizvuge= "+ fam + ");
Open;
end;
form4.Query11.DataSource:=form4.DataSource1;
Form4.DataSource2.DataSet:=form4.Query11;
form4.DBGrid2.DataSource:=form4.DataSource2;
end;
end;
procedure TForm4.FormCreate(Sender: TObject);
begin
form4.Table1.Refresh;
end;
end.
unit Unit5;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, Buttons, Grids, DBGrids, DBTables, DB, ExtCtrls,
DBCtrls;
type
TForm5 = class(TForm)
Label1: TLabel;
Edit1: TEdit;
DataSource1: TDataSource;
DataSource2: TDataSource;
Table1: TTable;
Query1: TQuery;
DBGrid1: TDBGrid;
BitBtn1: TBitBtn;
Table1Prizvuge: TStringField;
Table1Imia: TStringField;
Table1Po_batkovi: TStringField;
Table1Rik_nar: TDateField;
Table1Vik: TFloatField;
Table1Stat: TStringField;
Table1Adress: TStringField;
Table1Vylucia: TStringField;
Table1Nom_byd: TFloatField;
Table1Nom_kva: TFloatField;
Table1Ser_pasp: TStringField;
Table1Nom_pasp: TFloatField;
Table1Data_vud_pasp: TDateField;
Table1Kum_vud_pasp: TStringField;
Table1Viiskovo_zobov: TStringField;
Table1Photo: TGraphicField;
Table1Pensioner: TStringField;
procedure BitBtn1Click(Sender: TObject);
procedure FormCreate(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form5: TForm5;
implementation
uses Unit4;
{$R *.dfm}
procedure TForm5.BitBtn1Click(Sender: TObject);
var fam: string;
begin
dbgrid1.Visible:=true;
fam:=edit1.Text;
if fam <>
then
begin
with form5.Query1 do begin
Close;
SQL.Clear;
SQL.Add(SELECT prizvuge,Imia, po_batkovi, rik_nar,vik, Stat,adress, vylucia, Nom_byd, nom_kva,ser_pasp,nom_pasp,data_vud_pasp, kum_vud_pasp,viiskovo_zobov );
SQL.Add(FROM Pasp_st.db);
SQL.Add(WHERE vylucia= "+ fam + ");
Open;
end;
form5.Query1.DataSource:=form5.DataSource1;
Form5.DataSource2.DataSet:=form5.Query1;
form5.DBGrid1.DataSource:=form5.DataSource2;
end;
end;
procedure TForm5.FormCreate(Sender: TObject);
begin
form5.Table1.Refresh;
end;
end.
unit Unit6;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, DB, DBTables, Grids, DBGrids, StdCtrls, Buttons;
type
TForm6 = class(TForm)
DBGrid1: TDBGrid;
Table1: TTable;
Query1: TQuery;
DataSource1: TDataSource;
DataSource2: TDataSource;
Edit1: TEdit;
BitBtn1: TBitBtn;
Table1Prizvuge: TStringField;
Table1Imia: TStringField;
Table1Po_batkovi: TStringField;
Table1Rik_nar: TDateField;
Table1Vik: TFloatField;
Table1Stat: TStringField;
Table1Adress: TStringField;
Table1Vylucia: TStringField;
Table1Nom_byd: TFloatField;
Table1Nom_kva: TFloatField;
Table1Ser_pasp: TStringField;
Table1Nom_pasp: TFloatField;
Table1Data_vud_pasp: TDateField;
Table1Kum_vud_pasp: TStringField;
Table1Viiskovo_zobov: TStringField;
Table1Photo: TGraphicField;
Table1Pensioner: TStringField;
Label1: TLabel;
Button1: TButton;
procedure BitBtn1Click(Sender: TObject);
procedure Button1Click(Sender: TObject);
procedure FormCreate(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form6: TForm6;
implementation
uses Unit9, Unit8;
{$R *.dfm}
procedure TForm6.BitBtn1Click(Sender: TObject);
var fam,fam1: string[30];
begin
form6.DBGrid1.Visible:=true;
fam:=;
with form6.Query1 do begin
Close;
SQL.Clear;
SQL.Add(SELECT prizvuge,Imia, po_batkovi, rik_nar,vik, Stat,adr