Сеть магазинов по торговле промышленными товарами, страница 6

MessageBox(NULL,sql, "SQL", MB_OK);

try

{

Query1->Open();

}

catch (...)

 { }  

}

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

void __fastcall TForm4::Button8Click(TObject *Sender)

{

Edit2->Text="";

}

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

void __fastcall TForm4::Button9Click(TObject *Sender)

{

char sql[200];

Query1->Close();

sprintf(sql,"SELECT * FROM TovM");

Query1->SQL->Clear();

Query1->SQL->Add(sql);

MessageBox(NULL,sql, "SQL", MB_OK);

try

{

Query1->Open();

}

catch (...)

 { }

}

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

void __fastcall TForm4::Button10Click(TObject *Sender)

{

Edit3->Text="";       

}

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

void __fastcall TForm4::Button11Click(TObject *Sender)

{

char sql[200];

Query1->Close();

sprintf(sql,"SELECT * FROM Magazin");

Query1->SQL->Clear();

Query1->SQL->Add(sql);

MessageBox(NULL,sql, "SQL", MB_OK);

try

{

Query1->Open();

}

catch (...)

 { }

}

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

void __fastcall TForm4::Button12Click(TObject *Sender)

{

 Edit4->Text="";

 Edit5->Text="";

}

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

void __fastcall TForm4::Button13Click(TObject *Sender)

{

char sql[200];

Query1->Close();

sprintf(sql,"SELECT * FROM Sotrudnik");

Query1->SQL->Clear();

Query1->SQL->Add(sql);

MessageBox(NULL,sql, "SQL", MB_OK);

try

{

Query1->Open();

}

catch (...)

 { }

}

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

void __fastcall TForm4::Button15Click(TObject *Sender)

{

char sql[200];

Query1->Close();

sprintf(sql,"SELECT * FROM Zakaz");

Query1->SQL->Clear();

Query1->SQL->Add(sql);

MessageBox(NULL,sql, "SQL", MB_OK);

try

{

Query1->Open();

}

catch (...)

 { }

}

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

void __fastcall TForm4::Button14Click(TObject *Sender)

{

 Edit6->Text="";

}

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

void __fastcall TForm4::Button16Click(TObject *Sender)

{

Form4->Close();       

}

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

void __fastcall TForm4::N2Click(TObject *Sender)

{

Form4->Close();       

}

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

#include <vcl.h>

#pragma hdrstop

#include <stdio.h>

#include "Unit5.h"

#pragma package(smart_init)

#pragma resource "*.dfm"

TForm5 *Form5;

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

__fastcall TForm5::TForm5(TComponent* Owner)

        : TForm(Owner)

{

}

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

void __fastcall TForm5::Button1Click(TObject *Sender)

{

char sql[200];

char n2[10];

char n3[10];

Query1->Close();

StrCopy(n2,Edit1->Text.c_str());

StrCopy(n3,Edit2->Text.c_str());

//StrCopy(n2,Edit3->Text.c_str())

sprintf(sql,"EXEC UPDATECENA @n2=%s, @n3=%s",n2,n3);

Query1->SQL->Clear();

Query1->SQL->Add(sql);

try

{

Query1->Open();

}

catch (...)

 { }

}

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

void __fastcall TForm5::Button2Click(TObject *Sender)

{

Edit1->Text="";

Edit2->Text="";

}

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

void __fastcall TForm5::Button3Click(TObject *Sender)

{

char sql[200];

Query1->Close();

sprintf(sql,"SELECT * FROM TovM");

Query1->SQL->Clear();

Query1->SQL->Add(sql);

MessageBox(NULL,sql, "SQL", MB_OK);

try

{

Query1->Open();

}

catch (...)

 { }

}

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

void __fastcall TForm5::Button4Click(TObject *Sender)

{

Form5->Close();

}

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

void __fastcall TForm5::N2Click(TObject *Sender)

{

Form5->Close();

}

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

#include <vcl.h>

#pragma hdrstop

#include "Unit6.h"

#pragma package(smart_init)

#pragma resource "*.dfm"

#include <stdio.h>

TForm6 *Form6;

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

__fastcall TForm6::TForm6(TComponent* Owner)

        : TForm(Owner)

{

}

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

void __fastcall TForm6::Button1Click(TObject *Sender)

{

char sql[200];

AnsiString numbes;

DBGrid1->DataSource=DataSource1;

if (Edit1->Text!="")

{

Query1->Close();

//strcpy(numbes, Edit1->Text.str());

//numbes = Edit1->Text.ToInt();

numbes = Edit1->Text;

sprintf(sql,"SELECT Sotrudnik.FIO,Sotrudnik.Dolgnost,Sotrudnik.numbe FROM        Sotrudnik WHERE Sotrudnik.numbe=%s", numbes.c_str());

//MessageBox(NULL,sql, "SQL", MB_OK);

Query1->SQL->Clear();

Query1->SQL->Add(sql);

}

try

{

Query1->Open();

}

catch (...)

 { }

}

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

void __fastcall TForm6::Button2Click(TObject *Sender)

{

char sql[200];

AnsiString numbes;

DBGrid1->DataSource=DataSource1;

if (Edit2->Text!="")