Автор работы: Пользователь скрыл имя, 11 Июня 2013 в 10:46, курсовая работа
В настоящее время, когда ЭВМ прочно вошли в производственную деятельность человека, нет необходимости доказывать эффективность использования вычислительной техники в системах управления технологическими процессами, проектирования, научных исследований, административного управления, в учебном процессе, банковских расчетах, здравоохранении, сфере обслуживания и т.д.
Введение
1 Анализ предметной области
2 Постановка задачи
3 Структура базы данных
4 Разработка программы
4.1 Программная реализация
4.2 Анализ организации данных
4.3 Анализ программного кода
5 Описание программы
5.1 Интерфейс пользователя
5.2 Инструкция пользователя
5.3 Системные требования.
Выводы
Перечень ссылок
Приложение А
Приложение Б
Приложение В
Приложение Г
Приложение Д
Приложение Е
Exit;
end;
if eCapital.Text = '' then
begin
MessageDlg('Âû íå ââåëè íàçâàíèå ñòîëèöû!', mtWarning, [mbOK], 0);
eCapital.SetFocus;
Exit;
end;
DM.tbCountry.Filtered := False;
if eCountry.Text <> Strana then
if DM.tbCountry.Locate('Country',
begin
MessageDlg('Còðàía '''+eCountry.Text+''' óæå ñóùåñòâóåò â Áàçå äàííûõ!', mtWarning, [mbOK], 0);
eCountry.Clear;
eCountry.SetFocus;
Exit;
end;
//ïîèñê êîíòèíåíòà
DM.tbKontinent.Locate('
DM.tbCountry.Locate('Country',
//âíåñåíèå çàïèñåé â òàáëèöó ñòðàí
DM.tbCountry.Edit;
DM.tbCountryID_Kontinent.Value := DM.tbKontinentID.Value;
DM.tbCountryCountry.Value := eCountry.Text;
DM.tbCountryCapital.Value := eCapital.Text;
DM.tbCountry.Post;
//ïîèñê ïåðâîãî ÿçûêà è çàïèñü â ãëàâíóþ òàáëèöó
DM.tbLanguage.Locate('
DM.tbMain.Filter := 'ID_Country = '+DM.tbCountryID.Text;
DM.tbMain.Filtered := True;
DM.tbMain.First;
while DM.tbMain.RecordCount > 0 do DM.tbMain.Delete;
DM.tbMain.Filtered := False;
DM.tbMain.IndexFieldNames := 'ID';
DM.tbMain.Last;
Temp := DM.tbMainID.Value;
DM.tbMain.Insert;
DM.tbMainID.Value := Temp + 1;
DM.tbMainID_Country.Value := DM.tbCountryID.Value;
DM.tbMainID_Language.Value := DM.tbLanguageID.Value;
DM.tbMain.Post;
//ïîèñê âòîðîãî ÿçûêà è çàïèñü â ãëàâíóþ òàáëèöó
if cbLanguage2.Text <> '--- íåò ---' then
begin
DM.tbLanguage.Locate('
DM.tbMain.Insert;
DM.tbMainID.Value := Temp + 2;
DM.tbMainID_Country.Value := DM.tbCountryID.Value;
DM.tbMainID_Language.Value := DM.tbLanguageID.Value;
DM.tbMain.Post;
end;
//ïîèñê òðåòüåîãî ÿçûêà è çàïèñü â ãëàâíóþ òàáëèöó
if cbLanguage3.Text <> '--- íåò ---' then
begin
DM.tbLanguage.Locate('
DM.tbMain.Insert;
DM.tbMainID.Value := Temp + 3;
DM.tbMainID_Country.Value := DM.tbCountryID.Value;
DM.tbMainID_Language.Value := DM.tbLanguageID.Value;
DM.tbMain.Post;
end;
//âêëþ÷åíèå ïðèâÿçêè
DM.tbCountry.Filtered := True;
DM.tbCountry.Locate('Country',
frmEditCountry.Close;
end;
end.
Приложение
Г
Файл реализации модуля “NewCountry.pas”
unit NewCountry;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
StdCtrls, ExtCtrls, Buttons, DBCtrls, DB;
type
TfrmNewCountry = class(TForm)
Panel1: TPanel;
Panel2: TPanel;
imFlag: TImage;
Label1: TLabel;
Label2: TLabel;
Label3: TLabel;
Label4: TLabel;
Label5: TLabel;
eCapital: TEdit;
memoInformation: TMemo;
cbLanguage1: TComboBox;
cbLanguage2: TComboBox;
cbLanguage3: TComboBox;
Label6: TLabel;
Label7: TLabel;
bbOpenDialog: TButton;
bbCreate: TBitBtn;
cbKontinent: TComboBox;
eCountry: TEdit;
procedure bbOpenDialogClick(Sender: TObject);
procedure FormShow(Sender: TObject);
procedure cbLanguage1Change(Sender: TObject);
procedure cbLanguage2Change(Sender: TObject);
procedure cbLanguage3Change(Sender: TObject);
procedure bbCreateClick(Sender: TObject);
procedure FormKeyDown(Sender: TObject; var Key: Word;
Shift: TShiftState);
private
{ Private declarations }
public
{ Public declarations }
end;
var
frmNewCountry: TfrmNewCountry;
implementation
uses Module;
{$R *.DFM}
procedure TfrmNewCountry.
begin
DM.odFlag.Execute;
if DM.odFlag.FileName <> '' thentry
imFlag.Picture.LoadFromFile(
except
MessageDlg('Îøèáêà çàãðóçêè ôàéëà ñ ðèñóíêîì ôëàãà', mtError, [mbOk],0)
end;
end;
procedure TfrmNewCountry.FormShow(
begin
cbKontinent.Clear;
cbLanguage1.Clear;
cbLanguage2.Clear;
cbLanguage3.Clear;
eCapital.Clear;
eCountry.Clear;
memoInformation.Clear;
imFlag.Picture.Bitmap.Canvas.
DM.qWork.SQL.Clear;
DM.qWork.SQL.Add('Select Language from Language order by Language');
DM.qWork.Open;
cbLanguage2.Items.Add('--- íåò ---');
cbLanguage3.Items.Add('--- íåò ---');
DM.qWork.First;
while DM.qWork.Eof = False do
begin
cbLanguage1.Items.Add(DM.
cbLanguage2.Items.Add(DM.
cbLanguage3.Items.Add(DM.
DM.qWork.Next;
end;
DM.qWork.Close;
DM.qWork.SQL.Clear;
DM.qWork.SQL.Add('Select Kontinent from Kontinent order by Kontinent');
DM.qWork.Open;
DM.qWork.First;
while DM.qWork.Eof = False do
begin
cbKontinent.Items.Add(DM.
DM.qWork.Next;
end;
DM.qWork.Close;
cbKontinent.ItemIndex := 0;
cbLanguage1.ItemIndex := 0;
cbLanguage2.ItemIndex := 0;
cbLanguage3.ItemIndex := 0;
end;
procedure TfrmNewCountry.
begin
if (cbLanguage1.Text = cbLanguage2.Text) then
begin
cbLanguage2.ItemIndex := cbLanguage3.ItemIndex;
cbLanguage3.ItemIndex := 0;
end;
if (cbLanguage1.Text = cbLanguage3.Text) then
begin
cbLanguage3.ItemIndex := 0;
end;
end;
procedure TfrmNewCountry.
begin
if (cbLanguage2.Text = cbLanguage1.Text) or (cbLanguage2.Text = cbLanguage3.Text) and (cbLanguage2.Text <> '--- íåò ---') then
begin
cbLanguage2.ItemIndex := cbLanguage3.ItemIndex;
cbLanguage3.ItemIndex := 0;
end;
end;
procedure TfrmNewCountry.
begin
if (cbLanguage2.Text = '--- íåò ---') then
begin
cbLanguage2.ItemIndex := cbLanguage3.ItemIndex;
cbLanguage3.ItemIndex := 0;
end;
if (cbLanguage3.Text = cbLanguage1.Text) or (cbLanguage2.Text = cbLanguage3.Text) and (cbLanguage3.Text <> '--- íåò ---') then
begin
cbLanguage3.ItemIndex := 0;
end;
end;
procedure TfrmNewCountry.bbCreateClick(
var Temp: LongInt;
var myStream: TMemoryStream;
begin
if eCountry.Text = '' then
begin
MessageDlg('Âû íå ââåëè íàçâàíèå ñòðàíû!', mtWarning, [mbOK], 0);
eCountry.SetFocus;
Exit;
end;
if eCapital.Text = '' then
begin
MessageDlg('Âû íå ââåëè íàçâàíèå ñòîëèöû!', mtWarning, [mbOK], 0);
eCapital.SetFocus;
Exit;
end;
if DM.tbCountry.Locate('Country',
begin
MessageDlg('Còðàía '''+eCountry.Text+''' óæå ñóùåñòâóåò â Áàçå äàííûõ!', mtWarning, [mbOK], 0);
eCountry.Clear;
eCountry.SetFocus;
Exit;
end;
//îòêëþ÷åíèå ïðèâÿçêè
DM.tbCountry.Filtered := False;
//ïîèñê êîíòèíåíòà
DM.tbKontinent.Locate('
//ñîçäàíèå Èäåíòèôèêàöèîííîãî íàìåðà
DM.tbCountry.IndexFieldNames := 'ID';
DM.tbCountry.Last;
Temp := DM.tbCountryID.Value;
//âíåñåíèå çàïèñåé â òàáëèöó ñòðàí
DM.tbCountry.Insert;
DM.tbCountryID.Value := Temp+1;
DM.tbCountryID_Kontinent.Value := DM.tbKontinentID.Value;
DM.tbCountryCountry.Value := eCountry.Text;
DM.tbCountryCapital.Value := eCapital.Text;
myStream := TMemoryStream.Create;
memoInformation.Lines.
DM.tbCountryInformation.
myStream.Clear;
imFlag.Picture.Bitmap.
// imFlag.Picture.SaveToFile('
// DM.tbCountryFlag.LoadFromFile(
DM.tbCountryFlag.
myStream.Destroy;
DM.tbCountry.Post;
//ïîèñê ïåðâîãî ÿçûêà è çàïèñü â ãëàâíóþ òàáëèöó
DM.tbLanguage.Locate('
DM.tbMain.IndexFieldNames := 'ID';
DM.tbMain.Last;
Temp := DM.tbMainID.Value;
DM.tbMain.Insert;
DM.tbMainID.Value := Temp + 1;
DM.tbMainID_Country.Value := DM.tbCountryID.Value;
DM.tbMainID_Language.Value := DM.tbLanguageID.Value;
DM.tbMain.Post;
if cbLanguage2.Text <> '--- íåò ---' then
begin
DM.tbLanguage.Locate('
DM.tbMain.Insert;
DM.tbMainID.Value := Temp + 2;
DM.tbMainID_Country.Value := DM.tbCountryID.Value;
DM.tbMainID_Language.Value := DM.tbLanguageID.Value;
DM.tbMain.Post;
end;
if cbLanguage3.Text <> '--- íåò ---' then
begin
DM.tbLanguage.Locate('
DM.tbMain.Insert;
DM.tbMainID.Value := Temp + 3;
DM.tbMainID_Country.Value := DM.tbCountryID.Value;
DM.tbMainID_Language.Value := DM.tbLanguageID.Value;
DM.tbMain.Post;
end;
DM.tbCountry.Filtered := True;
frmNewCountry.Close;
end;
procedure TfrmNewCountry.FormKeyDown(
Shift: TShiftState);
begin
if key = vk_Escape then frmNewCountry.Close;
end;
end.
Приложение Д
Файл реализации модуля “NewLanguage.pas”
unit NewLanguage;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
StdCtrls, Buttons, ExtCtrls, DB;
type
TfrmNewLanguage = class(TForm)
Panel1: TPanel;
Panel2: TPanel;
eLanguage: TEdit;
bbCreate: TBitBtn;
procedure bbCreateClick(Sender: TObject);
procedure FormKeyDown(Sender: TObject; var Key: Word;
Shift: TShiftState);
private
{ Private declarations }
public
{ Public declarations }
end;
var
frmNewLanguage: TfrmNewLanguage;
implementation
uses Module;
{$R *.DFM}
procedure TfrmNewLanguage.bbCreateClick(
var Temp: LongInt;
begin
if eLanguage.Text <> '' then
if DM.tbLanguage.Locate('
begin
DM.tbLanguage.IndexFieldNames := 'ID';
DM.tbLanguage.Last;
Temp := DM.tbLanguageID.Value;
DM.tbLanguage.Insert;
DM.tbLanguageID.Value := Temp + 1;
DM.tbLanguageLanguage.Value := eLanguage.Text;
DM.tbLanguage.Post;
MessageDlg('ßçûê '''+eLanguage.Text+''' ñîçäàí',mtInformation,[mbOk],
frmNewLanguage.Close;
end
else
begin
MessageDlg('ßçûê '''+eLanguage.Text+''' óæå
ñóùåñòâóåò â òàáëèöå ÿçûêîâ',
eLanguage.SelectAll;
eLanguage.SetFocus;
end;
end;
procedure TfrmNewLanguage.FormKeyDown(
Shift: TShiftState);
begin
if key = vk_Escape then frmNewLanguage.Close;
end;
end.
Приложение Е
Файл реализации модуля “View.pas”
unit View;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
StdCtrls, ExtCtrls, ComCtrls, DBCtrls;
type
TfrmView = class(TForm)
Panel1: TPanel;
Panel2: TPanel;
Label1: TLabel;
Label2: TLabel;
Label3: TLabel;
Label4: TLabel;
Label5: TLabel;
Label6: TLabel;
Label7: TLabel;
eCountry: TEdit;
eCapital: TEdit;
eKontinent: TEdit;
eLanguage1: TEdit;
eLanguage2: TEdit;
eLanguage3: TEdit;
DBImage1: TDBImage;
DBRichEdit1: TDBRichEdit;
procedure FormShow(Sender: TObject);
procedure FormKeyDown(Sender: TObject; var Key: Word;
Shift: TShiftState);
private
{ Private declarations }
public
{ Public declarations }
end;
var
frmView: TfrmView;
implementation
uses Module;
{$R *.DFM}
procedure TfrmView.FormShow(Sender: TObject);
var myStream: TMemoryStream;
begin