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

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

void __fastcall TForm1::N1Click(TObject *Sender)

{

Form3->GroupBox1->Visible=true;

Form3->GroupBox1->Enabled=true;

Form3->GroupBox2->Visible=false;

Form3->GroupBox2->Enabled=false;

Form3->Edit1->Text="";

Form3->Show();

}

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

void __fastcall TForm1::N5Click(TObject *Sender)

{

Form3->GroupBox1->Visible=false;

Form3->GroupBox1->Enabled=false;

Form3->GroupBox2->Visible=true;

Form3->GroupBox2->Enabled=true;

Form3->Edit2->Text="";

Form3->Show();

}

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

void __fastcall TForm1::N8Click(TObject *Sender)

{

Form5->Show();

}

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

void __fastcall TForm1::StaticText1Click(TObject *Sender)

{

Form6->Show();

Form6->Panel2->Visible=true;

Form6->Panel2->Align=alClient;

Form6->Button1->Visible=true;

}

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

void __fastcall TForm1::N11Click(TObject *Sender)

{

MessageBox(Handle,"","",16420);       

}

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

 


void __fastcall TForm1::Gruppi1Click(TObject *Sender)

{

mn=1;

Form8->Show();

Form8->CGauge1->Enabled=true;

Form8->CGauge1->Progress=0;

Form8->Edit1->Text="";

Form8->Edit2->Text="";

}

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

void __fastcall TForm1::Sostav1Click(TObject *Sender)

{

mn=2;

Form8->Show();

Form8->CGauge1->Enabled=true;

Form8->CGauge1->Progress=0;

Form8->Edit1->Text="";

Form8->Edit2->Text="";

}

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

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

#include <vcl.h>

#pragma hdrstop

#include "Unit2.h"

#include "Unit1.h"

#include "Unit4.h"

#include "Unit7.h"

#include "Unit9.h"

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

#pragma package(smart_init)

#pragma resource "*.dfm"

TForm2 *Form2;

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

__fastcall TForm2::TForm2(TComponent* Owner)

        : TForm(Owner)

{

}

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

void __fastcall TForm2::FormCreate(TObject *Sender)

{

try{

ADOQuery1->Open();

ADOQuery8->Open();

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

ADOQuery4->SQL->Text="select * from k_disk";

ADOQuery3->Open();

ADOQuery4->Open();

ComboBox1->Items->Clear();

ComboBox2->Items->Clear();

int n;

int n1;

n=ADOQuery3->RecordCount;

ADOQuery3->First();

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

{

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

ADOQuery3->Next();

}

n1=ADOQuery4->RecordCount;

ADOQuery4->First();

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

{

ComboBox2->Items->Add(ADOQuery4->FieldByName("disk")->AsString);

ADOQuery4->Next();

}

}

catch(Exception &E)

{

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

}

DBNavigator4->BtnClick(nbInsert);

DBNavigator1->BtnClick(nbInsert);

}

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

void __fastcall TForm2::DBEdit1Change(TObject *Sender)

{

int n;

n=ADOQuery1->RecordCount;

ADOQuery2->SQL->Text="exec dobidpesn  '" + DBEdit1->Text +"'";

try{

ADOQuery2->Open();

}

catch(...){

}

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

try{

ADOQuery3->Open();

AnsiString s;

s=ADOQuery3->FieldByName("identa")->AsString;

if(s>0){

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

}

if(s==0){

DBEdit4->Text=(n+1);

}

}

catch(Exception &E){

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

}

if(DBEdit1->Text!=""){

if(ComboBox1->Text!=""){

if(ComboBox2->Text!=""){

Button6->Enabled=true;

}

}

}

if(DBEdit1->Text==""){

Button6->Enabled=false;

}

}

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

void __fastcall TForm2::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();

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

}

catch(Exception &E){

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

}

if(DBEdit1->Text!=""){

if(ComboBox1->Text!=""){

if(ComboBox2->Text!=""){

Button6->Enabled=true;

}

}

}

if(ComboBox1->Text==""){

Button6->Enabled=false;

}

}

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

void __fastcall TForm2::ComboBox2Change(TObject *Sender)

{

ADOQuery2->SQL->Text="exec dobidds '" + ComboBox2->Text +"'";;

try{