Разработка базы дискографии музыкальных коллективов, страница 6

}

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

void __fastcall TForm2::Button3Click(TObject *Sender)

{

DBNavigator4->BtnClick(nbPost);

DBNavigator4->BtnClick(nbInsert);

DBNavigator1->BtnClick(nbInsert);

//DBNavigator1->BtnClick(nbRefresh);

ComboBox1->Text="";

ComboBox2->Text="";

}

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

void __fastcall TForm2::Button6Click(TObject *Sender)

{

DBNavigator1->BtnClick(nbPost);

for(int i=0;i<100;i++)

{

ProgressBar1->StepBy(1);

}

if(ProgressBar1->Position==100)

{

ProgressBar1->Position=0;

}

Button3->Click();

}

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

void __fastcall TForm2::Button7Click(TObject *Sender)

{

Form4->Show();

}

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

void __fastcall TForm2::Label4Click(TObject *Sender)

{

try{

ADOQuery5->Open();

ADOQuery3->SQL->Text="select * from k_zhanr";

ADOQuery3->Open();

ComboBox3->Items->Clear();

int n;

n=ADOQuery3->RecordCount;

ADOQuery3->First();

for (int i=0;i<n;i++)

{

ComboBox3->Items->Add(ADOQuery3->FieldByName("zhanr")->AsString);

ADOQuery3->Next();

}

}

catch(Exception &E)

{

ShowMessage(AnsiString(E.ClassName()) + " " + E.Message + " " );

}

DBNavigator2->BtnClick(nbInsert);

Form2->Height=383;

Form2->Width=489;

Panel3->Visible=true;

Panel3->Enabled=true;

Panel6->Visible=false;

Panel6->Enabled=false;

}

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

void __fastcall TForm2::Label5Click(TObject *Sender)

{

try{

ADOQuery7->Open();

}

catch(Exception &E){

//ShowMessage(AnsiString(E.ClassName()) + " " + E.Message + " " );

}

DBNavigator3->BtnClick(nbInsert);

Form2->Height=383;

Form2->Width=489;

Panel6->Visible=true;

Panel6->Enabled=true;

Panel3->Visible=false;

Panel3->Enabled=false;

}

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

void __fastcall TForm2::Button1Click(TObject *Sender)

{

Form9->Show();

}

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

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

#include <vcl.h>

#pragma hdrstop

#include "Unit3.h"

#include "Unit1.h"

#include "Unit2.h"

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

#pragma package(smart_init)

#pragma resource "*.dfm"

TForm3 *Form3;

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

__fastcall TForm3::TForm3(TComponent* Owner)

        : TForm(Owner)

{

}

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

void __fastcall TForm3::Edit1Change(TObject *Sender)

{

ADOQuery1->SQL->Text="exec poiskpesnya '" + Edit1->Text + "'";

try{

ADOQuery1->Open();

}

catch(...){

}

}

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

void __fastcall TForm3::Edit2Change(TObject *Sender)

{

ADOQuery2->SQL->Text="exec poiskgruppa '" + Edit2->Text + "'";

try{

ADOQuery2->Open();

}

catch(...){

}

}

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

void __fastcall TForm3::Button1Click(TObject *Sender)

{

Form3->Close();

Form1->Show();

}

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

void __fastcall TForm3::Button2Click(TObject *Sender)

{

Form3->Close();

Form1->Show();       

}

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

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

#include <vcl.h>

#include <ccalendr.h>

#pragma hdrstop

#include "Unit4.h"

#include "Unit2.h"

#include "Unit1.h"

#include "Unit3.h"

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

#pragma package(smart_init)

#pragma link "CCALENDR"

#pragma resource "*.dfm"

TForm4 *Form4;

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

__fastcall TForm4::TForm4(TComponent* Owner)

        : TForm(Owner)

{

}

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

void __fastcall TForm4::FormCreate(TObject *Sender)

{

try{

ADOQuery1->Open();

ADOQuery2->SQL->Text="select * from k_gruppi";

ADOQuery2->Open();

ComboBox1->Items->Clear();

int n;

n=ADOQuery2->RecordCount;

ADOQuery2->First();

for (int i=0;i<n;i++)

{

ComboBox1->Items->Add(ADOQuery2->FieldByName("gruppa")->AsString);

ADOQuery2->Next();

}

}

catch(Exception &E)

{

ShowMessage(AnsiString(E.ClassName()) + " " + E.Message + " " );

}

DBNavigator1->BtnClick(nbInsert);

}

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

void __fastcall TForm4::ComboBox1Change(TObject *Sender)

{

ADOQuery2->SQL->Text="exec dobidgr '" + ComboBox1->Text +"'";;

try{

ADOQuery2->Open();

}

catch(Exception &E){

//ShowMessage(AnsiString(E.ClassName()) + " " + E.Message + " " );

}

ADOQuery3->SQL->Text="select * from gr";

try{

ADOQuery3->Open();

DBEdit4->Text=ADOQuery3->FieldByName("identa")->AsString;

}

catch(Exception &E){