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

int n;

n=ADOQuery2->RecordCount;

ADOQuery3->SQL->Text="exec idlog  '" + DBEdit8->Text +"'";

try{

ADOQuery3->Open();

}

catch(...){

}

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

try{

ADOQuery3->Open();

AnsiString s;

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

if(s>0){

//Result=MessageBox(Handle,"","",16420);

Button2->Enabled=false;

DBEdit9->Text=n;

}

if(s==0){

DBEdit9->Text=(n+1);

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

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

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

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

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

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

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

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

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

Button2->Enabled=true;

}}}}}}}}}

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

Button2->Enabled=false;

}

}

}

catch(Exception &E){

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

}

}

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

void __fastcall TForm6::DBEdit1Change(TObject *Sender)

{

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

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

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

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

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

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

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

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

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

Button2->Enabled=true;

}}}}}}}}}

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

Button2->Enabled=false;

}

}

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

void __fastcall TForm6::DBEdit2Change(TObject *Sender)

{

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

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

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

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

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

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

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

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

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

Button2->Enabled=true;

}}}}}}}}}

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

Button2->Enabled=false;

}

}

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

void __fastcall TForm6::DBEdit5Change(TObject *Sender)

{

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

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

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

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

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

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

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

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

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

Button2->Enabled=true;

}}}}}}}}}

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

Button2->Enabled=false;

}

}

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

void __fastcall TForm6::DBEdit6Change(TObject *Sender)

{

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

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

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

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

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

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

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

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

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

Button2->Enabled=true;

}}}}}}}}}

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

Button2->Enabled=false;

}

}

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

void __fastcall TForm6::DBEdit7Change(TObject *Sender)

{

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

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

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

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

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

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

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

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

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

Button2->Enabled=true;

}}}}}}}}}

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

Button2->Enabled=false;

}

}

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

void __fastcall TForm6::DBEdit10Change(TObject *Sender)

{

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

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

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

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

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

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

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

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

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

Button2->Enabled=true;

}}}}}}}}}

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

Button2->Enabled=false;

}

}

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

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

#include <vcl.h>

#pragma hdrstop

#include "Unit7.h"

#include "Unit2.h"

#include "Unit1.h"

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

#pragma package(smart_init)

#pragma resource "*.dfm"

TForm7 *Form7;

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

__fastcall TForm7::TForm7(TComponent* Owner)

        : TForm(Owner)

{

}

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

void __fastcall TForm7::RadioButton1Click(TObject *Sender)

{

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

try{

ADOQuery1->Open();

}

catch(...){

}

}

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

void __fastcall TForm7::Button2Click(TObject *Sender)

{

Form7->Close();

Form1->Show();

}

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

void __fastcall TForm7::ComboBox1Change(TObject *Sender)

{

Edit1->Text=ComboBox1->Text;

}