Помощь в написании студенческих работ
Антистрессовый сервис

Программный комплекс «Автопрокат»

Дипломная Купить готовую Узнать стоимостьмоей работы

MainClientsForm. BuildGridDatabaseDirectoryItem ('Тарифы на прокат', mainclientsform. DataSource1); Function TMainClientsForm. IsMDIChildOpen (const AFormName: TForm; const AMDIChildName: string): Boolean; MainClientsForm. ADOTable6.FieldByName ('nomer_kontrolnogo_talona').AsString:=nomer_kontrolnogo_talona; MainClientsForm. BuildGridDatabaseDirectoryItem ('Клиенты', mainclientsform. DataSource1… Читать ещё >

Программный комплекс «Автопрокат» (реферат, курсовая, диплом, контрольная)

Содержание

  • СПИСОК УСЛОВНЫХ ОБОЗНАЧЕНИЙ И СОКРАЩЕНИЙ
  • ВВЕДЕНИЕ
  • 1. ПОСТАНОВКА ЗАДАЧИ ДИПЛОМНОГО ПРОЕКТИРОВАНИЯ
    • 1. 1. Назначение и цели системы
    • 1. 2. Требование к системе
    • 1. 3. Содержательное описание постановки задачи
      • 1. 3. 1. Описание эффективности внедрения
      • 1. 3. 2. Основные действия
  • 2. ПРОЕКТИРОВАНИЕ ПРОГРАММНОГО КОМПЛЕКСА
    • 2. 1. Обоснование выбора технических средств
    • 2. 2. Обоснование выбора программных средств
      • 2. 2. 1. Характерные черты и достоинства BDS 2006 и MS SQL 2005 и их применения в качестве инструментальных программных продуктов
      • 2. 2. 2. Системное программное обеспечение
    • 2. 3. Описание программной реализация системы
      • 2. 3. 1. Краткая характеристика программной среды
      • 2. 3. 2. Описание программной среды
      • 2. 3. 3. Выбранные средства реализации
    • 2. 4. Разработка структуры БД
    • 2. 5. Описание и обоснование использования всех таблиц
    • 2. 6. Разработка форм отчетной документации
    • 2. 7. Разработка пользовательского интерфейса
    • 2. 8. Выбор методов обмена данными
    • 2. 9. Обеспечение надежности обработки данных в системе
      • 2. 9. 1. Методы повышения надежности обработки данных
      • 2. 9. 2. Обеспечение надежности обработки данных в среде BDS 2006 и
  • MS SQL
    • 2. 9. 3. Основные задачи, цели и методы процессов верификации и валидации
    • 2. 10. Руководство пользователя
    • 2. 10. 1. Полное руководство пользователя на разработанный программный продукт
    • 2. 10. 2. Структура разработанного ПО
    • 2. 10. 3. Спецификации главного модуля проекта
  • 3. ОБОСНОВАНИЕ ЭКОНОМИЧЕСКОЙ ЭФФЕКТИВНОСТИ ПРОЕКТА
    • 3. 1. Выбор и обоснование методики расчёта экономической эффективности
    • 3. 2. Расчёт показателей экономической эффективности проекта
  • ЗАКЛЮЧЕНИЕ
  • ЛИТЕРАТУРА Приложение, А Листинг разработанной программы

dfm}

function TMainClientsForm. IsMDIChildOpen (const AFormName: TForm; const AMDIChildName: string): Boolean;

var

i: Integer;

begin

Result := False;

for i := Pred (AFormName.MDIChildCount) DownTo 0 do

if (AFormName.MDIChildren[i]. Name = AMDIChildName) then

begin

Result := True;

AFormName.MDIChildren[i]. Free;

end;

end;

function TMainClientsForm. IsFormOpen (const FormName: string): Boolean;

var

i: Integer;

begin

Result := False;

for i := Screen. FormCount — 1 DownTo 0 do

if (Screen.Forms[i]. Name = FormName) then

begin

Result := True;

Break;

end;

end;

procedure TMainClientsForm. BuildGridDatabaseDirectoryItem (sCaption:String; ds: TDataSource);

begin

//создаем форму

DirectoryForm:=TDBDirectoryTemplateForm.Create (Owner);

DirectoryForm.TableDBGrid.DataSource:=ds;

DirectoryForm.Top:=0;

DirectoryForm.Left:=0;

DirectoryForm.Caption:=sCaption;

end;

procedure TMainClientsForm. N12Click (Sender: TObject);

begin

MainClientsForm.Close;

end;

procedure TMainClientsForm. N6Click (Sender: TObject);

begin

IsMDIChildOpen (MainClientsForm,'DBDirectoryTemplateForm');

mainclientsform.DataSource1.DataSet:=mainclientsform.ADOTable1;

mainclientsform.ADOTable1.Active:=true;

MainClientsForm.BuildGridDatabaseDirectoryItem ('Информация об плане проката', mainclientsform. DataSource1);

DirectoryForm.TableDBGrid.Fields[0]. DisplayLabel:='Ид';

DirectoryForm.TableDBGrid.Fields[1].DisplayLabel:='Id Заказ';

DirectoryForm.TableDBGrid.Fields[2]. DisplayLabel:='Id автомобиля';

DirectoryForm.TableDBGrid.Fields[3]. DisplayLabel:='Id факт. проката';

DirectoryForm.TableDBGrid.Fields[4]. DisplayLabel:='дата';

DirectoryForm.TableDBGrid.Fields[5].DisplayLabel:='выполнен';

{DirectoryForm.TableDBGrid.Fields[6].DisplayLabel:='Id Заправщик';

DirectoryForm.TableDBGrid.Fields[7]. DisplayLabel:='Id Операции';

DirectoryForm.TableDBGrid.Fields[8]. DisplayLabel:='Id атрибут';}

end;

procedure TMainClientsForm. N7Click (Sender: TObject);

begin

IsMDIChildOpen (MainClientsForm,'DBDirectoryTemplateForm');

IsMDIChildOpen (MainClientsForm,'addForm');

mainflag:=false;

mainclientsform.DataSource1.DataSet:=mainclientsform.ADOTable2;

mainclientsform.ADOTable2.Active:=true;

MainClientsForm.BuildGridDatabaseDirectoryItem ('Клиенты', mainclientsform. DataSource1);

DirectoryForm.TableDBGrid.Fields[0]. DisplayLabel:='Id зап';

DirectoryForm.TableDBGrid.Fields[1]. DisplayLabel:='Ф.И.О.';

DirectoryForm.TableDBGrid.Fields[2].DisplayLabel:='адрес';

DirectoryForm.TableDBGrid.Fields[3].DisplayLabel:='гор. телефон';

DirectoryForm.TableDBGrid.Fields[4]. DisplayLabel:='моб. телефон';

DirectoryForm.TableDBGrid.Fields[5]. DisplayLabel:='кол. поездок';

end;

procedure TMainClientsForm. N8Click (Sender: TObject);

begin

IsMDIChildOpen (MainClientsForm,'DBDirectoryTemplateForm');

IsMDIChildOpen (MainClientsForm,'addForm');

mainflag:=false;

mainclientsform.DataSource1.DataSet:=mainclientsform.ADOTable3;

mainclientsform.ADOTable3.Active:=true;

MainClientsForm.BuildGridDatabaseDirectoryItem ('заказы на прокат автомобилей', mainclientsform. DataSource1);

DirectoryForm.TableDBGrid.Fields[0]. DisplayLabel:='ИД.';

DirectoryForm.TableDBGrid.Fields[1].DisplayLabel:='выполн.';

DirectoryForm.TableDBGrid.Fields[2].DisplayLabel:='дата';

DirectoryForm.TableDBGrid.Fields[3].DisplayLabel:='срок';

DirectoryForm.TableDBGrid.Fields[4].DisplayLabel:='вид';

DirectoryForm.TableDBGrid.Fields[5].DisplayLabel:=' Ид. Клиент';

end;

procedure TMainClientsForm. N9Click (Sender: TObject);

begin

IsMDIChildOpen (MainClientsForm,'DBDirectoryTemplateForm');

IsMDIChildOpen (MainClientsForm,'addForm');

mainflag:=false;

mainclientsform.DataSource1.DataSet:=mainclientsform.ADOTable4;

mainclientsform.ADOTable4.Active:=true;

MainClientsForm.BuildGridDatabaseDirectoryItem ('автомобили пункта проката', mainclientsform. DataSource1);

DirectoryForm.TableDBGrid.Fields[0]. DisplayLabel:='ИД.';

DirectoryForm.TableDBGrid.Fields[1].DisplayLabel:='Марка';

DirectoryForm.TableDBGrid.Fields[2].DisplayLabel:='Номер';

DirectoryForm.TableDBGrid.Fields[3].DisplayLabel:='Водитель';

DirectoryForm.TableDBGrid.Fields[4].DisplayLabel:='Техн. состояние';

DirectoryForm.TableDBGrid.Fields[5]. DisplayLabel:='Тек. состояние';

DirectoryForm.TableDBGrid.Fields[6]. DisplayLabel:='Класс авто';

end;

procedure TMainClientsForm. N10Click (Sender: TObject);

begin

IsMDIChildOpen (MainClientsForm,'DBDirectoryTemplateForm');

IsMDIChildOpen (MainClientsForm,'addForm');

mainflag:=false;

mainclientsform.DataSource1.DataSet:=mainclientsform.ADOTable5;

mainclientsform.ADOTable5.Active:=true;

MainClientsForm.BuildGridDatabaseDirectoryItem ('Тарифы на прокат', mainclientsform. DataSource1);

DirectoryForm.TableDBGrid.Fields[0]. DisplayLabel:='Ид.';

DirectoryForm.TableDBGrid.Fields[1].DisplayLabel:='время';

DirectoryForm.TableDBGrid.Fields[2].DisplayLabel:='стоимость';

DirectoryForm.TableDBGrid.Fields[3].DisplayLabel:='примечание';

end;

procedure TMainClientsForm. N20Click (Sender: TObject);

begin

IsMDIChildOpen (MainClientsForm,'DBDirectoryTemplateForm');

IsMDIChildOpen (MainClientsForm,'addForm');

mainflag:=false;

mainclientsform.DataSource1.DataSet:=mainclientsform.ADOTable6;

mainclientsform.ADOTable6.Active:=true;

MainClientsForm.BuildGridDatabaseDirectoryItem ('Фактический прокат ', mainclientsform. DataSource1);

DirectoryForm.TableDBGrid.Fields[0]. DisplayLabel:='Ид.';

DirectoryForm.TableDBGrid.Fields[1].DisplayLabel:='Время';

DirectoryForm.TableDBGrid.Fields[2].DisplayLabel:='Ид. заказ';

DirectoryForm.TableDBGrid.Fields[3]. DisplayLabel:='Ид авто';

DirectoryForm.TableDBGrid.Fields[4]. DisplayLabel:='Ид. тариф';

DirectoryForm.TableDBGrid.Fields[5]. DisplayLabel:='Ид. счет';

end;

procedure TMainClientsForm. N21Click (Sender: TObject);

begin

IsMDIChildOpen (MainClientsForm,'DBDirectoryTemplateForm');

IsMDIChildOpen (MainClientsForm,'addForm');

mainflag:=false;

mainclientsform.DataSource1.DataSet:=mainclientsform.ADOTable7;

mainclientsform.ADOTable7.Active:=true;

MainClientsForm.BuildGridDatabaseDirectoryItem ('Выставленные счета', mainclientsform. DataSource1);

DirectoryForm.TableDBGrid.Fields[0]. DisplayLabel:='Ид ';

DirectoryForm.TableDBGrid.Fields[1]. DisplayLabel:='Ид. факт';

DirectoryForm.TableDBGrid.Fields[2]. DisplayLabel:='Ид. клиент';

DirectoryForm.TableDBGrid.Fields[3]. DisplayLabel:='Ид. тариф';

DirectoryForm.TableDBGrid.Fields[4]. DisplayLabel:='Сумма';

DirectoryForm.TableDBGrid.Fields[5].DisplayLabel:='примечание';;

end;

procedure TMainClientsForm. N22Click (Sender: TObject);

begin

IsMDIChildOpen (MainClientsForm,'addForm');

IsMDIChildOpen (MainClientsForm,'addForm');

mainflag:=false;

MainClientsForm.N6Click (sender);

prosmForm:=Taddform.Create (Owner);

prosmForm.Top:=230;

prosmForm.Left:=0;

prosmForm.Width:=500;

prosmForm.Height:=200;

prosmForm.Caption:='просмотр информационной базы';

prosmForm.DBNavigator1.Visible:=true;

mainflag:=true;

prosmForm.Show;

prosmForm.GroupBox4.Visible:=false;

MainClientsForm.DataSource1.DataSet.last

end;

procedure TMainClientsForm. N23Click (Sender: TObject);

begin

IsMDIChildOpen (MainClientsForm,'DBDirectoryTemplateForm');

IsMDIChildOpen (MainClientsForm,'addForm');

mainflag:=false;

mainclientsform.DataSource1.DataSet:=mainclientsform.ADOTable9;

mainclientsform.ADOTable7.Active:=true;

MainClientsForm.BuildGridDatabaseDirectoryItem ('Сведения о воздушных судах', mainclientsform. DataSource1);

DirectoryForm.TableDBGrid.Fields[0]. DisplayLabel:='ID ';

DirectoryForm.TableDBGrid.Fields[1]. DisplayLabel:='марка';

DirectoryForm.TableDBGrid.Fields[2].DisplayLabel:='тип';

DirectoryForm.TableDBGrid.Fields[3].DisplayLabel:='борт. номер';

DirectoryForm.TableDBGrid.Fields[4]. DisplayLabel:='принадлежность';

DirectoryForm.TableDBGrid.Fields[5].DisplayLabel:='стоянка';

end;

procedure TMainClientsForm. N24Click (Sender: TObject);

begin

IsMDIChildOpen (MainClientsForm,'DBDirectoryTemplateForm');

IsMDIChildOpen (MainClientsForm,'addForm');

mainflag:=false;

mainclientsform.DataSource1.DataSet:=mainclientsform.ADOTable10;

mainclientsform.ADOTable7.Active:=true;

MainClientsForm.BuildGridDatabaseDirectoryItem ('Сведения рейсах в аэропорту', mainclientsform. DataSource1);

DirectoryForm.TableDBGrid.Fields[0]. DisplayLabel:='ID рейса';

DirectoryForm.TableDBGrid.Fields[1]. DisplayLabel:='номер';

DirectoryForm.TableDBGrid.Fields[2].DisplayLabel:='Вылет';

DirectoryForm.TableDBGrid.Fields[3].DisplayLabel:='Начальный пункт';

DirectoryForm.TableDBGrid.Fields[4]. DisplayLabel:='Назначение';

DirectoryForm.TableDBGrid.Fields[5].DisplayLabel:='расстояние';

DirectoryForm.TableDBGrid.Fields[5].DisplayLabel:='стоянка';

end;

procedure TMainClientsForm. FormCreate (Sender: TObject);

var NewConnection: Widestring;

begin

NewConnection := PromptDataSource (Handle, MainClientsForm. ADOConnection1.Connectionstring);

MainClientsForm.ADOConnection1.Connectionstring:=NewConnection;

MainClientsForm.ADOConnection1.Connected:=true;

MainClientsForm.ADOTable1.Active:=true;

MainClientsForm.ADOTable2.Active:=true;

MainClientsForm.ADOTable3.Active:=true;

MainClientsForm.ADOTable4.Active:=true;

MainClientsForm.ADOTable5.Active:=true;

MainClientsForm.ADOTable6.Active:=true;

MainClientsForm.ADOTable7.Active:=true;

end;

procedure TMainClientsForm. N3Click (Sender: TObject);

var dobForm: Taddform;

begin

mainflag:=false;

IsMDIChildOpen (MainClientsForm,'addForm');

dobForm:=Taddform.Create (Owner);

dobForm.Top:=240;

dobForm.Left:=3;

dobForm.Caption:='добавление записи';

dobForm.Top:=240;

dobForm.Left:=3;

dobForm.Caption:='создание заказа / клиента';

dobForm.Show;

dobForm.Button4.Visible:=false;

dobForm.GroupBox2.Visible:=false;

dobForm.GroupBox1.Visible:=true;

dobForm.GroupBox1.Left:=2;

dobForm.GroupBox1.Top:=2;

dobForm.Show;

dobForm.Button4.Visible:=true;

end;

procedure TMainClientsForm. DataSource1DataChange (Sender: TObject;

Field: TField);

var

sql_str, rez: string;

P11:Tparameter;

rezdate:tdatetime;

rezint:integer;

rezfloat:real;

Ayear, amonth, aday, ahour, aminute, asecond, amillisecond: word;

begin

if mainflag then

begin

prosmForm.edit4.text:='';

prosmForm.edit1.text:='';

prosmForm.edit5.text:='';

prosmForm.edit43.text:='';

prosmForm.edit6.text:='';

prosmForm.edit13.text:='';

id_avto:=0;

id_plan:=MainClientsForm.DataSource1.DataSet.FieldByName ('id_plan').AsInteger;

id_zakaz:=MainClientsForm.DataSource1.DataSet.FieldByName ('id_zakaz').AsInteger;

id_avto:=MainClientsForm.DataSource1.DataSet.FieldByName ('id_avto').AsInteger;

id_fakt:=MainClientsForm.DataSource1.DataSet.FieldByName ('id_fakt').AsInteger;

datetmp:=MainClientsForm.DataSource1.DataSet.FieldByName ('date').AsDateTime;;

rez:=MainClientsForm.DataSource1.DataSet.FieldByName ('vupolnen').AsString;

if id_avto<>0 then begin

MainClientsForm.adotable4.Active:=true;

if MainClientsForm. adotable4.Locate ('id_avto', id_avto,[]) then

begin

marka:= MainClientsForm. adotable4.FieldByName ('marka').AsString;

nomer:= MainClientsForm. adotable4.FieldByName ('nomer').AsString;

driver:=MainClientsForm.adotable4.FieldByName ('driver').AsString;

tex_sost:=MainClientsForm.adotable4.FieldByName ('tex_sost').AsString;

status:=MainClientsForm.adotable4.FieldByName ('status').AsString;

klast:=MainClientsForm.adotable4.FieldByName ('klas').AsString;

end;

end;

if id_zakaz<>0 then begin

MainClientsForm.adotable3.Active:=true;

if MainClientsForm. adotable3.Locate ('id_zakaz', id_zakaz,[]) then

begin

datetmp1:= MainClientsForm. adotable3.FieldByName ('data').AsDateTime;

hour:= MainClientsForm. adotable3.FieldByName ('hour').AsFloat;

id_client:=MainClientsForm.adotable3.FieldByName ('id_client').AsInteger;

end;

end;

if id_client<>0 then begin

MainClientsForm.adotable2.Active:=true;

if MainClientsForm. adotable2.Locate ('id_client', id_client,[]) then

begin

Fio:= MainClientsForm. adotable2.FieldByName ('fio').asstring;

adres:= MainClientsForm. adotable2.FieldByName ('adres').asstring;

phone_gor:= MainClientsForm. adotable2.FieldByName ('phone_gor').AsString;

phone_mob:= MainClientsForm. adotable2.FieldByName ('phone_mob').AsString;

end;

end;

if id_fakt<>0 then begin

MainClientsForm.adotable6.Active:=true;

if MainClientsForm. adotable6.Locate ('id_fakt', id_fakt,[]) then

begin

fakt_hour:= MainClientsForm. adotable6.FieldByName ('fakt_hour').AsFloat;

id_schet:= MainClientsForm. adotable6.FieldByName ('id_schet').AsInteger;

end;

end;

if id_schet<>0 then begin

MainClientsForm.adotable7.Active:=true;

if MainClientsForm. adotable7.Locate ('id_schet', id_schet,[]) then

begin

summa:= MainClientsForm. adotable7.FieldByName ('summa').AsFloat;

//id_schet:= MainClientsForm. adotable7.FieldByName ('id_schet').AsInteger;

end;

end;

prosmForm.edit24.text:=inttostr (id_client);

prosmForm.edit25.text:=fio;

prosmForm.edit12.text:=adres;

prosmForm.edit26.text:=phone_gor;

prosmForm.edit27.text:=phone_mob;

prosmForm.edit14.text:=floattostr (fakt_hour);

prosmForm.edit17.text:=floattostr (summa);

prosmForm.edit13.text:=datetostr (datetmp1);

prosmForm.edit6.text:=floattostr (hour);

prosmForm.edit4.text:=inttostr (id_plan);

prosmForm.edit1.text:=inttostr (id_zakaz);

prosmForm.edit5.text:=datetostr (datetmp);

prosmForm.edit43.text:=marka;

prosmForm.edit15.text:=nomer;

prosmForm.edit16.text:=driver;

prosmForm.edit34.text:=tex_sost;

prosmForm.edit35.text:=status;

prosmForm.edit42.text:=klast;

if rez='y' then prosmForm. CheckBox1.Checked:=true

else prosmForm. CheckBox1.Checked:=false;

end;

procedure TMainClientsForm. N4Click (Sender: TObject);

var zakForm: Taddform;

begin

mainflag:=false;

IsMDIChildOpen (MainClientsForm,'zakForm');

IsMDIChildOpen (MainClientsForm,'addForm');

zakForm:=Taddform.Create (Owner);

zakForm.Top:=240;

zakForm.Left:=3;

zakForm.Caption:='создание заказа / клиента';

zakForm.Show;

zakForm.GroupBox1.Visible:=false;

zakForm.GroupBox2.Visible:=false;

zakForm.GroupBox4.Visible:=true;

zakForm.GroupBox4.Left:=2;

zakForm.GroupBox4.Top:=2;

end;

procedure TMainClientsForm. N14Click (Sender: TObject);

var poisk: Tparampoik;

begin

IsMDIChildOpen (MainClientsForm,'DBDirectoryTemplateForm');

IsMDIChildOpen (MainClientsForm,'addform');

IsMDIChildOpen (MainClientsForm,'parampoik');

poisk:=Tparampoik.Create (Owner);

poisk.Left:=530;

poisk.Top:=3;

poisk.Width:=300;

poisk.Caption:='необслуженные заказы';

nomer_poisk:=1;

poisk.Edit1.Visible:=false;

poisk.Label1.Visible:=false;

poisk.Label2.Visible:=false;

poisk.Label3.Visible:=false;

poisk.Label7.Visible:=false;

poisk.Edit2.Visible:=false;

poisk.Edit3.Visible:=false;

poisk.Edit4.Visible:=false;

poisk.Edit5.Visible:=false;

poisk.Edit6.Visible:=false;

poisk.Edit7.Visible:=false;

poisk.UpDown1.Visible:=false;

poisk.UpDown2.Visible:=false;

poisk.UpDown3.Visible:=false;

poisk.UpDown4.Visible:=false;

end;

procedure TMainClientsForm. N15Click (Sender: TObject);

var poisk: Tparampoik;

begin

IsMDIChildOpen (MainClientsForm,'DBDirectoryTemplateForm');

IsMDIChildOpen (MainClientsForm,'addform');

IsMDIChildOpen (MainClientsForm,'parampoik');

poisk:=Tparampoik.Create (Owner);

poisk.Left:=530;

poisk.Top:=3;

poisk.Width:=300;

poisk.Caption:='все заказы на дату';

nomer_poisk:=2;

poisk.Edit1.Visible:=false;

poisk.Label1.Visible:=false;

poisk.Label3.Visible:=false;

poisk.Label2.Visible:=false;

poisk.Edit5.Visible:=false;

poisk.Edit6.Visible:=false;

poisk.Edit7.Visible:=false;

poisk.UpDown3.Visible:=false;

poisk.UpDown4.Visible:=false;

end;

procedure TMainClientsForm. N16Click (Sender: TObject);

var poisk: Tparampoik;

begin

IsMDIChildOpen (MainClientsForm,'DBDirectoryTemplateForm');

IsMDIChildOpen (MainClientsForm,'addform');

IsMDIChildOpen (MainClientsForm,'parampoik');

poisk:=Tparampoik.Create (Owner);

poisk.Left:=530;

poisk.Top:=3;

poisk.Width:=300;

poisk.Caption:='все операции по дате';

nomer_poisk:=3;

poisk.Edit1.Visible:=false;

poisk.Label1.Visible:=false;

poisk.Label3.Visible:=false;

poisk.Label2.Visible:=false;

poisk.Edit5.Visible:=false;

poisk.Edit6.Visible:=false;

poisk.Edit7.Visible:=false;

poisk.UpDown3.Visible:=false;

poisk.UpDown4.Visible:=false;

end;

procedure TMainClientsForm. N17Click (Sender: TObject);

var poisk: Tparampoik;

begin

IsMDIChildOpen (MainClientsForm,'DBDirectoryTemplateForm');

IsMDIChildOpen (MainClientsForm,'addform');

IsMDIChildOpen (MainClientsForm,'parampoik');

poisk:=Tparampoik.Create (Owner);

poisk.Left:=530;

poisk.Top:=3;

poisk.Width:=300;

poisk.Caption:='Создание фактического проката';

nomer_poisk:=6;

poisk.Label2.Visible:=false;

poisk.Label3.Visible:=false;

poisk.Label7.Visible:=false;

poisk.Edit2.Visible:=false;

poisk.Edit3.Visible:=false;

poisk.Edit4.Visible:=false;

poisk.Edit5.Visible:=false;

poisk.Edit6.Visible:=false;

poisk.Edit7.Visible:=false;

poisk.Edit8.Visible:=true;

poisk.Label4.Visible:=true;

poisk.UpDown1.Visible:=false;

poisk.UpDown2.Visible:=false;

poisk.UpDown3.Visible:=false;

poisk.UpDown4.Visible:=false;

poisk.Label1.Caption:='номер заказа';

poisk.Button1.Caption:='создание'

end;

procedure TMainClientsForm. N18Click (Sender: TObject);

begin

IsMDIChildOpen (MainClientsForm,'DBDirectoryTemplateForm');

IsMDIChildOpen (MainClientsForm,'addForm');

mainflag:=false;

mainclientsform.DataSource1.DataSet:=mainclientsform.ADOTable8;

mainclientsform.ADOTable7.Active:=true;

MainClientsForm.BuildGridDatabaseDirectoryItem ('Расписание заправок в аэропорту', mainclientsform. DataSource1);

DirectoryForm.TableDBGrid.Fields[0]. DisplayLabel:='ID зап';

DirectoryForm.TableDBGrid.Fields[1]. DisplayLabel:='ID самолета';

DirectoryForm.TableDBGrid.Fields[2]. DisplayLabel:='Окончание';

DirectoryForm.TableDBGrid.Fields[3].DisplayLabel:='ID рейса';

DirectoryForm.TableDBGrid.Fields[4]. DisplayLabel:='Компания';

end;

procedure TMainClientsForm. N11Click (Sender: TObject);

var poisk: Tparampoik;

begin

IsMDIChildOpen (MainClientsForm,'DBDirectoryTemplateForm');

IsMDIChildOpen (MainClientsForm,'addform');

IsMDIChildOpen (MainClientsForm,'parampoik');

poisk:=Tparampoik.Create (Owner);

poisk.Left:=530;

poisk.Top:=3;

poisk.Width:=300;

poisk.Caption:='все операции на дату';

nomer_poisk:=4;

poisk.Edit1.Visible:=false;

poisk.Label1.Visible:=false;

poisk.Label3.Visible:=false;

poisk.Label2.Visible:=false;

end;

procedure TMainClientsForm. N19Click (Sender: TObject);

var poisk: Tparampoik;

begin

IsMDIChildOpen (MainClientsForm,'DBDirectoryTemplateForm');

IsMDIChildOpen (MainClientsForm,'addform');

IsMDIChildOpen (MainClientsForm,'parampoik');

poisk:=Tparampoik.Create (Owner);

poisk.Left:=530;

poisk.Top:=3;

poisk.Width:=300;

poisk.Caption:='Создание плана проката';

nomer_poisk:=5;

poisk.Label2.Visible:=false;

poisk.Label3.Visible:=false;

poisk.Label7.Visible:=false;

poisk.Edit2.Visible:=false;

poisk.Edit3.Visible:=false;

poisk.Edit4.Visible:=false;

poisk.Edit5.Visible:=false;

poisk.Edit6.Visible:=false;

poisk.Edit7.Visible:=false;

poisk.UpDown1.Visible:=false;

poisk.UpDown2.Visible:=false;

poisk.UpDown3.Visible:=false;

poisk.UpDown4.Visible:=false;

poisk.Label1.Caption:='номер заказа';

poisk.Button1.Caption:='создание'

end;

end.

unit parampoisk;

interface

uses

Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,

Dialogs, DB, ADODB, Menus, ChildTemplate, Grids, DBGrids, addsorce,

StdCtrls, Mask, DateUtils, ExtCtrls, ComCtrls ;

type

Tparampoik = class (TForm)

Button1: TButton;

GroupBox1: TGroupBox;

Label1: TLabel;

Edit1: TEdit;

Label7: TLabel;

Edit2: TEdit;

UpDown1: TUpDown;

Edit3: TEdit;

Edit4: TEdit;

UpDown2: TUpDown;

Edit5: TEdit;

UpDown3: TUpDown;

Edit6: TEdit;

UpDown4: TUpDown;

Edit7: TEdit;

Label2: TLabel;

Label3: TLabel;

Label4: TLabel;

Edit8: TEdit;

procedure RzBitBtn4Click (Sender: TObject);

procedure RzBitBtn3Click (Sender: TObject);

procedure FormClose (Sender: TObject; var Action: TCloseAction);

procedure Button1Click (Sender: TObject);

private

{ Private declarations }

public

{ Public declarations }

end;

var

parampoik: Tparampoik;

ChildTemplateForm1: TChildTemplateForm;

ff:string;

flagpoisk:boolean;

p1,p2:tparameter;

all:boolean;

ahour, aminute, asecond, amillisecond: word;

priznak:string;

stroka_SQL, pole, tabl, srtkl, name_poisk, sqlwhere: string;

idnakl, idzapas, i, sravn, kolnakl, kolzapas, rezerv_kol:integer;

implementation

uses mainclients;

{$R *.dfm}

procedure Tparampoik. FormClose (Sender: TObject; var Action: TCloseAction);

begin

Action:=caFree;

end;

procedure Tparampoik. RzBitBtn3Click (Sender: TObject);

var ChildTemplateForm: TChildTemplateform;

all:boolean;

stroka_SQL, pole, tabl, srtkl, name_poisk, sqlwhere: string;

fl_book, fl_avtor, fl_izdat, fl_location, fl_vid, fl_category:boolean;

begin

MainClientsForm.IsMDIChildOpen (MainClientsForm,'DBDirectoryTemplateForm');

MainClientsForm.IsMDIChildOpen (MainClientsForm,'addform');

MainClientsForm.IsMDIChildOpen (MainClientsForm,'ChildTemplateForm');

ChildTemplateForm:=TChildTemplateform.Create (Owner);

ChildTemplateForm.Left:=0;

ChildTemplateForm.Top:=3;

mainclientsform.DataSource1.DataSet:=mainclientsform.ADOQuery1;

mainclientsform.ADOQuery1.Active:=false;

mainclientsform.ADOQuery1.SQL.Clear;

P1 :=mainclientsform.ADOQuery1.Parameters.AddParameter;

P1.Name:='P1';

p1.DataType := ftstring;

end;

procedure Tparampoik. RzBitBtn4Click (Sender: TObject);

begin

flagpoisk:=false;

MainClientsForm.IsMDIChildOpen (MainClientsForm,'parampoik');

end;

procedure Tparampoik. Button1Click (Sender: TObject);

var ChildTemplateForm: TChildTemplateform;

timenach, timekon: tdatetime;

begin

MainClientsForm.IsMDIChildOpen (MainClientsForm,'DBDirectoryTemplateForm');

MainClientsForm.IsMDIChildOpen (MainClientsForm,'addform');

MainClientsForm.IsMDIChildOpen (MainClientsForm,'ChildTemplateForm');

ChildTemplateForm:=TChildTemplateform.Create (Owner);

ChildTemplateForm.Left:=0;

ChildTemplateForm.Top:=3;

mainclientsform.DataSource1.DataSet:=mainclientsform.ADOQuery2;

mainclientsform.ADOQuery2.Active:=false;

mainclientsform.ADOQuery2.SQL.Clear;

if nomer_poisk=1 then begin

P1 :=mainclientsform.ADOQuery2.Parameters.AddParameter;

P1.Name:='P1';

p1.DataType := ftstring;

srtkl:='%'+'n'+'%';

P1.Value:=srtkl;

P1.Size:=Length (srtkl);

ChildTemplateForm.Label1.Caption:='Невыполненные заказы: '+edit1.Text;

sqlwhere:= ' where zakaz. vupolnen like: P1';

stroka_SQL:='select * from zakaz'+sqlwhere ;

mainclientsform.ADOQuery2.SQL.Add (stroka_SQL);

if stroka_SQL<>'' then begin

mainclientsform.ADOQuery2.Active:=true;

mainclientsform.ADOQuery2.ExecSQL;

end;

end;

if nomer_poisk=2 then begin

P1 :=mainclientsform.ADOQuery2.Parameters.AddParameter;

P1.Name:='P1';

p1.DataType := ftdatetime;

ayear:= strtoint (Edit4.Text);

amonth:=strtoint (Edit3.Text);

aday:=strtoint (Edit2.Text);

ahour:=0;

aminute:=0;

asecond:=0;

amillisecond:=0;

timenach:=encodedatetime (Ayear, amonth, aday, ahour, aminute, asecond, amillisecond);

srtkl:='%'+ srtkl+'%';

P1.Value := timenach;

sqlwhere:= ' where zakaz. data = :P1';

stroka_SQL:='select * from zakaz '+ sqlwhere;

mainclientsform.ADOQuery2.SQL.Add (stroka_SQL);

if stroka_SQL<>'' then begin

mainclientsform.ADOQuery2.Active:=true;

mainclientsform.ADOQuery2.ExecSQL;

end;

end;

if nomer_poisk=3 then begin

P1 :=mainclientsform.ADOQuery2.Parameters.AddParameter;

P1.Name:='P1';

p1.DataType := ftdatetime;

ayear:= strtoint (Edit4.Text);

amonth:=strtoint (Edit3.Text);

aday:=strtoint (Edit2.Text);

ahour:=0;

aminute:=0;

asecond:=0;

amillisecond:=0;

timenach:=encodedatetime (Ayear, amonth, aday, ahour, aminute, asecond, amillisecond);

srtkl:='%'+ srtkl+'%';

P1.Value := timenach;

sqlwhere:= ' where plan_prokata.date = :P1';

stroka_SQL:='select * from plan_prokata '+ sqlwhere;

mainclientsform.ADOQuery2.SQL.Add (stroka_SQL);

if stroka_SQL<>'' then begin

mainclientsform.ADOQuery2.Active:=true;

mainclientsform.ADOQuery2.ExecSQL;

end;

end;

if nomer_poisk=4 then begin

P1 :=mainclientsform.ADOQuery2.Parameters.AddParameter;

P1.Name:='P1';

p1.DataType := ftdatetime;

ayear:= strtoint (Edit4.Text);

amonth:=strtoint (Edit3.Text);

aday:=strtoint (Edit2.Text);

ahour:=0;

aminute:=0;

asecond:=0;

amillisecond:=0;

timenach:=encodedatetime (Ayear, amonth, aday, ahour, aminute, asecond, amillisecond);

ayear:= strtoint (Edit7.Text);

amonth:=strtoint (Edit6.Text);

aday:=strtoint (Edit5.Text);

ahour:=0;

aminute:=0;

asecond:=0;

amillisecond:=0;

timekon:=encodedatetime (Ayear, amonth, aday, ahour, aminute, asecond, amillisecond);

P2 :=mainclientsform.ADOQuery2.Parameters.AddParameter;

P2.Name:='P2';

p2.DataType := ftdatetime;

P1.Value := timenach;

P2.Value := timekon;

sqlwhere:= ' where (plan_prokata.date > :P1) and (plan_prokata.date < :P2)';

stroka_SQL:='select * from plan_prokata'+ sqlwhere;

mainclientsform.ADOQuery2.SQL.Add (stroka_SQL);

if stroka_SQL<>'' then begin

mainclientsform.ADOQuery2.Active:=true;

mainclientsform.ADOQuery2.ExecSQL;

end;

end;

if nomer_poisk=5 then begin

P1 :=mainclientsform.ADOQuery2.Parameters.AddParameter;

P1.Name:='P1';

p1.DataType := ftinteger;

if edit1. Text<>'' then

begin

idnakl:=strtoint (edit1.Text);

P1.Value :=idnakl;

sqlwhere:= ' where (zakaz.id_zakaz = :P1)';

stroka_SQL:='select * from zakaz'+ sqlwhere;

mainclientsform.ADOQuery2.SQL.Add (stroka_SQL);

if stroka_SQL<>'' then begin

mainclientsform.ADOQuery2.Active:=true;

mainclientsform.ADOQuery2.ExecSQL;

end;

kol:= mainclientsform. ADOQuery2.RecordCount;

if kol=0 then showmessage ('такого заказа не существует')

else

begin

idzakaz:=mainclientsform.ADOQuery2.FieldByName ('id_zakaz').AsInteger;

priznak:=mainclientsform.ADOQuery2.FieldByName ('vupolnen').AsString;

if priznak='n' then begin

klast:='';

MainClientsForm.ADOTable3.Active:=true;

if MainClientsForm. adotable3.Locate ('id_zakaz', idzakaz,[]) then

begin

klast:=mainclientsform.adotable3.FieldByName ('klas').AsString;

end;

if klast<>'' then

id_avto:=0;

MainClientsForm.ADOTable4.Active:=true;

if MainClientsForm. adotable4.Locate ('klas', klast,[]) then

begin

id_avto:=mainclientsform.adotable4.FieldByName ('id_avto').AsInteger;

end;

if id_avto<>0 then

begin

MainClientsForm.ADOTable1.Active:=true;

MainClientsForm.ADOTable1.Insert;

mainclientsform.adotable1.FieldByName ('id_avto').AsInteger:=id_avto;

mainclientsform.adotable1.FieldByName ('id_zakaz').AsInteger:=id_zakaz;

mainclientsform.adotable1.FieldByName ('id_fakt').AsInteger:=0;

mainclientsform.adotable1.FieldByName ('date').AsDateTime:=now;

mainclientsform.adotable1.FieldByName ('vupolnen').asstring:='n';

MainClientsForm.ADOTable1.Post;

showmessage ('Мероприятие спланировано успешно');

end;

end

else showmessage ('Выполнение заказа не требуется')

end;

end;

end;

if nomer_poisk=6 then begin

P1 :=mainclientsform.ADOQuery2.Parameters.AddParameter;

P1.Name:='P1';

p1.DataType := ftinteger;

if edit1. Text<>'' then

begin

idnakl:=strtoint (edit1.Text);

P1.Value :=idnakl;

sqlwhere:= ' where (plan_prokata.id_zakaz = :P1)';

stroka_SQL:='select * from plan_prokata'+ sqlwhere;

mainclientsform.ADOQuery2.SQL.Add (stroka_SQL);

if stroka_SQL<>'' then begin

mainclientsform.ADOQuery2.Active:=true;

mainclientsform.ADOQuery2.ExecSQL;

end;

kol:= mainclientsform. ADOQuery2.RecordCount;

if kol=0 then showmessage ('такого заказа не существует')

else

begin

idzakaz:=mainclientsform.ADOQuery2.FieldByName ('id_zakaz').AsInteger;

priznak:=mainclientsform.ADOQuery2.FieldByName ('vupolnen').AsString;

if priznak='y' then begin

mainclientsform.ADOTable6.Active:=true;

mainclientsform.ADOTable6.Insert;

mainclientsform.adotable6.FieldByName ('id_avto').AsInteger:=id_avto;

mainclientsform.adotable6.FieldByName ('id_zakaz').AsInteger:=idzakaz;

mainclientsform.adotable6.FieldByName ('fakt_hour').AsFloat:=strtofloat (edit8.Text);

mainclientsform.ADOTable6.Post;

end;

end;

end;

end;

end;

end.

unit addsorce;

interface

uses

Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,

Dialogs, DB, ADODB, Menus, ChildTemplate, Grids, DBGrids,

StdCtrls, Mask, DateUtils, ExtCtrls, ComCtrls, DBCtrls ;

type

TaddForm = class (TForm)

Panel1: TPanel;

GroupBox1: TGroupBox;

GroupBox2: TGroupBox;

Edit16: TEdit;

DBNavigator1: TDBNavigator;

Edit13: TEdit;

Label10: TLabel;

Label9: TLabel;

Label7: TLabel;

Label5: TLabel;

Label1: TLabel;

Edit1: TEdit;

Edit5: TEdit;

Edit2: TEdit;

Edit3: TEdit;

gk: TLabel;

Label3: TLabel;

Label6: TLabel;

Edit12: TEdit;

Label13: TLabel;

Label12: TLabel;

Edit15: TEdit;

Edit4: TEdit;

GroupBox4: TGroupBox;

Button3: TButton;

Label4: TLabel;

Edit42: TEdit;

CheckBox1: TCheckBox;

Label32: TLabel;

Edit43: TEdit;

Label8: TLabel;

Edit6: TEdit;

Label23: TLabel;

Label24: TLabel;

Label25: TLabel;

Label28: TLabel;

Label29: TLabel;

Label33: TLabel;

Edit7: TEdit;

Edit8: TEdit;

Edit9: TEdit;

Edit10: TEdit;

Edit11: TEdit;

Edit30: TEdit;

Label15: TLabel;

Label16: TLabel;

Label17: TLabel;

Label18: TLabel;

Label19: TLabel;

Edit19: TEdit;

Edit20: TEdit;

Edit21: TEdit;

Edit22: TEdit;

Edit23: TEdit;

Label21: TLabel;

Edit24: TEdit;

Edit25: TEdit;

Label22: TLabel;

Edit26: TEdit;

Edit27: TEdit;

Label26: TLabel;

Edit28: TEdit;

Label27: TLabel;

Edit29: TEdit;

Edit31: TEdit;

Label30: TLabel;

Label35: TLabel;

Edit34: TEdit;

Label36: TLabel;

Edit35: TEdit;

Label37: TLabel;

Button2: TButton;

Edit36: TEdit;

Label38: TLabel;

Edit37: TEdit;

Button4: TButton;

Label20: TLabel;

Edit18: TEdit;

Label2: TLabel;

Edit14: TEdit;

Label11: TLabel;

Edit17: TEdit;

procedure Button4Click (Sender: TObject);

procedure FormClose (Sender: TObject; var Action: TCloseAction);

procedure Button1Click (Sender: TObject);

procedure Button2Click (Sender: TObject);

procedure Button3Click (Sender: TObject);

private

{ Private declarations }

public

{ Public declarations }

end;

var

addForm: TaddForm;

naim:string;

ed_izm:string;

kolvo:integer;

cena:real;

nomerpartiya:string;

sernum:string;

srok_godnost:tdate;

data_postavka:tdate;

postavchik:string;

description:string;

location:string;

location_part:string;

primech:string;

Ayear, amonth, aday: word;

razmer_part, kol: integer;

idaddional, idlocation, idzapas: integer;

idplan, idzakaz, idfuel, idzapravshik, idoperaciya, idatribute: integer;

massa, plotnost: real;

data_start, otpr, datefinish, datastart, datafinish: tdatetime;

edinica, gsm, vidgsm, marka, nomer: string;

tip:string;

idreys:integer;

idairplane, idatributte: integer;

marka_plane, typeplane, bort_nomer, prinadlegnost, stoyanka: string;

nomer_reys, mestotart, mestonazn, rastoyan, companiya: string;

nomer_kontrolnogo_talona, familya_explorer, familya_ispol, untikristal_marka,

untikristal_soderg, vid: string;

nomer_dokumen, vupolnen: string;

datasozdaniya, data_finish :tdatetime;

massa_zak:real;

implementation

uses MainClients;

{$R *.dfm}

procedure TaddForm. FormClose (Sender: TObject; var Action: TCloseAction);

begin

Action:=caFree;

end;

procedure TaddForm. Button1Click (Sender: TObject);

begin

groupbox1.visible:=true;

gsm:=edit1.Text;

vidgsm:= edit42. Text;

tip:=edit19.Text;

if edinica<>'' then begin

MainClientsForm.ADOTable3.Active:=true;

MainClientsForm.ADOTable3.Insert;

MainClientsForm.ADOTable3.FieldByName ('name_edinica').AsString:=edinica;

MainClientsForm.ADOTable3.Post;

idedinica:=MainClientsForm.ADOTable3.FieldByName ('idedinica').AsInteger;

end;

if gsm<>'' then begin

MainClientsForm.ADOTable2.Active:=true;

MainClientsForm.ADOTable2.Insert;

MainClientsForm.ADOTable2.FieldByName ('fuel').AsString:=gsm;

MainClientsForm.ADOTable2.FieldByName ('marka').AsString:=marka;

MainClientsForm.ADOTable2.FieldByName ('vid_GSM').AsString:= vidgsm;

MainClientsForm.ADOTable2.FieldByName ('idedinica').AsInteger:= idedinica;

MainClientsForm.ADOTable2.Post;

idfuel:=MainClientsForm.ADOTable2.FieldByName ('idfuel').AsInteger;

end;

if edinica<>'' then begin

MainClientsForm.ADOTable7.Active:=true;

MainClientsForm.ADOTable7.Insert;

MainClientsForm.ADOTable7.FieldByName ('nomer').AsString:=nomer;

MainClientsForm.ADOTable7.FieldByName ('type').AsString:=tip;

MainClientsForm.ADOTable7.Post;

idzapravshik:=MainClientsForm.ADOTable7.FieldByName ('id_zapravshik').AsInteger;

end;

marka_plane:=edit12.Text;

typeplane:=edit16.Text;

bort_nomer:=edit15.Text;

prinadlegnost:=edit24.Text;

stoyanka:= edit35. Text;

if edit15. Text<>'' then begin

MainClientsForm.ADOTable9.Active:=true;

MainClientsForm.ADOTable9.Insert;

MainClientsForm.ADOTable9.FieldByName ('marka_plane').asstring :=marka_plane;

MainClientsForm.ADOTable9.FieldByName ('type').asstring := typeplane;

MainClientsForm.ADOTable9.FieldByName ('bort_nomer').asstring := bort_nomer;

MainClientsForm.ADOTable9.FieldByName ('stoynka').asstring := stoyanka;

MainClientsForm.ADOTable9.Post;

idairplane:=MainClientsForm.ADOTable9.FieldByName ('idairplane').AsInteger;

end;

nomer_reys:=edit6.text;

mestotart:=edit26.text;

mestonazn:=edit27.text;

rastoyan:= edit25. text;

otpr:=strtodatetime (edit6.text);

if edit6. Text<>'' then

begin

MainClientsForm.ADOTable10.Active:=true;

MainClientsForm.ADOTable10.Insert;

MainClientsForm.ADOTable10.FieldByName ('nomer').asstring:=nomer_reys;

MainClientsForm.ADOTable10.FieldByName ('mestostart').asstring:= mestotart;

MainClientsForm.ADOTable10.FieldByName ('mestonazn').asstring:= mestonazn;

MainClientsForm.ADOTable10.FieldByName ('rastoyan').asstring:= rastoyan;

MainClientsForm.ADOTable10.FieldByName ('otpr').asdatetime:=otpr;

MainClientsForm.ADOTable10.Post;

idreys:=MainClientsForm.ADOTable10.FieldByName ('idreys').AsInteger;

end;

datefinish:=strtodatetime (edit34.text);

companiya:=edit13.Text;

if edit13. text<>'' then begin

MainClientsForm.ADOTable8.Active:=true;

MainClientsForm.ADOTable8.Insert;

MainClientsForm.ADOTable8.FieldByName ('companiya').asstring :=companiya;

if idairplane<>0 then

MainClientsForm.ADOTable8.FieldByName ('idairplane').AsInteger := idairplane;

if idreys<>0 then

MainClientsForm.ADOTable8.FieldByName ('idreys').AsInteger := idreys;

MainClientsForm.ADOTable8.FieldByName ('datefinish').AsDateTime := datefinish;

MainClientsForm.ADOTable8.Post;

if edit28. Text<>'' then begin

MainClientsForm.ADOTable6.Active:=true;

MainClientsForm.ADOTable6.Insert;

MainClientsForm.ADOTable6.FieldByName ('nomer_kontrolnogo_talona').AsString:=nomer_kontrolnogo_talona;

MainClientsForm.ADOTable6.FieldByName ('familya_explorer').AsString:=familya_explorer;

MainClientsForm.ADOTable6.FieldByName ('familya_ispol').AsString:=familya_ispol;

MainClientsForm.ADOTable6.FieldByName ('untikristal_marka').AsString:=untikristal_marka;

MainClientsForm.ADOTable6.FieldByName ('untikristal_soderg').AsString:=untikristal_soderg;

MainClientsForm.ADOTable6.Post;

idatributte:=MainClientsForm.ADOTable6.FieldByName ('idatributte').AsInteger;

end;

datastart :=strtodatetime (edit22.text);

datafinish:=strtodatetime (edit23.text);

vid:=edit3.Text;

if edit3. Text<>'' then

begin

MainClientsForm.ADOTable5.Active:=true;

MainClientsForm.ADOTable5.Insert;

MainClientsForm.ADOTable5.FieldByName ('datastart').asdatetime := datastart;

MainClientsForm.ADOTable5.FieldByName ('datafinish').asdatetime := datafinish;

MainClientsForm.ADOTable5.FieldByName ('vid').AsString:=vid;

MainClientsForm.ADOTable5.Post;

idoperaciya:=MainClientsForm.ADOTable5.FieldByName ('idoperaciya').AsInteger;

end;

datasozdaniya:=now;

// datefinish:= strtodatetime (edit17.Text);

data_start:=strtodatetime (edit5.Text);

nomer_dokumen:=edit4.Text;

MainClientsForm.ADOTable4.Active:=true;

MainClientsForm.ADOTable4.Insert;

massa_zak:=strtofloat (edit3.Text);

MainClientsForm.ADOTable4.FieldByName ('massa').AsFloat := massa_zak;

if idfuel<>0 then

MainClientsForm.ADOTable4.FieldByName ('idfuel').AsInteger := idfuel;

MainClientsForm.ADOTable4.FieldByName ('nomer_dokumen').Asstring := nomer_dokumen;

MainClientsForm.ADOTable4.FieldByName ('datasozdaniya').AsDateTime:=datasozdaniya;

if edit5. Text<>'' then

MainClientsForm.ADOTable4.FieldByName ('data_start').AsDateTime:=data_start;

//if edit17. Text<>'' then

MainClientsForm.ADOTable4.FieldByName ('data_finish').AsDateTime:=data_finish;

MainClientsForm.ADOTable4.FieldByName ('vupolnen').AsString:='n';

if idraspisan<>0 then

MainClientsForm.ADOTable4.FieldByName ('idraspisan').AsInteger := idraspisan;

if idoperaciya<>0 then

MainClientsForm.ADOTable4.FieldByName ('idoperaciya').AsInteger := idoperaciya;

MainClientsForm.ADOTable4.Post;

idzakaz:=MainClientsForm.ADOTable4.FieldByName ('idzakaz').AsInteger;

if edit3. text<>'' then

begin

MainClientsForm.ADOTable1.Active:=true;

MainClientsForm.ADOTable1.Insert;

MainClientsForm.ADOTable1.FieldByName ('idzakaz').AsInteger := idzakaz;

MainClientsForm.ADOTable1.FieldByName ('idfuel').AsInteger := idfuel;

MainClientsForm.ADOTable1.FieldByName ('massa').AsFloat := massa_zak;

MainClientsForm.ADOTable1.FieldByName ('data_start').AsDateTime := data_start;

MainClientsForm.ADOTable1.FieldByName ('id_zapravshik').AsInteger := idzapravshik;

MainClientsForm.ADOTable1.FieldByName ('idoperaciya').AsInteger := idoperaciya;

MainClientsForm.ADOTable1.FieldByName ('idatributte').AsInteger := idatributte;

MainClientsForm.ADOTable1.Post;

end;

end;

procedure TaddForm. Button2Click (Sender: TObject);

var tovar, srtkl, name_poisk, sqlwhere, stroka_SQL :string;

p1:tparameter;

begin

fio:=edit9.Text;

adres:=edit10.Text;

phone_gor:=edit11.Text;

phone_mob:=edit8.Text;

kol_poezdok:=strtoint (edit30.Text);

MainClientsForm.ADOTable2.Active:=true;

MainClientsForm.ADOTable2.Insert;

MainClientsForm.ADOTable2.FieldByName ('FIO').AsString:= fio;

MainClientsForm.ADOTable2.FieldByName ('adres').AsString:= adres;

MainClientsForm.ADOTable2.FieldByName ('phone_gor').AsString:= phone_gor;

MainClientsForm.ADOTable2.FieldByName ('phone_mob').AsString:= phone_mob;

MainClientsForm.ADOTable2.FieldByName ('kol_poezdok').AsInteger:= kol_poezdok;

MainClientsForm.ADOTable2.post;

id_client:=MainClientsForm.ADOTable2.FieldByName ('id_client').AsInteger;

data:=strtodatetime (edit7.Text);

hour:=strtofloat (edit36.Text);

klas:=edit37.Text;

MainClientsForm.ADOTable3.Active:=true;

MainClientsForm.ADOTable3.Insert;

MainClientsForm.ADOTable3.FieldByName ('vupolnen').AsString:= 'n';

MainClientsForm.ADOTable3.FieldByName ('data').AsDateTime:= data;

MainClientsForm.ADOTable3.FieldByName ('klas').AsString:= klas;

MainClientsForm.ADOTable3.FieldByName ('id_client').AsInteger:=id_client;

MainClientsForm.ADOTable3.post;

id_zakaz:=MainClientsForm.ADOTable3.FieldByName ('id_zakaz').AsInteger;

end;

procedure TaddForm. Button3Click (Sender: TObject);

var tovar, srtkl, name_poisk, sqlwhere, stroka_SQL :string;

p1:tparameter;

begin

mainclientsform.DataSource1.DataSet:=mainclientsform.ADOQuery2;

mainclientsform.ADOQuery2.Active:=false;

mainclientsform.ADOQuery2.SQL.Clear;

P1 :=mainclientsform.ADOQuery2.Parameters.AddParameter;

P1.Name:='P1';

p1.DataType := ftstring;

if srtkl<>'' then

begin

srtkl:='%'+ srtkl+'%';

P1.Value:=srtkl;

P1.Size:=Length (srtkl);

end;

stroka_SQL:='select * from tovar where tovar. nametovar like: P1';

mainclientsform.ADOQuery2.SQL.Add (stroka_SQL);

if stroka_SQL<>'' then begin

mainclientsform.ADOQuery2.Active:=true;

mainclientsform.ADOQuery2.ExecSQL;

end;

kol:= mainclientsform. ADOQuery2.RecordCount;

if kol=0 then showmessage ('такого товара не существует')

else

begin

mainclientsform.ADOTable2.Active:=true;

mainclientsform.ADOTable2.Insert;

srok_godnost:=encodedate (Ayear, amonth, aday);

mainclientsform.ADOTable2.FieldByName ('vremya').AsDateTime:=srok_godnost;

mainclientsform.ADOTable2.post;

end;

end;

procedure TaddForm. Button4Click (Sender: TObject);

begin

marka:=edit20.Text;

klast:=edit21.text;

nomer:=edit19.Text;

driver:=edit22.Text;

tex_sost:=edit29.Text;

status:=edit28.Text;

description:=edit31.Text;

notes:=edit23.Text;

tarif:=strtofloat (edit18.Text);

{, driver, tex_sost, status, klas: string;

description, notes: string;

tarif:real;}

MainClientsForm.ADOTable4.Active:=true;

MainClientsForm.ADOTable4.Insert;

MainClientsForm.ADOTable4.FieldByName ('marka').AsString:= marka;

MainClientsForm.ADOTable4.FieldByName ('klas').AsString:= klast;

MainClientsForm.ADOTable4.FieldByName ('nomer').AsString:= nomer;

MainClientsForm.ADOTable4.FieldByName ('driver').AsString:= driver;

MainClientsForm.ADOTable4.FieldByName ('tex_sost').AsString:= tex_sost;

MainClientsForm.ADOTable4.FieldByName ('status').AsString:= status;

MainClientsForm.ADOTable4.post;

id_avto:=MainClientsForm.ADOTable4.FieldByName ('id_avto').AsInteger;

MainClientsForm.ADOTable5.Active:=true;

MainClientsForm.ADOTable5.Insert;

MainClientsForm.ADOTable5.FieldByName ('description').AsString:= description;

MainClientsForm.ADOTable5.FieldByName ('tarif').AsFloat:= tarif;

MainClientsForm.ADOTable5.FieldByName ('notes').AsString:= notes;

MainClientsForm.ADOTable5.post;

id_tarif:=MainClientsForm.ADOTable5.FieldByName ('id_tarif').AsInteger;

end;

end.

Проект avtoprokat

Главная форма приложения MainClients

childTemplate.pas

DbdDirectoryTemplate

AddSource.pas

ParamPoisk.pas

Показать весь текст

Список литературы

  1. А.Я. 100 компонентов общего назначения библиотеки Delphi 5. — М.: Бином, 1999. — 266 с.
  2. Архангельский А.Я. Delphi 6. Справочное пособие. — М.: Бином, 2001. — 1024 с.
  3. А.Я. Программирование в Delphi 6. — М.: Бином, 2001. — 564 с.
  4. А.Я. Язык SQL в Delphi 5. — М.: Бином, 2000. — 205 с.
  5. Базы данных: модели, разработка, реализация / Карпова Т.- СПб.: Питер, 2001. -304с.
  6. А.Н. Бухгалтерский учет в учреждениях непроизводственной сферы. — М.: Финансы и статистика, 1995. — 240с.
  7. Буч Г. Объектно-ориентированное проектирование с примерами применения. М., 1992. — 654с.
  8. В. Ф. Экономика предприятия. — М.: Вита-Пресс, 1998. — 380с.
  9. В. Информационная безопасность // Открытые системы- 1996. — N 1−4.
  10. С.В., Ломотько Д. В. Базы данных .- Х.: Фолио, 2002. — 504 с.
  11. Е.П. Маркетинг: стратегии, планы, структуры. М., Дело, 1995. — 450с.
  12. Е.П. Маркетинговые исследования: теория, методология и практика. М., Финпресс, 1998. — 280с.
  13. В.Э. Хомоненко А.Д. Delphi 5. — СПб.: — Санки-Петербург, 2000. -800с.
  14. В.Э. Хомоненко А.Д. Delphi 6. — СПб.: — Санки-Петербург, 2001. -1145с.
  15. А. и др. Маркетинг. М., Экономика, 1993.
  16. В. Ц. Охрана труда пользователей компьютеров. — К.: «Освгга», 1999.- 186с.
  17. З.У. Бюджетный учет и отчетность. М.: Финансы, 1970.-215с.
  18. А. И., Войленко В. В. Маркетинговый анализ. М., Центр экономики и маркетинга, 1996.
  19. Конноли Томас, Бегг Каролин. Базы данных. Проектирование, реализация и сопровождение. Теория и практика. — М.: Вильямс, 2000. — 1111 с.
  20. Культин Н.Б. Delphi 6: Программирование на OBJECT PASCAL. — М.: Бином, 2001. — 526 с.
  21. Культин Н.Б. Delphi 7: Программирование на OBJECT PASCAL. — М.: Бином, 2003. — 535 с.
  22. Я.Р., Катышев П. К., Пересецкий А. А. Эконометрика. Начальный курс. М., Дело, 1997
  23. Маклаков С.В. BPwin и ERwin. CASE-средства разработки информационных систем. — М.: Диалог-Мифи, 2001. — 304 с.
  24. В.О. Бюджетные организации: бухгалтерский учет и налогооблажение. -Харьков: Фактор, 2001. — 566с.
  25. С. Обзор АСУП для малого бизнеса. Функциональные особенности // Компьютерное обозрение № 17 (286), 2001. с.22−27. // www. ITC-UA.COM
  26. Р., Шафер Д. Шафер Л. Управление программными проектами: достижение оптимального качества при минимуме затрат. М.: «Вильямс», 2003. — 1128с.
  27. А. Поздняков В. От бухгалтерии под Windows к открытым Unix-системам // Компьютерное обозрение № 34 (402), 2003. с.22−27. www. ITC-UA.COM
  28. П.В., Фаронов В.В. Delphi 5. Руководство разработчика баз данных. — М.: Нолидж, 2000. — 635 с.
Заполнить форму текущей работой
Купить готовую работу

ИЛИ