Автор работы: Пользователь скрыл имя, 12 Октября 2013 в 02:17, курсовая работа
Ведется учет продажи ж/д билетов. По каждому поезду известны: номер, тип поезда (экспресс, скорый, пассажирский), пункт назначения, дата и время отправления.
Поезда включают вагоны разных типов: код, наименование (плацкарт, купе, и т.д.), пассажировместимость.
При продаже билетов учитывается: фамилия И.О. пассажира, номер удостоверения личности, дата отправления, номер поезда, номер вагона, тип вагона, номер места, стоимость билета.
1. Проектирование базы данных 4
2. Описание программного проекта 7
3. Описание алгоритма формирования отчета 9
4. Руководство программиста 13
5. Руководство пользователя 14
6. Описание контрольного примера 19
7. Текст программы 22
8. Выводы 38
Список использованных источников
dm.tblBook.FieldByName('bilet'
else if (dm.tblBook.FieldByName('N_
dm.tblBook.FieldByName('bilet'
else if (dm.tblBook.FieldByName('N_
dm.tblBook.FieldByName('bilet'
end;
if (dm.tblBook.FieldByName('N_
begin
if (dm.tblBook.FieldByName('N_
dm.tblBook.FieldByName('bilet'
else if (dm.tblBook.FieldByName('N_
dm.tblBook.FieldByName('bilet'
else if (dm.tblBook.FieldByName('N_
dm.tblBook.FieldByName('bilet'
else if (dm.tblBook.FieldByName('N_
dm.tblBook.FieldByName('bilet'
end;
if (dm.tblBook.FieldByName('N_
begin
if (dm.tblBook.FieldByName('N_
dm.tblBook.FieldByName('bilet'
else if (dm.tblBook.FieldByName('N_
dm.tblBook.FieldByName('bilet'
else if (dm.tblBook.FieldByName('N_
dm.tblBook.FieldByName('bilet'
else if (dm.tblBook.FieldByName('N_
dm.tblBook.FieldByName('bilet'
end;
if (dm.tblBook.FieldByName('N_
begin
if (dm.tblBook.FieldByName('N_
dm.tblBook.FieldByName('bilet'
else if (dm.tblBook.FieldByName('N_
dm.tblBook.FieldByName('bilet'
else if (dm.tblBook.FieldByName('N_
dm.tblBook.FieldByName('bilet'
else if (dm.tblBook.FieldByName('N_
dm.tblBook.FieldByName('bilet'
end;
end;
procedure TDM.DataModuleCreate(Sender: TObject);
begin
end;
end. Исходный текст модуля uSprBuyer:
unit uSprBuyer;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, Buttons, Grids, DBGrids, DBCtrls, ExtCtrls;
type
TSprBuyer = class(TForm)
Panel1: TPanel;
DBNavigator1: TDBNavigator;
DBGrid1: TDBGrid;
sbAdd: TSpeedButton;
sbEdit: TSpeedButton;
procedure sbAddClick(Sender: TObject);
procedure sbEditClick(Sender: TObject);
procedure FormShow(Sender: TObject);
procedure FormCreate(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
SprBuyer: TSprBuyer;
implementation
uses uDM,uEdSprBuyer;
{$R *.dfm}
procedure TSprBuyer.sbAddClick(Sender: TObject);
begin
dm.tblBuyer.Insert;
with TEdSprBuyer.Create(
try if ShowModal = mrOk then
dm.tblBuyer.Post
else
dm.tblBuyer.Cancel
finally
free
end;
end;
procedure TSprBuyer.sbEditClick(Sender: TObject);
begin
dm.tblBuyer.Edit;
with TEdSprBuyer.Create(
try if ShowModal = mrOk then
dm.tblBuyer.Post
else
dm.tblBuyer.Cancel
finally
free
end;
end;
procedure TSprBuyer.FormShow(Sender: TObject);
begin
if not dm.tblBuyer.Active then
dm.tblBuyer.Open;
end;
Исходный текст модуля uSprGroup;
unit uSPRV;
unit uSPRVizmdob;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, DBCtrls, Grids, DBGrids, ExtCtrls, StdCtrls;
type
TfrmSPRVizmdob = class(TForm)
Panel1: TPanel;
DBGrid1: TDBGrid;
DBNavigator1: TDBNavigator;
Button1: TButton;
Button2: TButton;
procedure Button1Click(Sender: TObject);
procedure Button2Click(Sender: TObject);
procedure FormCreate(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
frmSPRVizmdob:TfrmSPRVizmdob;
implementation
uses uDM, uSPRVsohr;
{$R *.dfm}
procedure TfrmSPRVizmdob.Button1Click(
begin
DM.tblSPRV.Insert;
with TfrmSPRVsohr.Create(
try;
if Showmodal = mrOk then DM.tblSPRV.post
else DM.tblSPRV.Cancel;
finally free
end
end;
procedure TfrmSPRVizmdob.Button2Click(
begin
DM.tblSPRV.Edit ;
with TfrmSPRVsohr.Create(
try;
if showmodal=mrOk then DM.tblSPRV.Post
finally free end
end;
procedure TfrmSPRVizmdob.FormCreate(
begin
end;
end.
Исходный текст модуля uSPRP:
unit uSPRPizmdob;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, DBCtrls, Grids, DBGrids, ExtCtrls, StdCtrls;
type
TfrmSPRPizmdob = class(TForm)
Panel1: TPanel;
DBGrid1: TDBGrid;
DBNavigator1: TDBNavigator;
Button1: TButton;
Button2: TButton;
procedure Button1Click(Sender: TObject);
procedure Button2Click(Sender: TObject);
procedure FormCreate(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
frmSPRPizmdob:TfrmSPRPizmdob;
implementation
uses uDM, uSPRPsohr;
{$R *.dfm}
procedure TfrmSPRPizmdob.Button1Click(
begin
DM.tblSPRP.Insert;
with TfrmSPRPsohr.Create(
try;
if Showmodal = mrOk then DM.tblSPRP.post
else DM.tblSPRP.Cancel;
finally free
end
end;
procedure TfrmSPRPizmdob.Button2Click(
begin
DM.tblSPRP.Edit ;
with TfrmSPRPsohr.Create(
try;
if showmodal=mrOk then DM.tblSPRP.Post
finally free end
end;
procedure TfrmSPRPizmdob.FormCreate(
begin
end;
end.
Исходный текст модуля uBook:
unit uBook;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, ComCtrls, Menus, ExtCtrls, DBCtrls, Grids, DBGrids, StdCtrls,
Buttons;
type
TfrmBook = class(TForm)
Panel1: TPanel;
MainMenu1: TMainMenu;
PageControl1: TPageControl;
TabSheet1: TTabSheet;
TabSheet2: TTabSheet;
TabSheet3: TTabSheet;
DBNavigator1: TDBNavigator;
GroupBox1: TGroupBox;
GroupBox2: TGroupBox;
GroupBox3: TGroupBox;
GroupBox4: TGroupBox;
GroupBox5: TGroupBox;
GroupBox6: TGroupBox;
GroupBox7: TGroupBox;
GroupBox8: TGroupBox;
Button1: TButton;
Button2: TButton;
Button3: TButton;
Edit1: TEdit;
Edit2: TEdit;
Edit3: TEdit;
CheckBox1: TCheckBox;
CheckBox2: TCheckBox;
Edit4: TEdit;
Edit5: TEdit;
Edit6: TEdit;
DBGrid1: TDBGrid;
SpeedButton1: TSpeedButton;
SpeedButton2: TSpeedButton;
BitBtn1: TBitBtn;
Edit7: TEdit;
Edit8: TEdit;
Edit9: TEdit;
Edit10: TEdit;
Edit11: TEdit;
Button4: TButton;
Button5: TButton;
N1: TMenuItem;
N2: TMenuItem;
N3: TMenuItem;
SPRV1: TMenuItem;
SPRP1: TMenuItem;
N4: TMenuItem;
Label2: TLabel;
Label1: TLabel;
N5: TMenuItem;
Label3: TLabel;
Label4: TLabel;
Label5: TLabel;
Label6: TLabel;
Label7: TLabel;
Label8: TLabel;
procedure Button1Click(Sender: TObject);
procedure Button2Click(Sender: TObject);
procedure Button3Click(Sender: TObject);
procedure SpeedButton1Click(Sender: TObject);
procedure SpeedButton2Click(Sender: TObject);
procedure BitBtn1Click(Sender: TObject);
procedure Button4Click(Sender: TObject);
procedure Button5Click(Sender: TObject);
procedure SPRV1Click(Sender: TObject);
procedure SPRP1Click(Sender: TObject);
procedure N5Click(Sender: TObject);
procedure FormShow(Sender: TObject);
procedure FormCreate(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
frmBook: TfrmBook;
implementation
Uses uDM, uRPT,db,uSPRVizmdob, uSPRPizmdob, uRPTcnfg;
var Loc: TLocateOptions;
Kol_bil:integer;
{$R *.dfm}
procedure TfrmBook.Button1Click(Sender: TObject);
begin
if edit1.Text='' then begin
showmessage('Не задан параметр поиска');
exit;
end
else DM.tblBook.Indexname:='N_
if not (DM.tblBook.FindKey([edit1.
end;
procedure TfrmBook.Button2Click(Sender: TObject);
begin
if edit2.Text='' then begin
showmessage('Не задан параметр поиска');
exit;
end
else DM.tblBook.Indexname:='Dat_
DM.tblBook.FindNearest([edit2.
end;
procedure TfrmBook.Button3Click(Sender: TObject);
begin
Loc:=[];
if not CheckBox1.Checked then Loc:=Loc+[loCaseInsensitive];
if Checkbox2.Checked then Loc:=Loc+[loPartialKey];
if edit2.Text='' then begin
showmessage('Не задан параметр поиска');
exit;
end
else if not DM.tblBook.Locate('FIO_pas',
showmessage('Указанное значение не найдено');
end;
procedure TfrmBook.SpeedButton1Click(
begin
if not (Sender as TSpeedButton).Down then begin
DM.tblBook.Filter:='';
dm.tblBook.Filtered:=False;
edit4.Clear;
end else begin
//включение фильтра
if edit4.Text='' then begin
showmessage('Не задан параметр фильтрации');
(Sender as TSpeedButton).Down:= not (Sender as TSpeedButton).Down;
exit end;
dm.tblbook.Filter:='N_mesta='+
dm.tblBook.Filtered:=true;
end;
if SpeedButton2.Down then dm.tblBook.Filtered:=true;
end;
procedure TfrmBook.SpeedButton2Click(
begin
if not (Sender as TSpeedButton).Down then begin
edit5.Clear;
uDM.Filt:='';
DM.tblBook.Filtered:=False;
end else begin
//включение фильтра
if edit5.Text='' then begin
showmessage('Не задан параметр фильтрации');
(Sender as TSpeedButton).Down:= not (Sender as TSpeedButton).Down;
exit end;
uDM.Filt:=edit5.Text ;
DM.tblBook.Filtered:=true;
end;
if speedButton1.Down then DM.tblBook.Filtered:=true;
end;
procedure TfrmBook.BitBtn1Click(Sender: TObject);
begin
if (Sender as TBitBtn).Caption='Выбрать' then begin
DM.tblBook.IndexName:='N_
if(((trim(copy(edit6.Text,1,2)
showmessage('Условие задано неверно или не задано');
exit
end;
if(trim(copy(edit6.Text,1,2))=
else if(trim(copy(edit7.Text,1,2))=