Система рейтингового контроля знаний

Информация - Компьютеры, программирование

Другие материалы по предмету Компьютеры, программирование

Скачать Бесплатно!
Для того чтобы скачать эту работу.
1. Пожалуйста введите слова с картинки:

2. И нажмите на эту кнопку.
закрыть



6), &Form6);

Application->Run();

}

catch (Exception &exception)

{

Application->ShowException(&exception);

}

return 0;

}

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

Kur1.cpp:

#include

#include

#pragma hdrstop

#include "kur1.h"

#include "RichAbt.h"

#include "Datam.h"

#include "Report.h"

#include "Unit1.h"

#include "Findcust.h"

#include "Sort.h"

#include "filter.h"

#include "filename.h"

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

#pragma link "Grids"

#pragma resource "*.dfm"

TForm1 *Form1;

AnsiString ff;

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

__fastcall TForm1::TForm1(TComponent* Owner)

: TForm(Owner)

{

ff=Form1->Caption;

}

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

void __fastcall TForm1::N10Click(TObject *Sender)

{

Form1->Caption=ff;

Form6->ShowModal();

N2->Enabled=true;

N20->Enabled=true;

N5->Enabled=true;

N14->Enabled=true;

N16->Enabled=true;

Form1->Caption =Form1->Caption+"->"+DM1->Table1->TableName;

 

}

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

void __fastcall TForm1::N17Click(TObject *Sender)

{

Close();

}

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

void __fastcall TForm1::N14Click(TObject *Sender)

{

QRListForm->QuickReport->Print();

}

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

 

void __fastcall TForm1::N5Click(TObject *Sender)

{

DBGrid1->Visible=false;

DBNavigator1->Enabled=false;

BitBtn1->Enabled=false;

BitBtn2->Enabled=false;

BitBtn3->Enabled=false;

}

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

void __fastcall TForm1::N2Click(TObject *Sender)

{

DBGrid1->Visible=true;

DBNavigator1->Enabled=true;

BitBtn1->Enabled=true;

DBGrid1->ReadOnly=true;

BitBtn2->Enabled=true;

BitBtn3->Enabled=true;

}

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

void __fastcall TForm1::N16Click(TObject *Sender)

{

QRListForm->QuickReport->Preview();

}

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

void __fastcall TForm1::N20Click(TObject *Sender)

{

Form3->ShowModal();

DM1->Table1->Refresh();

}

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

void __fastcall TForm1::BitBtn1Click(TObject *Sender)

{

DBGrid1->DataSource=DM1->DataSource2;

fmFindCust->ShowModal();

if (fmFindCust->ModalResult == mrOk)

DM1->Table1->GotoCurrent(DM1->Table1);

 

}

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

void __fastcall TForm1::BitBtn2Click(TObject *Sender)

{

DBGrid1->DataSource=DM1->DataSource1;

Form4->ShowModal();

if (Form4->ModalResult == mrOk)

DM1->Table1->GotoCurrent(DM1->Table1);

}

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

 

void __fastcall TForm1::BitBtn3Click(TObject *Sender)

{

DBGrid1->DataSource=DM1->DataSource1;

Form5->ShowModal();

if (Form4->ModalResult == mrOk)

DM1->Table1->GotoCurrent(DM1->Table1);

}

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

void __fastcall TForm1::N7Click(TObject *Sender)

{

if ( OpenDialog1->Execute() )

{

Form1->Caption=ff;

N2->Enabled=true;

N20->Enabled=true;

N5->Enabled=true;

N14->Enabled=true;

N16->Enabled=true;

if (DM1->Table1->Active == true )

DM1->Table1->Active = false;

DM1->Table1->DatabaseName = ExtractFilePath( OpenDialog1->FileName );

DM1->Table1->TableName = ExtractFileName( OpenDialog1->FileName );

DM1->Table1->Active = true;

Form1->Caption =Form1->Caption+"->"+DM1->Table1->TableName;

}

}

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

void __fastcall TForm1::N4Click(TObject *Sender)

{

Form2= new TForm2(Application);

Form2->ShowModal();

delete Form2;

}

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

Datam.cpp:

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

#include

#pragma hdrstop

 

#include "Datam.h"

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

#pragma resource "*.dfm"

TDM1 *DM1;

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

__fastcall TDM1::TDM1(TComponent* Owner)

: TDataModule(Owner)

{

}

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

filename.cpp:

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

#include

#pragma hdrstop

 

#include "filename.h"

#include "Datam.h"

#include "kur1.h"

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

#pragma resource "*.dfm"

TForm6 *Form6;

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

__fastcall TForm6::TForm6(TComponent* Owner)

: TForm(Owner)

{

}

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

void __fastcall TForm6::Button1Click(TObject *Sender)

{

DM1->Table1->Active=false;

DM1->Query1->Active=false;

if (Edit1->Text == "")

Text="ITF.db";">Edit1->Text="ITF.db";

TFileStream *Old = new TFileStream("baza1.db", fmOpenRead);

TFileStream *New = new TFileStream(Edit1->Text,fmCreate);

New->CopyFrom(Old, Old->Size);

delete Old; delete New;

DM1->Table1->TableName=Edit1->Text;

DM1->Query1->Active=true;

DM1->Table1->Active=true;

}

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

filter.cpp:

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

#include

#pragma hdrstop

 

#include "filter.h"

#include "Datam.h"

#include "kur1.h"

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

#pragma resource "*.dfm"

TForm5 *Form5;

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

__fastcall TForm5::TForm5(TComponent* Owner)

: TForm(Owner)

{

}

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

void __fastcall TForm5::Button3Click(TObject *Sender)

{

AnsiString filter;

filter=Edit1->Text;

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

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

if (ComboBox1->Text == "L.L.+."){

DM1->Query1->SQL->Clear();

DM1->Query1->SQL->Append("Select * From baza Where A=\""+filter+"\"");

DM1->Query1->Open();

DM1->Table1->Open();}

else if (ComboBox1->Text == "Lръєы№ЄхЄ"){

DM1->Query1->SQL->Clear();

DM1->Query1->SQL->Append("Select * From baza Where W=\""+filter+"\"");

DM1->Query1->Open();

DM1->Table1->Open();}

else if (ComboBox1->Text == "TяхЎшры№эюёЄ№"){

DM1->Query1->SQL->Clear();

DM1->Query1->SQL->Append("Select * From baza Where Q=\""+filter+"\"");

DM1->Query1->Open();

DM1->Table1->Open();}

else if (ComboBox1->Text == "+Ёєяяр"){

DM1->Query1->SQL->Clear();

DM1->Query1->SQL->Append("Select * From baza Where S=\""+filter+"\"");

DM1->Query1->Open();

DM1->Tab

s