Автор работы: Пользователь скрыл имя, 27 Мая 2013 в 22:25, курсовая работа
Задача «Абонент АТС» предназначена для автоматизации работы с информацией о поступивших и проданных товарах в магазин.
Задача выполняет основные функции:
ведение базы данных (редактирование данных о товарах);
формирование и выдача на терминал запросов ( об остатке товара на сладе, запросы по поставщикам и клиентам);
формирование и выдача на терминал, а также на печать отчетов (приходная накладная, расходная накладная).
1. Постановка задачи 4
1.1 Характеристика задачи 4
1.2 Выходная информация 5
1.3 Входная информация 13
2. Описание алгоритма решения задачи 14
2.1 Назначение и характеристика 14
2.2 Используемая информация 14
2.3 Результаты решения 14
2.4 Алгоритм решения задачи 15
3. Руководство пользователя 17
3.1 Введение 17
3.2 Назначение и условия применения 17
3.3 Описание операций 17
3.4 Действия при аварийных ситуаци-ях……………………………………...18
4. Руководство системного программиста 19
4.1 Минимальные системные требования 19
4.2 Структура программы 19
4.3 Настройка программы 21
4.4 Проверка программы 21
4.5 Сообщения системному программисту 21
5. Приложение 22
5.1 Листинг программы 22
5.2 Результаты работы программы 39
5.3 Контрольный пример 46
6. Список используемой литерату-ры
procedure DBEdit2KeyPress(Sender: TObject; var Key: Char);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form12: TForm12;
implementation
uses unit4,unit3;
{$R *.dfm}
procedure TForm12.Button1Click(Sender: TObject);
begin
if Unit3.datamodule1.adotableatc.
Unit3.datamodule1.adotableatc.
Close;
end;
procedure TForm12.Button2Click(Sender: TObject);
begin
form12.Close;
end;
procedure TForm12.DBEdit1KeyPress(
begin
if (key <> #8) then
begin
case Key of
'0'..'9': key := key;
else
Key := #0;
end;
end;
end;
procedure TForm12.DBEdit3KeyPress(
begin
if (key <> #8) and (key<>' ') then
begin
case Key of
'а'..'я','А'..'Я','-': key := key;
else
Key := #0;
end;
end;
end;
procedure TForm12.DBEdit2KeyPress(
begin
if (key <> #8) and (key<>' ') then
begin
case Key of
'а'..'я','А'..'Я','0'..'9','-'
else
Key := #0;
end;
end;
end;
end.
unit Unit13;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, Mask, DBCtrls, jpeg, ExtCtrls;
type
TForm13 = class(TForm)
Label2: TLabel;
Label3: TLabel;
Button1: TButton;
Button2: TButton;
DBEdit2: TDBEdit;
DBEdit3: TDBEdit;
Image1: TImage;
procedure Button1Click(Sender: TObject);
procedure Button2Click(Sender: TObject);
procedure DBEdit2KeyPress(Sender: TObject; var Key: Char);
procedure DBEdit3KeyPress(Sender: TObject; var Key: Char);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form13: TForm13;
implementation
uses unit5,unit3;
{$R *.dfm}
procedure TForm13.Button1Click(Sender: TObject);
begin
if Unit3.datamodule1.adotablelg.
Unit3.datamodule1.adotablelg.
Close;
end;
procedure TForm13.Button2Click(Sender: TObject);
begin
form13.Close;
end;
procedure TForm13.DBEdit2KeyPress(
begin
if (key <> #8) and (key<>' ') then
begin
case Key of
'а'..'я','А'..'Я','-': key := key;
else
Key := #0;
end;
end;
end;
procedure TForm13.DBEdit3KeyPress(
begin
if (key <> #8) then
begin
case Key of
'0'..'9',',','.': key := key;
else
Key := #0;
end;
end;
end;
end.
unit Unit14;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, Mask, DBCtrls, jpeg, ExtCtrls;
type
TForm14 = class(TForm)
Label2: TLabel;
Button1: TButton;
Button2: TButton;
DBEdit2: TDBEdit;
Image1: TImage;
procedure Button1Click(Sender: TObject);
procedure Button2Click(Sender: TObject);
procedure DBEdit2KeyPress(Sender: TObject; var Key: Char);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form14: TForm14;
implementation
uses unit6,unit3;
{$R *.dfm}
procedure TForm14.Button1Click(Sender: TObject);
begin
if Unit3.datamodule1.adotablesot.
Unit3.datamodule1.adotablesot.
Close;
end;
procedure TForm14.Button2Click(Sender: TObject);
begin
form14.close;
end;
procedure TForm14.DBEdit2KeyPress(
begin
if (key <> #8) and (key<>' ') then
begin
case Key of
'а'..'я','А'..'Я','-': key := key;
else
Key := #0;
end;
end;
end;
end.
unit Unit15;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, Mask, DBCtrls, jpeg, ExtCtrls;
type
TForm15 = class(TForm)
Label2: TLabel;
Label3: TLabel;
Button1: TButton;
Button2: TButton;
DBEdit2: TDBEdit;
DBEdit3: TDBEdit;
Image1: TImage;
procedure Button1Click(Sender: TObject);
procedure Button2Click(Sender: TObject);
procedure DBEdit1KeyPress(Sender: TObject; var Key: Char);
procedure DBEdit3KeyPress(Sender: TObject; var Key: Char);
procedure DBEdit2KeyPress(Sender: TObject; var Key: Char);
procedure DBEdit2Exit(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form15: TForm15;
implementation
uses unit3,unit7;
{$R *.dfm}
procedure TForm15.Button1Click(Sender: TObject);
begin
if Unit3.datamodule1.adotabletar.
Unit3.datamodule1.adotabletar.
Close;
end;
procedure TForm15.Button2Click(Sender: TObject);
begin
form15.Close;
end;
procedure TForm15.DBEdit1KeyPress(
begin
if (key <> #8) then
begin
case Key of
'0'..'9': key := key;
else
Key := #0;
end;
end;
end;
procedure TForm15.DBEdit3KeyPress(
begin
if (key <> #8) then
begin
case Key of
'0'..'9',',': key := key;
else
Key := #0;
end;
end;
end;
procedure TForm15.DBEdit2KeyPress(
begin
if (key <> #8) and (key<>' ') then
begin
case Key of
'а'..'я','А'..'Я','-': key := key;
else
Key := #0;
end;
end;
end;
procedure TForm15.DBEdit2Exit(Sender: TObject);
var s,a:string;
begin
s:=copy(dbedit2.text, 1, 1);
ansiuppercase(s);
a:=dbedit2.text;
delete(a, 1, 1);
ansilowercase(a);
dbedit2.text:=s+a;
end;
end.
unit Unit16;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, ComCtrls, StdCtrls, Mask, DBCtrls, Buttons, jpeg, ExtCtrls;
type
TForm16 = class(TForm)
Label1: TLabel;
Label2: TLabel;
Label3: TLabel;
BitBtn1: TBitBtn;
BitBtn2: TBitBtn;
DBEdit1: TDBEdit;
MonthCalendar1: TMonthCalendar;
Image1: TImage;
DBLookupComboBox1: TDBLookupComboBox;
DBLookupComboBox2: TDBLookupComboBox;
procedure MonthCalendar1Click(Sender: TObject);
procedure BitBtn1Click(Sender: TObject);
procedure BitBtn2Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form16: TForm16;
implementation
uses unit8,unit3;
{$R *.dfm}
procedure TForm16.MonthCalendar1Click(
begin
dbedit1.Text:=datetostr(
end;
procedure TForm16.BitBtn1Click(Sender: TObject);
begin
if Unit3.datamodule1.adotableza.
Unit3.datamodule1.adotableza.
Close;
end;
procedure TForm16.BitBtn2Click(Sender: TObject);
begin
form16.Close;
end;
end.
unit Unit17;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, ExtCtrls, ComCtrls, StdCtrls, Mask, DBCtrls, Buttons, jpeg;
type
TForm17 = class(TForm)
Label1: TLabel;
Label2: TLabel;
Label3: TLabel;
Label4: TLabel;
Label5: TLabel;
Label6: TLabel;
Label7: TLabel;
Label8: TLabel;
BitBtn1: TBitBtn;
BitBtn2: TBitBtn;
DBLookupComboBox1: TDBLookupComboBox;
DBLookupComboBox2: TDBLookupComboBox;
DBEdit1: TDBEdit;
DBEdit2: TDBEdit;
DBEdit3: TDBEdit;
DBEdit4: TDBEdit;
DBEdit5: TDBEdit;
DBEdit6: TDBEdit;
MonthCalendar1: TMonthCalendar;
Image1: TImage;
Label9: TLabel;
DBLookupComboBox3: TDBLookupComboBox;
procedure BitBtn1Click(Sender: TObject);
procedure BitBtn2Click(Sender: TObject);
procedure MonthCalendar1Click(Sender: TObject);
procedure DBEdit4KeyPress(Sender: TObject; var Key: Char);
procedure DBEdit5KeyPress(Sender: TObject; var Key: Char);
procedure DBEdit6Click(Sender: TObject);
procedure DBEdit2KeyPress(Sender: TObject; var Key: Char);
procedure DBEdit3KeyPress(Sender: TObject; var Key: Char);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form17: TForm17;
implementation
uses unit3,unit9;
{$R *.dfm}
procedure TForm17.BitBtn1Click(Sender: TObject);
begin
if Unit3.datamodule1.adotablepl.
Unit3.datamodule1.adotablepl.
Close;
end;
procedure TForm17.BitBtn2Click(Sender: TObject);
begin
form17.Close;
end;
procedure TForm17.MonthCalendar1Click(
begin
dbedit1.Text:=datetostr(
end;
procedure TForm17.DBEdit4KeyPress(
begin
if (key <> #8) then
begin
case Key of
'0'..'9': key := key;
else
Key := #0;
end;
end;
end;
procedure TForm17.DBEdit5KeyPress(
begin
if (key <> #8) then
begin
case Key of
'0'..'9': key := key;
else
Key := #0;
end;
end;
end;
procedure TForm17.DBEdit6Click(Sender: TObject);
var s,a:string;
begin
if Unit3.datamodule1.adotabletar.
s:=floattostr(strtofloat(
if Unit3.datamodule1.adotabletar.
a:=floattostr(strtofloat(
dbedit6.Text:= floattostr(strtofloat(s)+
end;
procedure TForm17.DBEdit2KeyPress(
begin
if (key <> #8) then
begin
case Key of
'0'..'9': key := key;
else
Key := #0;
end;
end;
end;
procedure TForm17.DBEdit3KeyPress(
begin
if (key <> #8) then
begin
case Key of
'0'..'9': key := key;
else
Key := #0;
end;
end;
end;
end.
unit Unit18;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, jpeg, ExtCtrls, StdCtrls, DBCtrls, Mask, Buttons;
type
TForm18 = class(TForm)
Label1: TLabel;
Label2: TLabel;
Label3: TLabel;
Label4: TLabel;
Label5: TLabel;
Label6: TLabel;
Label7: TLabel;
Label8: TLabel;
Label9: TLabel;
Label10: TLabel;
BitBtn1: TBitBtn;
BitBtn2: TBitBtn;
DBEdit1: TDBEdit;
DBEdit2: TDBEdit;
DBEdit3: TDBEdit;
DBLookupComboBox1: TDBLookupComboBox;
DBComboBox1: TDBComboBox;
DBComboBox2: TDBComboBox;
DBComboBox3: TDBComboBox;
DBLookupComboBox2: TDBLookupComboBox;
DBLookupComboBox3: TDBLookupComboBox;
DBLookupComboBox4: TDBLookupComboBox;
Image1: TImage;
procedure BitBtn1Click(Sender: TObject);
procedure BitBtn2Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form18: TForm18;
implementation
uses unit3,unit10;
{$R *.dfm}
procedure TForm18.BitBtn1Click(Sender: TObject);
begin
if Unit3.datamodule1.adotabletel.
Unit3.datamodule1.adotabletel.
Close;
end;
procedure TForm18.BitBtn2Click(Sender: TObject);
begin
form18.Close;
end;
end.
unit Unit19;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, jpeg, ExtCtrls;
type
TForm19 = class(TForm)
Edit1: TEdit;
Button1: TButton;
Button2: TButton;
Image1: TImage;
procedure FormActivate(Sender: TObject);
procedure Button1Click(Sender: TObject);
procedure Button2Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form19: TForm19;
implementation
uses unit2,unit4,unit5,unit6,unit7,
{$R *.dfm}
procedure TForm19.FormActivate(Sender: TObject);
begin
if tag=1 then
edit1.Text:=unit2.form2.
if tag=2 then
edit1.Text:=unit4.form4.
if tag=3 then
edit1.Text:=unit5.form5.
if tag=4 then
edit1.Text:=unit6.form6.
if tag=5 then
edit1.Text:=unit7.form7.
if tag=6 then
edit1.Text:=unit8.form8.
if tag=7 then
edit1.Text:=unit9.form9.
if tag=8 then
edit1.Text:=unit10.form10.
if tag=9 then
edit1.Text:=unit20.form20.
if tag=10 then
edit1.Text:=unit21.form21.
if tag=11 then
edit1.Text:=unit22.form22.
if tag=12 then
edit1.Text:=unit23.form23.
end;
procedure TForm19.Button1Click(Sender: TObject);
begin
if tag=1 then begin
unit2.form2.label5.caption:=
form19.close;
end;
if tag=2 then begin
unit4.form4.label3.caption:=
form19.close;
end;
if tag=3 then begin
unit5.form5.label5.caption:=
form19.close;
end;
if tag=4 then begin
unit6.form6.label5.caption:=
form19.close;
end;
if tag=5 then begin
unit7.form7.label5.caption:=
form19.close;
end;
if tag=6 then begin
unit8.form8.label5.caption:=
form19.close;
end;
if tag=7 then begin
unit9.form9.label5.caption:=
form19.close;
end;
if tag=8 then begin
unit10.form10.label5.caption:=
form19.close;
end;
if tag=9 then begin
unit20.form20.label5.caption:=
form19.close;
end;
if tag=10 then begin
unit21.form21.label5.caption:=
form19.close;
end;
if tag=11 then begin
unit22.form22.label5.caption:=
form19.close;
end;
if tag=12 then begin
unit23.form23.label5.caption:=
form19.close;
end;
end;
procedure TForm19.Button2Click(Sender: TObject);
begin
form19.Close;
end;
end.
unit Unit20;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, Grids, DBGrids, Menus, StdCtrls, Buttons, jpeg, ExtCtrls;
type
TForm20 = class(TForm)
DBGrid1: TDBGrid;
Image1: TImage;
BitBtn1: TBitBtn;
Label1: TLabel;
Label2: TLabel;
Label3: TLabel;
Label4: TLabel;
Label5: TLabel;
PopupMenu1: TPopupMenu;
N1: TMenuItem;
procedure FormActivate(Sender: TObject);
procedure N1Click(Sender: TObject);
procedure BitBtn1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form20: TForm20;
implementation
uses unit3,unit1,unit19;
{$R *.dfm}
procedure TForm20.FormActivate(Sender: TObject);
var
sq:String;
begin
sq:='';
sq:='SELECT Т_АТС.Наименование, Count(Т_Телефон.Код_АТС) AS [Число aбонентов]';
sq:=sq+' FROM Т_АТС INNER JOIN Т_Телефон ON Т_АТС.Код = Т_Телефон.Код_АТС';
sq:=sq+' GROUP BY Т_АТС.Наименование';
sq:=sq+' WITH OWNERACCESS OPTION;';
DataModule1.ADOQueryzap.
DataModule1.ADOQueryzap.sql.
DataModule1.ADOQueryzap.sql.
DataModule1.ADOQueryzap.
end;
procedure TForm20.N1Click(Sender: TObject);
begin
unit19.Form19.tag:=9;
unit19.Form19.ShowModal;
end;
procedure TForm20.BitBtn1Click(Sender: TObject);
begin
form20.Close;
end;
end.
unit Unit21;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, Grids, DBGrids, StdCtrls, Buttons, jpeg, ExtCtrls, Menus;
type
TForm21 = class(TForm)
DBGrid1: TDBGrid;
Image1: TImage;
BitBtn1: TBitBtn;
Label1: TLabel;
Label2: TLabel;
Label3: TLabel;
Label4: TLabel;
Label5: TLabel;
PopupMenu1: TPopupMenu;
N1: TMenuItem;
procedure FormActivate(Sender: TObject);
procedure BitBtn1Click(Sender: TObject);
procedure N1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form21: TForm21;
implementation
uses unit1,unit3,unit19;
{$R *.dfm}
procedure TForm21.FormActivate(Sender: TObject);
var
sq:String;
begin
sq:='';
sq:='SELECT Т_Абоненты.ФИО, Т_Абонентская_плата.
sq:=sq+' FROM Т_Абоненты INNER JOIN Т_Абонентская_плата
ON Т_Абоненты.Код = Т_Абонентская_плата.Код_
sq:=sq+' WHERE ((([Задолжность_город]+[
sq:=sq+' WITH OWNERACCESS OPTION;';
DataModule1.ADOQueryzap.
DataModule1.ADOQueryzap.sql.
DataModule1.ADOQueryzap.sql.
DataModule1.ADOQueryzap.
end;
procedure TForm21.BitBtn1Click(Sender: TObject);
begin
form21.close;
end;
procedure TForm21.N1Click(Sender: TObject);
begin
unit19.Form19.tag:=10;
unit19.Form19.ShowModal;
end;
end.
unit Unit22;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, Buttons, jpeg, ExtCtrls, Grids, DBGrids, Menus;