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

void __fastcall TForm3::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 TForm3::Button10Click(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 TForm3::Button11Click(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 TForm3::Button8Click(TObject *Sender)

{

Edit5->Text="";

Edit6->Text="";

Edit7->Text="";

Edit8->Text="";

Edit9->Text="";

}

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

void __fastcall TForm3::Button12Click(TObject *Sender)

{

Edit15->Text="";

Edit16->Text="";

Edit17->Text="";

Edit18->Text="";

Edit19->Text="";  

}

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

void __fastcall TForm3::Button13Click(TObject *Sender)

{

Edit10->Text="";

Edit11->Text="";

Edit12->Text="";

Edit13->Text="";

Edit14->Text="";

}

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

void __fastcall TForm3::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 TForm3::Button16Click(TObject *Sender)

{

Form3->Close();       

}

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

void __fastcall TForm3::Button14Click(TObject *Sender)

{

Edit20->Text="";

Edit21->Text="";

Edit22->Text="";

Edit23->Text="";

Edit25->Text="";

 Edit24->Text="";

}

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

#include <vcl.h>

#pragma hdrstop

#include <stdio.h>

#include "Unit4.h"

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

#pragma package(smart_init)

#pragma resource "*.dfm"

TForm4 *Form4;

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

__fastcall TForm4::TForm4(TComponent* Owner)

        : TForm(Owner)

{

}

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

void __fastcall TForm4::Button1Click(TObject *Sender)

{

char sql[200];

char n1[10];

char n2[10];

Query1->Close();

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

sprintf(sql,"EXEC DELETETOVS @n1=%s",n1);

Query1->SQL->Clear();

Query1->SQL->Add(sql);

try

{

Query1->Open();

}

catch (...)

 { }

}

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

void __fastcall TForm4::Button2Click(TObject *Sender)

{

char sql[200];

char n1[10];

Query1->Close();

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

sprintf(sql,"EXEC DELETETOVM @n1=%s",n1);

Query1->SQL->Clear();

Query1->SQL->Add(sql);

try

{

Query1->Open();

}

catch (...)

 { }

}

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

void __fastcall TForm4::Button3Click(TObject *Sender)

{

char sql[200];

char n1[10];

Query1->Close();

StrCopy(n1,Edit3->Text.c_str());

sprintf(sql,"EXEC DELETEMAGAZIN @n1=%s",n1);

Query1->SQL->Clear();

Query1->SQL->Add(sql);

try

{

Query1->Open();

}

catch (...)

 { }

}

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

void __fastcall TForm4::Button5Click(TObject *Sender)

{

char sql[200];

char n1[10];

Query1->Close();

StrCopy(n1,Edit6->Text.c_str());

sprintf(sql,"EXEC DELETEZAKAZ @n1=%s",n1);

Query1->SQL->Clear();

Query1->SQL->Add(sql);

try

{

Query1->Open();

}

catch (...)

 { }

}

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

void __fastcall TForm4::Button4Click(TObject *Sender)

{

char sql[200];

char n1[10];

char n2[10];

Query1->Close();

StrCopy(n1,Edit4->Text.c_str());

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

sprintf(sql,"EXEC DELETESOTRUDNIK @n1='%s',@n2=%s",n1,n2);

Query1->SQL->Clear();

Query1->SQL->Add(sql);

try

{

Query1->Open();

}

catch (...)

 { }

}

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

void __fastcall TForm4::Button6Click(TObject *Sender)

{

Edit1->Text="";

}

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

void __fastcall TForm4::Button7Click(TObject *Sender)

{

char sql[200];

Query1->Close();

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

Query1->SQL->Clear();

Query1->SQL->Add(sql);