Смекни!
smekni.com

Автоматизированная информационная система Малое авторемонтное предприятие (стр. 3 из 3)

void __fastcall TForm2::Button7Click(TObject *Sender)

{

String zapros, c1,c2,a,m;

zapros="";

zapros="SELECT * FROM Avtoremont.Zapchasti WHERE ";

c1=Edit5->Text; c2=Edit7->Text;

zapros=zapros+"Стоимось >="+c1;

zapros=zapros+"and "+ "Стоимось <= "+c2;

if (Edit4->Text!="")

{a=Edit4->Text;

zapros=zapros+" and "+ " Авто like "+"'"+a+"'";}

if (Edit6->Text!="")

{m=Edit6->Text;

zapros=zapros+" and "+ " Марка like "+"'"+m+"'";}

zapros=zapros+";";

ADOQuery1->Close();

ADOQuery1->SQL->Clear();

ADOQuery1->SQL->Add(zapros);

ADOQuery1->ExecSQL();

ADOQuery1->Active=true;

if (ADOQuery1->RecordCount==0)

{ ShowMessage("Ничего не найдено!");

DataSource1->DataSet=ADOTable1; }

else DataSource1->DataSet=ADOQuery1;

}

//---------------------------------------------------------------------------

Unit3

#include <vcl.h>

#pragma hdrstop

#include "Unit3.h"

#include "Unit2.h"

# include "Unit2.h"

//---------------------------------------------------------------------------

#pragma package(smart_init)

#pragma resource "*.dfm"

TForm3 *Form3;

//---------------------------------------------------------------------------

__fastcall TForm3::TForm3(TComponent* Owner)

: TForm(Owner)

{

}

//---------------------------------------------------------------------------

void __fastcall TForm3::Button1Click(TObject *Sender)

{

Form3->Close();

}

//---------------------------------------------------------------------------

Unit4

#include <vcl.h>

#pragma hdrstop

#include "Unit4.h"

#include "Unit2.h"

# include "Unit2.h"

//---------------------------------------------------------------------------

#pragma package(smart_init)

#pragma resource "*.dfm"

TForm4 *Form4;

//---------------------------------------------------------------------------

__fastcall TForm4::TForm4(TComponent* Owner)

: TForm(Owner)

{

}

//---------------------------------------------------------------------------

void __fastcall TForm4::Button1Click(TObject *Sender)

{

if(Form2->ADOTable1->Modified==true)

Form2->ADOTable1->Post();

Form2->Show();

Form4->Close();

}

//---------------------------------------------------------------------------

Приложение Б - диаграмма вариантов использования