Автор: Пользователь скрыл имя, 04 Июня 2012 в 20:33, курсовая работа
Целью курсовой работы является создание программного продукта по представлению данных о происшествиях на железной дороге в определенный период времени.
Важно, чтобы конечное приложение обладало удобным, легко воспринимаемым интерфейсом, который предоставляет пользователю доступ ко всем необходимым для работы функциям.
ComDel: TADOCommand;
PopupMenu1: TPopupMenu;
N3: TMenuItem;
N4: TMenuItem;
N5: TMenuItem;
N6: TMenuItem;
ComDEL2: TADOCommand;
N10: TMenuItem;
Splitter1: TSplitter;
SobNew: TADOCommand;
Udal: TADOCommand;
procedure CloseBDClick(Sender: TObject);
procedure FormShow(Sender: TObject);
procedure pathDBClick(Sender: TObject);
procedure FormClose(Sender: TObject; var Action: TCloseAction);
//procedure
EditTableTypeRefusalClick(
procedure SortDateClick(Sender: TObject);
procedure SortTypeRefusalClick(Sender: TObject);
procedure SortMoneyClick(Sender: TObject);
procedure FormResize(Sender: TObject);
procedure DBGridMainTitleClick(Column: TColumn);
procedure DelEventClick(Sender: TObject);
procedure N5Click(Sender: TObject);
procedure EditEventClick(Sender: TObject);
procedure NewEventClick(Sender: TObject);
procedure N4Click(Sender: TObject);
procedure N3Click(Sender: TObject);
procedure ReportClick(Sender: TObject);
procedure N6Click(Sender: TObject);
procedure N7Click(Sender: TObject);
procedure N9Click(Sender: TObject);
procedure DBGridMainCellClick(Column: TColumn);
procedure DBGridMain2CellClick(Column: TColumn);
procedure N10Click(Sender: TObject);
procedure
EditTableTypeRefusalClick(
private
{ Private declarations }
public
Procedure Connect;
{ Public declarations }
end;
var
MainForm: TMainForm;
wCol: array [0..6] of word;
wCol2: array [0..2]
of word;
implementation
uses DMunit, PassUnit, EditOtkazyUnit, MainRecordUnit, OtchetUnit,
StructureEventUnit,
MemoUnit;
{$R *.dfm}
Procedure TMainForm.Connect;
var
strCon :WideString;
begin
DM.ADOConnection1.Connected:=
strCon:=
'Provider=Microsoft.Jet.OLEDB.
'Data Source='+pathID+';'+
'Mode=ReadWrite;Extended Properties="";Persist Security Info=False;Jet OLEDB:System database="";'+
'Jet OLEDB:Registry Path="";Jet OLEDB:Database Password="'+passID+'";'+
'Jet OLEDB:Engine Type=5;'+
'Jet OLEDB:Database Locking Mode=1;Jet OLEDB:Global Partial Bulk Ops=2;Jet OLEDB:Global Bulk Transactions=1;'+
'Jet OLEDB:New Database Password="";Jet OLEDB:Create System Database=False;Jet OLEDB:Encrypt Database=False;'+
'Jet OLEDB:Don''t Copy Locale
on Compact=False;Jet OLEDB:Compact Without Replica Repair=False;Jet
OLEDB:SFP=False';
DM.ADOConnection1.
DM.ADOConnection1.LoginPrompt:
DM.ADOConnection1.Connected:=
DM.DS_main.DataSet:=DM.
DM.DataSetMain.Connection:=DM.
DM.DataSetMain.Active:=true;
DBGridMain.DataSource:=DM.DS_
end;
procedure TMainForm.CloseBDClick(Sender: TObject);
begin
Close;
end;
procedure TMainForm.FormShow(Sender: TObject);
var i: byte;
begin
PasswordDLG.ShowModal;
for i:=0 to DBGridMain.Columns.Count-1
do wCol[i]:=DBGridMain.Columns.
end;
procedure TMainForm.pathDBClick(Sender: TObject);
begin
PasswordDLG.ShowModal;
end;
procedure TMainForm.FormClose(Sender: TObject; var Action: TCloseAction);
var
FIniFile: TRegIniFile;
s:string;
begin
FIniFile := TRegIniFile.Create('Software')
FIniFile.OpenKey('dror',true);
s:=DM.ADOConnection1.
delete(s,1,pos('Data Source=',DM.ADOConnection1.
s:=copy(S, 0, pos(';',S)-1);
FIniFile.WriteString('
end;
procedure TMainForm.SortDateClick(
begin
DM.DataSetMain.Sort:='Data_
end;
procedure TMainForm.
begin
DM.DataSetMain.Sort:='ID_Sob';
end;
procedure TMainForm.SortMoneyClick(
begin
DM.DataSetMain.Sort:='Finansy'
end;
procedure TMainForm.FormResize(Sender: TObject);
var i: word;
p:real;
begin
p:=MainForm.Width/745;
For i:=0 to DBGridMain.Columns.Count-1 do
DBGridMain.Columns.Items[i].
end;
procedure TMainForm.
begin
if Column.FieldName<>'DescCalc' then
DM.DataSetMain.Sort:=Column.
end;
procedure TMainForm.DelEventClick(
begin
If Application.MessageBox('
ComDel.Parameters.ParamByName(
ComDel2.Parameters.
ComDel.Execute;
ComDel2.Execute;
MainForm.N6Click(self);
end;
procedure TMainForm.N5Click(Sender: TObject);
begin
DelEventClick(Self);
end;
procedure TMainForm.EditEventClick(
begin
MainRecordForm.DEdate.
MainRecordForm.DEtime.
MainRecordForm.DRdate.
MainRecordForm.DRtime.
MainRecordForm.RanEdit.Text:=
MainRecordForm.PogEdit.Text:=
MainRecordForm.FinEdit.Text:=
if DM.DataSetMainOpisanie_
MainRecordForm.DescEdit.Text:=
else
MainRecordForm.DescEdit.Text:=
DM.DataSetOtkazy.Active:=true;
MainRecordForm.Tag:=1;
MainRecordForm.Caption:='
MainRecordForm.ShowModal;
end;
procedure TMainForm.NewEventClick(
var i:word;
begin
DM.DataSetOtkazy.Active:=true;
MainRecordForm.DEdate.
MainRecordForm.DEtime.
MainRecordForm.DRdate.
MainRecordForm.DRtime.
MainRecordForm.RanEdit.Text:='
MainRecordForm.PogEdit.Text:='
MainRecordForm.FinEdit.Text:='
MainRecordForm.DescEdit.Text:=
MainRecordForm.Tag:=0;
MainRecordForm.Caption:='Новое
событие';
DM.DataSetOtkazy.Active:=true;
DM.DataSetOtkazy.Sort:='ID_
DM.DataSetOtkazy.First;
MainRecordForm.VidEdit1.Items.
For i:=0 to DM.DataSetOtkazy.RecordCount-1 do
Begin
MainRecordForm.VidEdit1.Items.
DM.DataSetOtkazy.Next;
end;
MainRecordForm.ShowModal;
end;
procedure TMainForm.N4Click(Sender: TObject);
begin
EditEventClick(Self);
end;
procedure TMainForm.N3Click(Sender: TObject);
begin
NewEventClick(self);
end;
procedure TMainForm.ReportClick(Sender: TObject);
var i:word;
begin
DM.DataSetOtkazy.Active:=true;
DM.DataSetOtkazy.Sort:='ID_
DM.DataSetOtkazy.First;
Udal.Execute;
SobNew.Execute;
ReportForm.ShowModal;
end;
procedure TMainForm.N6Click(Sender: TObject);
begin
DM.DataSetMain.Close;
DM.DataSetMain.Open;
end;
procedure TMainForm.N7Click(Sender: TObject);
begin
FormStrucEvent.ShowModal;
end;
procedure TMainForm.N9Click(Sender: TObject);
begin
MainForm.N7Click(self);
end;
procedure TMainForm.DBGridMainCellClick(
begin
If Column.FieldName<>'DescCalc' then Exit;
If DM.DataSetMainOpisanie_
with MemoForm do
Begin
Memo1.Text:=DM.
Top:=Mouse.CursorPos.Y+20;
Left:=Mouse.CursorPos.X;
Show;
end;
end;
procedure TMainForm.
begin
If Column.FieldName<>'DescCalc' then Exit;
If DM.DataSetOtkazyOpisanie_
with MemoForm do
Begin
Memo1.Text:=DM.
Top:=Mouse.CursorPos.Y+20;
Left:=Mouse.CursorPos.X;
Show;
end;
end;
procedure TMainForm.N10Click(Sender: TObject);
var i,k:word;
begin
MainRecordForm.DEdate.
MainRecordForm.DEtime.
MainRecordForm.DRdate.
MainRecordForm.DRtime.
MainRecordForm.RanEdit.Text:=
MainRecordForm.PogEdit.Text:=
MainRecordForm.FinEdit.Text:=
if DM.DataSetMainOpisanie_
MainRecordForm.DescEdit.Text:=
else
MainRecordForm.DescEdit.Text:=
DM.DataSetOtkazy.Active:=true;
MainRecordForm.Tag:=1;
MainRecordForm.Caption:='
DM.DataSetOtkazy.Active:=true;
DM.DataSetOtkazy.Sort:='ID_
DM.DataSetOtkazy.First;
MainRecordForm.VidEdit1.Items.
For i:=0 to DM.DataSetOtkazy.RecordCount-1 do
Begin
MainRecordForm.VidEdit1.Items.
DM.DataSetOtkazy.Next;
Информация о работе Разработка информационной системы учёта отказов на железнодорожном транспорте