Главная

Популярная публикация

Научная публикация

Случайная публикация

Обратная связь

ТОР 5 статей:

Методические подходы к анализу финансового состояния предприятия

Проблема периодизации русской литературы ХХ века. Краткая характеристика второй половины ХХ века

Ценовые и неценовые факторы

Характеристика шлифовальных кругов и ее маркировка

Служебные части речи. Предлог. Союз. Частицы

КАТЕГОРИИ:






Приложение А. Исходный код программы




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

 

#include <vcl.h>

#include <comobj.hpp>

#pragma hdrstop

 

#include "UnitMain.h"

#include "UnitAdmin.h"

#include "UnitReport.h"

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

#pragma package(smart_init)

#pragma resource "*.dfm"

TFormMain *FormMain;

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

__fastcall TFormMain::TFormMain(TComponent* Owner)

: TForm(Owner)

{

}

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

 

void __fastcall TFormMain::N2Click(TObject *Sender)

{

ADOQuery1->Active=false;

DataSource1->DataSet=FormMain->ADOTable1;

ADOTable1->Active=false;

ADOTable1->TableName="Categorii";

ADOTable1->Active=true;

DBGrid1->Columns->Items[0]->Title->Caption="Категория";

}

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

 

void __fastcall TFormMain::N3Click(TObject *Sender)

{

ADOQuery1->Active=false;

DataSource1->DataSet=FormMain->ADOTable1;

ADOTable1->Active=false;

ADOTable1->TableName="Prepodavateli";

ADOTable1->Active=true;

DBGrid1->Columns->Items[0]->Title->Caption="ФИО";

DBGrid1->Columns->Items[1]->Title->Caption="Адрес";

DBGrid1->Columns->Items[2]->Title->Caption="Телефон";

DBGrid1->Columns->Items[3]->Title->Caption="Категория";

}

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

 

void __fastcall TFormMain::N4Click(TObject *Sender)

{

ADOQuery1->Active=false;

DataSource1->DataSet=FormMain->ADOTable1;

ADOTable1->Active=false;

ADOTable1->TableName="Kafedri";

ADOTable1->Active=true;

DBGrid1->Columns->Items[0]->Title->Caption="Название кафедры";

DBGrid1->Columns->Items[1]->Title->Caption="Заведующий кафедры";

}

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

 

void __fastcall TFormMain::N5Click(TObject *Sender)

{

ADOQuery1->Active=false;

DataSource1->DataSet=FormMain->ADOTable1;

ADOTable1->Active=false;

ADOTable1->TableName="Discipliny";

ADOTable1->Active=true;

DBGrid1->Columns->Items[0]->Title->Caption="Дисциплина";

}

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

 

void __fastcall TFormMain::N6Click(TObject *Sender)

{

ADOQuery1->Active=false;

DataSource1->DataSet=FormMain->ADOTable1;

ADOTable1->Active=false;

ADOTable1->TableName="Uchebnie_goda";

ADOTable1->Active=true;

DBGrid1->Columns->Items[0]->Title->Caption="Учебный год";

}

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

 

void __fastcall TFormMain::N7Click(TObject *Sender)

{

ADOQuery1->Active=false;

DataSource1->DataSet=FormMain->ADOTable1;

ADOTable1->Active=false;

ADOTable1->TableName="Vid_kontrolya";

ADOTable1->Active=true;

DBGrid1->Columns->Items[0]->Title->Caption="Вид контроля";

}

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

 

void __fastcall TFormMain::N8Click(TObject *Sender)

{

ADOQuery1->Active=false;

DataSource1->DataSet=FormMain->ADOTable1;

ADOTable1->Active=false;

ADOTable1->TableName="Facultety";

ADOTable1->Active=true;

DBGrid1->Columns->Items[0]->Title->Caption="Факультет";

}

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

 

void __fastcall TFormMain::N9Click(TObject *Sender)

{

ADOQuery1->Active=false;

DataSource1->DataSet=FormMain->ADOTable1;

ADOTable1->Active=false;

ADOTable1->TableName="Spezialnosty";

ADOTable1->Active=true;

DBGrid1->Columns->Items[0]->Title->Caption="Специальность";

DBGrid1->Columns->Items[1]->Title->Caption="Факультет";

}

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

 

void __fastcall TFormMain::N10Click(TObject *Sender)

{

ADOQuery1->Active=false;

DataSource1->DataSet=FormMain->ADOTable1;

ADOTable1->Active=false;

ADOTable1->TableName="Uchebnie_gruppi";

ADOTable1->Active=true;

DBGrid1->Columns->Items[0]->Title->Caption="Номер группы";

DBGrid1->Columns->Items[1]->Title->Caption="Курс";

DBGrid1->Columns->Items[2]->Title->Caption="Специальность";

}

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

 

void __fastcall TFormMain::N11Click(TObject *Sender)

{

ADOQuery1->Active=false;

DataSource1->DataSet=FormMain->ADOTable1;

ADOTable1->Active=false;

ADOTable1->TableName="Spisok_studentov";

ADOTable1->Active=true;

DBGrid1->Columns->Items[0]->Title->Caption="ФИО";

DBGrid1->Columns->Items[1]->Title->Caption="Дата рождения";

DBGrid1->Columns->Items[2]->Title->Caption="Адрес";

DBGrid1->Columns->Items[3]->Title->Caption="Пол";

DBGrid1->Columns->Items[4]->Title->Caption="Телефон";

}

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

 

void __fastcall TFormMain::N12Click(TObject *Sender)

{

ADOQuery1->Active=false;

DataSource1->DataSet=FormMain->ADOTable1;

ADOTable1->Active=false;

ADOTable1->TableName="Sessiya";

ADOTable1->Active=true;

DBGrid1->Columns->Items[0]->Title->Caption="Номер экзамена";

DBGrid1->Columns->Items[1]->Title->Caption="Номер группы";

DBGrid1->Columns->Items[2]->Title->Caption="Преподаватели";

DBGrid1->Columns->Items[3]->Title->Caption="Дисциплина";

DBGrid1->Columns->Items[4]->Title->Caption="Дата сдачи";

}

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

 

void __fastcall TFormMain::N13Click(TObject *Sender)

{

ADOQuery1->Active=false;

DataSource1->DataSet=FormMain->ADOTable1;

ADOTable1->Active=false;

ADOTable1->TableName="Spiski_grupp";

ADOTable1->Active=true;

DBGrid1->Columns->Items[0]->Title->Caption="ID";

DBGrid1->Columns->Items[1]->Title->Caption="Учебный год";

DBGrid1->Columns->Items[2]->Title->Caption="Семестр";

DBGrid1->Columns->Items[3]->Title->Caption="Студент";

DBGrid1->Columns->Items[4]->Title->Caption="Номер группы";

}

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

 

void __fastcall TFormMain::N14Click(TObject *Sender)

{

ADOQuery1->Active=false;

DataSource1->DataSet=FormMain->ADOTable1;

ADOTable1->Active=false;

ADOTable1->TableName="Ozenki";

ADOTable1->Active=true;

DBGrid1->Columns->Items[0]->Title->Caption="ID";

DBGrid1->Columns->Items[1]->Title->Caption="Учебный год";

DBGrid1->Columns->Items[2]->Title->Caption="Семестр";

DBGrid1->Columns->Items[3]->Title->Caption="Студент";

DBGrid1->Columns->Items[4]->Title->Caption="Дисциплина";

DBGrid1->Columns->Items[5]->Title->Caption="Оценка";

}

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

 

void __fastcall TFormMain::N15Click(TObject *Sender)

{

ADOQuery1->Active=false;

DataSource1->DataSet=FormMain->ADOTable1;

ADOTable1->Active=false;

ADOTable1->TableName="Raspisanie";

ADOTable1->Active=true;

DBGrid1->Columns->Items[0]->Title->Caption="ID";

DBGrid1->Columns->Items[1]->Title->Caption="Номер недели";

DBGrid1->Columns->Items[2]->Title->Caption="День недели";

DBGrid1->Columns->Items[3]->Title->Caption="Номер пары";

DBGrid1->Columns->Items[4]->Title->Caption="Номер группы";

DBGrid1->Columns->Items[5]->Title->Caption="Преподаватель";

DBGrid1->Columns->Items[6]->Title->Caption="Дисциплина";

DBGrid1->Columns->Items[7]->Title->Caption="Аудитория";

}

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

 

void __fastcall TFormMain::N16Click(TObject *Sender)

{

ADOQuery1->Active=false;

DataSource1->DataSet=FormMain->ADOTable1;

ADOTable1->Active=false;

ADOTable1->TableName="Uchebniy_plan";

ADOTable1->Active=true;

DBGrid1->Columns->Items[0]->Title->Caption="ID";

DBGrid1->Columns->Items[1]->Title->Caption="Специальность";

DBGrid1->Columns->Items[2]->Title->Caption="Учебный год";

DBGrid1->Columns->Items[3]->Title->Caption="Курс";

DBGrid1->Columns->Items[4]->Title->Caption="Семестр";

DBGrid1->Columns->Items[5]->Title->Caption="Дисциплина";

DBGrid1->Columns->Items[6]->Title->Caption="Количество часов";

DBGrid1->Columns->Items[7]->Title->Caption="Вид контроля";

}

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

 

 

void __fastcall TFormMain::N17Click(TObject *Sender)

{

ADOTable1->Insert();

}

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

 

void __fastcall TFormMain::N18Click(TObject *Sender)

{

ADOTable1->Delete();

}

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

 

void __fastcall TFormMain::N19Click(TObject *Sender)

{

ADOTable1->Post();

}

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

 

void __fastcall TFormMain::DBGrid1TitleClick(TColumn *Column)

{

if (ADOTable1->TableName=="Categorii")

{

if (Column->Index==0)

{

if (ADOTable1->Sort=="Categoriya ASC")

ADOTable1->Sort="Categoriya DESC";

else

ADOTable1->Sort="Categoriya ASC";

}

}

if (ADOTable1->TableName=="Prepodavateli")

{

if (Column->Index==0)

{

if (ADOTable1->Sort=="FIO ASC")

ADOTable1->Sort="FIO DESC";

else

ADOTable1->Sort="FIO ASC";

}

if (Column->Index==1)

{

if (ADOTable1->Sort=="Adres ASC")

ADOTable1->Sort="Adres DESC";

else

ADOTable1->Sort="Adres ASC";

}

if (Column->Index==2)

{

if (ADOTable1->Sort=="Telefon ASC")

ADOTable1->Sort="Telefon DESC";

else

ADOTable1->Sort="Telefon ASC";

}

if (Column->Index==3)

{

if (ADOTable1->Sort=="Categoriya ASC")

ADOTable1->Sort="Categoriya DESC";

else

ADOTable1->Sort="Categoriya ASC";

}

}

if (ADOTable1->TableName=="Kafedri")

{

if (Column->Index==0)

{

if (ADOTable1->Sort=="Nazvanie_Kafedri ASC")

ADOTable1->Sort="Nazvanie_Kafedri DESC";

else

ADOTable1->Sort="Nazvanie_Kafedri ASC";

}

if (Column->Index==1)

{

if (ADOTable1->Sort=="Zaveduyuschiy ASC")

ADOTable1->Sort="Zaveduyuschiy DESC";

else

ADOTable1->Sort="Zaveduyuschiy ASC";

}

}

if (ADOTable1->TableName=="Discipliny")

{

if (Column->Index==0)

{

if (ADOTable1->Sort=="Disciplina ASC")

ADOTable1->Sort="Disciplina DESC";

else

ADOTable1->Sort="Disciplina ASC";

}

}

if (ADOTable1->TableName=="Uchebnie_goda")

{

if (Column->Index==0)

{

if (ADOTable1->Sort=="Uchebniy_god ASC")

ADOTable1->Sort="Uchebniy_god DESC";

else

ADOTable1->Sort="Uchebniy_god ASC";

}

}

if (ADOTable1->TableName=="Vid_kontrolya")

{

if (Column->Index==0)

{

if (ADOTable1->Sort=="Vid_kontrolya ASC")

ADOTable1->Sort="Vid_kontrolya DESC";

else

ADOTable1->Sort="Vid_kontrolya ASC";

}

}

if (ADOTable1->TableName=="Facultety")

{

if (Column->Index==0)

{

if (ADOTable1->Sort=="Facultet ASC")

ADOTable1->Sort="Facultet DESC";

else

ADOTable1->Sort="Facultet ASC";

}

}

if (ADOTable1->TableName=="Spezialnosty")

{

if (Column->Index==0)

{

if (ADOTable1->Sort=="Spezialnost ASC")

ADOTable1->Sort="Spezialnost DESC";

else

ADOTable1->Sort="Spezialnost ASC";

}

if (Column->Index==1)

{

if (ADOTable1->Sort=="Facultet ASC")

ADOTable1->Sort="Facultet DESC";

else

ADOTable1->Sort="Facultet ASC";

}

}

if (ADOTable1->TableName=="Uchebnie_gruppi")

{

if (Column->Index==0)

{

if (ADOTable1->Sort=="num_gruppi ASC")

ADOTable1->Sort="num_gruppi DESC";

else

ADOTable1->Sort="num_gruppi ASC";

}

if (Column->Index==1)

{

if (ADOTable1->Sort=="Curs ASC")

ADOTable1->Sort="Curs DESC";

else

ADOTable1->Sort="Curs ASC";

}

if (Column->Index==2)

{

if (ADOTable1->Sort=="Spezialnost ASC")

ADOTable1->Sort="Spezialnost DESC";

else

ADOTable1->Sort="Spezialnost ASC";

}

}

if (ADOTable1->TableName=="Spisok_studentov")

{

if (Column->Index==0)

{

if (ADOTable1->Sort=="FIO_Studenta ASC")

ADOTable1->Sort="FIO_Studenta DESC";

else

ADOTable1->Sort="FIO_Studenta ASC";

}

if (Column->Index==1)

{

if (ADOTable1->Sort=="Data_Rogdeniya ASC")

ADOTable1->Sort="Data_Rogdeniya DESC";

else

ADOTable1->Sort="Data_Rogdeniya ASC";

}

if (Column->Index==2)

{

if (ADOTable1->Sort=="Adres ASC")

ADOTable1->Sort="Adres DESC";

else

ADOTable1->Sort="Adres ASC";

}

if (Column->Index==3)

{

if (ADOTable1->Sort=="Pol ASC")

ADOTable1->Sort="Pol DESC";

else

ADOTable1->Sort="Pol ASC";

}

if (Column->Index==4)

{

if (ADOTable1->Sort=="Telefon ASC")

ADOTable1->Sort="Telefon DESC";

else

ADOTable1->Sort="Telefon ASC";

}

}

if (ADOTable1->TableName=="Sessiya")

{

if (Column->Index==0)

{

if (ADOTable1->Sort=="num_sessii ASC")

ADOTable1->Sort="num_sessii DESC";

else

ADOTable1->Sort="num_sessii ASC";

}

if (Column->Index==1)

{

if (ADOTable1->Sort=="num_gruppi ASC")

ADOTable1->Sort="num_gruppi DESC";

else

ADOTable1->Sort="num_gruppi ASC";

}

if (Column->Index==2)

{

if (ADOTable1->Sort=="Prepodavatel ASC")

ADOTable1->Sort="Prepodavatel DESC";

else

ADOTable1->Sort="Prepodavatel ASC";

}

if (Column->Index==3)

{

if (ADOTable1->Sort=="Disciplina ASC")

ADOTable1->Sort="Disciplina DESC";

else

ADOTable1->Sort="Disciplina ASC";

}

if (Column->Index==4)

{

if (ADOTable1->Sort=="Data_sdachi ASC")

ADOTable1->Sort="Data_sdachi DESC";

else

ADOTable1->Sort="Data_sdachi ASC";

}

}

if (ADOTable1->TableName=="Spiski_grupp")

{

if (Column->Index==0)

{

if (ADOTable1->Sort=="ID ASC")

ADOTable1->Sort="ID DESC";

else

ADOTable1->Sort="ID ASC";

}

if (Column->Index==1)

{

if (ADOTable1->Sort=="Uchebniy_god ASC")

ADOTable1->Sort="Uchebniy_god DESC";

else

ADOTable1->Sort="Uchebniy_god ASC";

}

if (Column->Index==2)

{

if (ADOTable1->Sort=="Semestr ASC")

ADOTable1->Sort="Semestr DESC";

else

ADOTable1->Sort="Semestr ASC";

}

if (Column->Index==3)

{

if (ADOTable1->Sort=="Student ASC")

ADOTable1->Sort="Student DESC";

else

ADOTable1->Sort="Student ASC";

}

if (Column->Index==4)

{

if (ADOTable1->Sort=="num_gruppi ASC")

ADOTable1->Sort="num_gruppi DESC";

else

ADOTable1->Sort="num_gruppi ASC";

}

}

if (ADOTable1->TableName=="Ozenki")

{

if (Column->Index==0)

{

if (ADOTable1->Sort=="ID ASC")

ADOTable1->Sort="ID DESC";

else

ADOTable1->Sort="ID ASC";

}

if (Column->Index==1)

{

if (ADOTable1->Sort=="Uchebniy_god ASC")

ADOTable1->Sort="Uchebniy_god DESC";

else

ADOTable1->Sort="Uchebniy_god ASC";

}

if (Column->Index==2)

{

if (ADOTable1->Sort=="Semestr ASC")

ADOTable1->Sort="Semestr DESC";

else

ADOTable1->Sort="Semestr ASC";

}

if (Column->Index==3)

{

if (ADOTable1->Sort=="Student ASC")

ADOTable1->Sort="Student DESC";

else

ADOTable1->Sort="Student ASC";

}

if (Column->Index==4)

{

if (ADOTable1->Sort=="Disciplina ASC")

ADOTable1->Sort="Disciplina DESC";

else

ADOTable1->Sort="Disciplina ASC";

}

if (Column->Index==5)

{

if (ADOTable1->Sort=="Ozenka ASC")

ADOTable1->Sort="Ozenka DESC";

else

ADOTable1->Sort="Ozenka ASC";

}

}

if (ADOTable1->TableName=="Raspisanie")

{

if (Column->Index==0)

{

if (ADOTable1->Sort=="ID ASC")

ADOTable1->Sort="ID DESC";

else

ADOTable1->Sort="ID ASC";

}

if (Column->Index==1)

{

if (ADOTable1->Sort=="num_nedeli ASC")

ADOTable1->Sort="num_nedeli DESC";

else

ADOTable1->Sort="num_nedeli ASC";

}

if (Column->Index==2)

{

if (ADOTable1->Sort=="Den_nedeli ASC")

ADOTable1->Sort="Den_nedeli DESC";

else

ADOTable1->Sort="Den_nedeli ASC";

}

if (Column->Index==3)

{

if (ADOTable1->Sort=="num_pari ASC")

ADOTable1->Sort="num_pari DESC";

else

ADOTable1->Sort="num_pari ASC";

}

if (Column->Index==4)

{

if (ADOTable1->Sort=="num_gruppi ASC")

ADOTable1->Sort="num_gruppi DESC";

else

ADOTable1->Sort="num_gruppi ASC";

}

if (Column->Index==5)

{

if (ADOTable1->Sort=="Prepodavatel ASC")

ADOTable1->Sort="Prepodavatel DESC";

else

ADOTable1->Sort="Prepodavatel ASC";

}

if (Column->Index==6)

{

if (ADOTable1->Sort=="Disciplina ASC")

ADOTable1->Sort="Disciplina DESC";

else

ADOTable1->Sort="Disciplina ASC";

}

if (Column->Index==7)

{

if (ADOTable1->Sort=="Auditoriya ASC")

ADOTable1->Sort="Auditoriya DESC";

else

ADOTable1->Sort="Auditoriya ASC";

}

}

if (ADOTable1->TableName=="Uchebniy_plan")

{

if (Column->Index==0)

{

if (ADOTable1->Sort=="ID ASC")

ADOTable1->Sort="ID DESC";

else

ADOTable1->Sort="ID ASC";

}

if (Column->Index==1)

{

if (ADOTable1->Sort=="Spezialnost ASC")

ADOTable1->Sort="Spezialnost DESC";

else

ADOTable1->Sort="Spezialnost ASC";

}

if (Column->Index==2)

{

if (ADOTable1->Sort=="Uchebniy_god ASC")

ADOTable1->Sort="Uchebniy_god DESC";

else

ADOTable1->Sort="Uchebniy_god ASC";

}

if (Column->Index==3)

{

if (ADOTable1->Sort=="Curs ASC")

ADOTable1->Sort="Curs DESC";

else

ADOTable1->Sort="Curs ASC";

}

if (Column->Index==4)

{

if (ADOTable1->Sort=="Semestr ASC")

ADOTable1->Sort="Semestr DESC";

else

ADOTable1->Sort="Semestr ASC";

}

if (Column->Index==5)

{

if (ADOTable1->Sort=="Disciplina ASC")

ADOTable1->Sort="Disciplina DESC";

else

ADOTable1->Sort="Disciplina ASC";

}

if (Column->Index==6)

{

if (ADOTable1->Sort=="Kolichestvo_chasov ASC")

ADOTable1->Sort="Kolichestvo_chasov DESC";

else

ADOTable1->Sort="Kolichestvo_chasov ASC";

}

if (Column->Index==7)

{

if (ADOTable1->Sort=="Vid_kontrolya ASC")

ADOTable1->Sort="Vid_kontrolya DESC";

else

ADOTable1->Sort="Vid_kontrolya ASC";

}

}

}

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

 

 

void __fastcall TFormMain::N20Click(TObject *Sender)

{

FormAdmin->ShowModal();

}

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

 

 

void __fastcall TFormMain::N22Click(TObject *Sender)

{

FormReport->Label1->Caption="Введите номер группы:";

FormReport->Label2->Caption="1";

FormReport->Edit1->Text="";

FormReport->ShowModal();

}

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

 

void __fastcall TFormMain::N23Click(TObject *Sender)

{

FormReport->Label1->Caption="Введите наивысшую оценку:";

FormReport->Label2->Caption="2";

FormReport->Edit1->Text="";

FormReport->ShowModal();

}

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

 

 

void __fastcall TFormMain::N24Click(TObject *Sender)

{

FormReport->Label1->Caption="Введите наименьшую оценку:";

FormReport->Label2->Caption="3";

FormReport->Edit1->Text="";

FormReport->ShowModal();

}

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

 

void __fastcall TFormMain::N25Click(TObject *Sender)

{

FormReport->Label1->Caption="Введите ФИО преподавателя:";

FormReport->Label2->Caption="4";

FormReport->Edit1->Text="";

FormReport->ShowModal();

}

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

 

void __fastcall TFormMain::N26Click(TObject *Sender)

{

FormReport->Label1->Caption="Введите номер группы:";

FormReport->Label2->Caption="5";

FormReport->Edit1->Text="";

FormReport->ShowModal();

}

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

 

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

 

#include <vcl.h>

#pragma hdrstop

 

#include "UnitAdmin.h"

#include "UnitMain.h"

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

#pragma package(smart_init)

#pragma resource "*.dfm"

TFormAdmin *FormAdmin;

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

__fastcall TFormAdmin::TFormAdmin(TComponent* Owner)

: TForm(Owner)

{

}

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

void __fastcall TFormAdmin::Button1Click(TObject *Sender)

{

if (Edit1->Text=="123")

{

Edit1->Text="";

FormMain->N2->Visible=true;

FormMain->N5->Visible=true;

FormMain->N6->Visible=true;

FormMain->N7->Visible=true;

FormMain->N8->Visible=true;

FormMain->N17->Visible=true;

FormMain->N18->Visible=true;

FormMain->N19->Visible=true;

FormMain->DBGrid1->ReadOnly=false;

FormAdmin->Close();

}

else

{

Edit1->Text="";

FormMain->N2->Visible=false;

FormMain->N5->Visible=false;

FormMain->N6->Visible=false;

FormMain->N7->Visible=false;

FormMain->N8->Visible=false;

FormMain->N17->Visible=false;

FormMain->N18->Visible=false;

FormMain->N19->Visible=false;

FormMain->DBGrid1->ReadOnly=true;

FormAdmin->Close();

}

}

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

void __fastcall TFormAdmin::Button2Click(TObject *Sender)

{

FormAdmin->Close();

}

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

 

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

 

#include <vcl.h>

#pragma hdrstop

 

#include "UnitReport.h"

#include "UnitMain.h"

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

#pragma package(smart_init)

#pragma resource "*.dfm"

TFormReport *FormReport;

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

__fastcall TFormReport::TFormReport(TComponent* Owner)

: TForm(Owner)

{

}

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

void __fastcall TFormReport::Button2Click(TObject *Sender)

{

FormReport->Close();

}

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

 

void __fastcall TFormReport::Button1Click(TObject *Sender)

{

if (Edit1->Text!="")

{

if (Label2->Caption=="1")

{

FormMain->ADOTable1->Active=false;

FormMain->DataSource1->DataSet=FormMain->ADOQuery1;

FormMain->ADOQuery1->Active=false;

FormMain->ADOQuery1->SQL->Clear();

FormMain->ADOQuery1->SQL->Text="select num_nedeli,Den_nedeli,num_pari,Disciplina,Auditoriya,Prepodavatel from Raspisanie where num_gruppi="+Edit1->Text+";";

FormMain->ADOQuery1->ExecSQL();

FormMain->ADOQuery1->Active=true;

FormMain->DBGrid1->Columns->Items[0]->Title->Caption="Номер недели";

FormMain->DBGrid1->Columns->Items[1]->Title->Caption="День недели";

FormMain->DBGrid1->Columns->Items[2]->Title->Caption="Номер пары";

FormMain->DBGrid1->Columns->Items[3]->Title->Caption="Дисциплина";

FormMain->DBGrid1->Columns->Items[4]->Title->Caption="Аудитория";

FormMain->DBGrid1->Columns->Items[5]->Title->Caption="Преподаватель";

}

if (Label2->Caption=="2")

{

int y=CurrentYear();

FormMain->ADOTable1->Active=false;

FormMain->DataSource1->DataSet=FormMain->ADOQuery1;

FormMain->ADOQuery1->Active=false;

FormMain->ADOQuery1->SQL->Clear();

FormMain->ADOQuery1->SQL->Text="select Student,Disciplina,Ozenka from Ozenki where Uchebniy_god="+IntToStr(CurrentYear())+" and Ozenka<="+Edit1->Text+";";

FormMain->ADOQuery1->ExecSQL();

FormMain->ADOQuery1->Active=true;

FormMain->DBGrid1->Columns->Items[0]->Title->Caption="Студент";

FormMain->DBGrid1->Columns->Items[1]->Title->Caption="Дисциплина";

FormMain->DBGrid1->Columns->Items[2]->Title->Caption="Оценка";

}

if (Label2->Caption=="3")

{

int y=CurrentYear();

FormMain->ADOTable1->Active=false;

FormMain->DataSource1->DataSet=FormMain->ADOQuery1;

FormMain->ADOQuery1->Active=false;

FormMain->ADOQuery1->SQL->Clear();

FormMain->ADOQuery1->SQL->Text="select Student,Disciplina,Ozenka from Ozenki where Uchebniy_god="+IntToStr(CurrentYear())+" and Ozenka>="+Edit1->Text+";";

FormMain->ADOQuery1->ExecSQL();

FormMain->ADOQuery1->Active=true;

FormMain->DBGrid1->Columns->Items[0]->Title->Caption="Студент";

FormMain->DBGrid1->Columns->Items[1]->Title->Caption="Дисциплина";

FormMain->DBGrid1->Columns->Items[2]->Title->Caption="Оценка";

}

if (Label2->Caption=="4")

{

FormMain->ADOTable1->Active=false;

FormMain->DataSource1->DataSet=FormMain->ADOQuery1;

FormMain->ADOQuery1->Active=false;

FormMain->ADOQuery1->SQL->Clear();

FormMain->ADOQuery1->SQL->Text="select num_nedeli,Den_nedeli,num_pari,Disciplina,Auditoriya,Prepodavatel from Raspisanie where Raspisanie.Prepodavatel="+Edit1->Text+";";

FormMain->ADOQuery1->ExecSQL();

FormMain->ADOQuery1->Active=true;

FormMain->DBGrid1->Columns->Items[0]->Title->Caption="Номер недели";

FormMain->DBGrid1->Columns->Items[1]->Title->Caption="День недели";

FormMain->DBGrid1->Columns->Items[2]->Title->Caption="Номер пары";

FormMain->DBGrid1->Columns->Items[3]->Title->Caption="Дисциплина";

FormMain->DBGrid1->Columns->Items[4]->Title->Caption="Аудитория";

FormMain->DBGrid1->Columns->Items[5]->Title->Caption="Преподаватель";

}

if (Label2->Caption=="4")

{

FormMain->ADOTable1->Active=false;

FormMain->DataSource1->DataSet=FormMain->ADOQuery1;

FormMain->ADOQuery1->Active=false;

FormMain->ADOQuery1->SQL->Clear();

FormMain->ADOQuery1->SQL->Text="select num_gruppi,Student,Uchebniy_god,Semestr from Spiski_grupp where num_gruppi="+Edit1->Text+";";

FormMain->ADOQuery1->ExecSQL();

FormMain->ADOQuery1->Active=true;

FormMain->DBGrid1->Columns->Items[0]->Title->Caption="Номер группы";

FormMain->DBGrid1->Columns->Items[1]->Title->Caption="Студент";

FormMain->DBGrid1->Columns->Items[2]->Title->Caption="Учебный год";

FormMain->DBGrid1->Columns->Items[3]->Title->Caption="Семестр";

}

}

else

ShowMessage("Заполните поле ввода, либо нажмите <Отмена>");

FormReport->Close();

}

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

Приложение Б. Диаграмма вариантов использования (Use Case)






Не нашли, что искали? Воспользуйтесь поиском:

vikidalka.ru - 2015-2024 год. Все права принадлежат их авторам! Нарушение авторских прав | Нарушение персональных данных