Файл: Международные и отечественные стандарты языков программирования. Сходство и отличия стандартов.pdf
Добавлен: 28.06.2023
Просмотров: 159
Скачиваний: 3
{
mainflag=false;
/* просмотр таблицы документы */
mainclientsform->DataSource1->DataSet=mainclientsform->ADOTable1;
mainclientsform->ADOTable1->Active=true;
BuildGridDatabaseDirectoryItem("Заявки", mainclientsform->DataSource1,mainclientsform,"DBDirectoryTemplateForm" );
DirectoryForm->TableDBGrid->Fields[0]->DisplayLabel="№";
DirectoryForm->TableDBGrid->Fields[1]->DisplayLabel="код заказчика";
DirectoryForm->TableDBGrid->Fields[2]->DisplayLabel="код исполнения";
DirectoryForm->TableDBGrid->Fields[3]->DisplayLabel="код сотрудника";
DirectoryForm->TableDBGrid->Fields[4]->DisplayLabel="Примечание";
DirectoryForm->TableDBGrid->Fields[5]->DisplayLabel="код неисправности";
DirectoryForm->TableDBGrid->Fields[6]->DisplayLabel="код заказа";
}
//---------------------------------------------------------------------------
void __fastcall Tmainclientsform::N4Click(TObject *Sender)
{
/* просмотр таблицы Вид документа */
mainflag=false;
mainclientsform->DataSource1->DataSet=mainclientsform->ADOTable2;
mainclientsform->ADOTable2->Active=true;
BuildGridDatabaseDirectoryItem("Отдел", mainclientsform->DataSource1,mainclientsform,"DBDirectoryTemplateForm" );
DirectoryForm->TableDBGrid->Fields[0]->DisplayLabel="№";
DirectoryForm->TableDBGrid->Fields[1]->DisplayLabel="Наименование";
DirectoryForm->TableDBGrid->Fields[2]->DisplayLabel="Телефон";
DirectoryForm->TableDBGrid->Fields[3]->DisplayLabel="Руководитель";
DirectoryForm->TableDBGrid->Fields[4]->DisplayLabel="Режим работы";
}
//---------------------------------------------------------------------------
void __fastcall Tmainclientsform::N5Click(TObject *Sender)
{
/* закрытие главной формы */
mainclientsform->Close();
}
//---------------------------------------------------------------------------
void __fastcall Tmainclientsform::N6Click(TObject *Sender)
{
/* просмотр таблицы источники документы */
mainflag=false;
mainclientsform->DataSource1->DataSet=mainclientsform->ADOTable3;
mainclientsform->ADOTable3->Active=true;
BuildGridDatabaseDirectoryItem("Исполнение", mainclientsform->DataSource1,mainclientsform,"DBDirectoryTemplateForm" );
DirectoryForm->TableDBGrid->Fields[0]->DisplayLabel="№";
DirectoryForm->TableDBGrid->Fields[1]->DisplayLabel="Дата исполнения";
DirectoryForm->TableDBGrid->Fields[2]->DisplayLabel="Отчеты";
DirectoryForm->TableDBGrid->Fields[3]->DisplayLabel="Работы";
}
//---------------------------------------------------------------------------
void __fastcall Tmainclientsform::N7Click(TObject *Sender)
{
/* просмотр таблицы корреспондент */
mainflag=false;
mainclientsform->DataSource1->DataSet=mainclientsform->ADOTable4;
mainclientsform->ADOTable4->Active=true;
BuildGridDatabaseDirectoryItem("Размещение", mainclientsform->DataSource1,mainclientsform,"DBDirectoryTemplateForm" );
DirectoryForm->TableDBGrid->Fields[0]->DisplayLabel="№";
DirectoryForm->TableDBGrid->Fields[1]->DisplayLabel="Корпус";
DirectoryForm->TableDBGrid->Fields[2]->DisplayLabel="Этаж";
DirectoryForm->TableDBGrid->Fields[3]->DisplayLabel="Комната";
DirectoryForm->TableDBGrid->Fields[4]->DisplayLabel="Ip";
DirectoryForm->TableDBGrid->Fields[5]->DisplayLabel="Шлюз";
DirectoryForm->TableDBGrid->Fields[6]->DisplayLabel="Hub";
}
//---------------------------------------------------------------------------
void __fastcall Tmainclientsform::N8Click(TObject *Sender)
{
/* просмотр таблицы статус */
mainflag=false;
mainclientsform->DataSource1->DataSet=mainclientsform->ADOTable5;
mainclientsform->ADOTable5->Active=true;
BuildGridDatabaseDirectoryItem("Неисправности", mainclientsform->DataSource1,mainclientsform,"DBDirectoryTemplateForm" );
DirectoryForm->TableDBGrid->Fields[0]->DisplayLabel="№";
DirectoryForm->TableDBGrid->Fields[1]->DisplayLabel="Станция";
DirectoryForm->TableDBGrid->Fields[2]->DisplayLabel="Блок";
DirectoryForm->TableDBGrid->Fields[3]->DisplayLabel="Наименование";
DirectoryForm->TableDBGrid->Fields[4]->DisplayLabel="Код размещения";
DirectoryForm->TableDBGrid->Fields[5]->DisplayLabel="Код сотрудника";
}
//---------------------------------------------------------------------------
void __fastcall Tmainclientsform::N9Click(TObject *Sender)
{
mainflag=false;
/* просмотр таблицы исполнитель */
mainclientsform->DataSource1->DataSet=mainclientsform->ADOTable6;
mainclientsform->ADOTable6->Active=true;
BuildGridDatabaseDirectoryItem("Заказчик", mainclientsform->DataSource1,mainclientsform,"DBDirectoryTemplateForm" );
DirectoryForm->TableDBGrid->Fields[0]->DisplayLabel="№";
DirectoryForm->TableDBGrid->Fields[1]->DisplayLabel="Фамилия";
DirectoryForm->TableDBGrid->Fields[2]->DisplayLabel="Имя";
DirectoryForm->TableDBGrid->Fields[3]->DisplayLabel="Отчество";
DirectoryForm->TableDBGrid->Fields[4]->DisplayLabel="Телефон";
DirectoryForm->TableDBGrid->Fields[5]->DisplayLabel="Моб телефон";
DirectoryForm->TableDBGrid->Fields[6]->DisplayLabel="Код отдела";
}//---------------------------------------------------------------------------
void __fastcall Tmainclientsform::N10Click(TObject *Sender)
{
mainflag=false;
/* просмотр таблицы резолюция */
mainclientsform->DataSource1->DataSet=mainclientsform->ADOTable7;
mainclientsform->ADOTable7->Active=true;
BuildGridDatabaseDirectoryItem("Заказ", mainclientsform->DataSource1,mainclientsform,"DBDirectoryTemplateForm" );
DirectoryForm->TableDBGrid->Fields[0]->DisplayLabel="№";
DirectoryForm->TableDBGrid->Fields[1]->DisplayLabel="Дата";
DirectoryForm->TableDBGrid->Fields[2]->DisplayLabel="Наименование";
DirectoryForm->TableDBGrid->Fields[3]->DisplayLabel="Количество";
DirectoryForm->TableDBGrid->Fields[4]->DisplayLabel="Срок доставки";
}//---------------------------------------------------------------------------
void __fastcall Tmainclientsform::N11Click(TObject *Sender)
{
mainflag=false;
/* просмотр таблицы отдел */
mainclientsform->DataSource1->DataSet=mainclientsform->ADOTable8;
mainclientsform->ADOTable8->Active=true;
BuildGridDatabaseDirectoryItem("Сотрудник", mainclientsform->DataSource1,mainclientsform,"DBDirectoryTemplateForm" );
DirectoryForm->TableDBGrid->Fields[0]->DisplayLabel="№";
DirectoryForm->TableDBGrid->Fields[1]->DisplayLabel="Должность";
DirectoryForm->TableDBGrid->Fields[2]->DisplayLabel="Фамилия";
DirectoryForm->TableDBGrid->Fields[3]->DisplayLabel="Имя";
DirectoryForm->TableDBGrid->Fields[4]->DisplayLabel="Отчество";
DirectoryForm->TableDBGrid->Fields[5]->DisplayLabel="Телефон";
DirectoryForm->TableDBGrid->Fields[6]->DisplayLabel="Моб телефон";
DirectoryForm->TableDBGrid->Fields[7]->DisplayLabel="Статус";
}//---------------------------------------------------------------------------
void __fastcall Tmainclientsform::N12Click(TObject *Sender)
{
/* просмотр базы данных */
mainclientsform->N3Click(Sender);
mainflag=true;
flag1=true;
flag2=false;
BuildaddForms("Просмотр базы данных", mainclientsform->DataSource1,mainclientsform,"addforms" );
ProsmForm->GroupBox2->Visible=false;
ProsmForm->GroupBox3->Visible=false;
ProsmForm->GroupBox1->Visible=false;
ProsmForm->GroupBox4->Visible=false;
ProsmForm->GroupBox5->Visible=false;
ProsmForm->Height=800;
mainclientsform->DataSource1->DataSet->Last();
}
//---------------------------------------------------------------------------
void __fastcall Tmainclientsform::N16Click(TObject *Sender)
{
mainflag=false;
flag1=false;
flag2=true;
/* добавление записи исполнитель/отдел */
BuildaddForms("Заказчик / отдел", mainclientsform->DataSource1,mainclientsform,"addforms" );
ProsmForm->GroupBox2->Visible=false;
ProsmForm->GroupBox3->Visible=false;
ProsmForm->GroupBox1->Visible=true;
ProsmForm->GroupBox4->Visible=false;
ProsmForm->GroupBox5->Visible=false;
ProsmForm->GroupBox7->Visible=false;
ProsmForm->Height=400;
}
//---------------------------------------------------------------------------
void __fastcall Tmainclientsform::N17Click(TObject *Sender)
{
mainflag=false;
/* добавление записи Неисправность*/
BuildaddForms("Неисправность", mainclientsform->DataSource1,mainclientsform,"addforms" );
ProsmForm->GroupBox1->Visible=false;
ProsmForm->GroupBox3->Visible=false;
ProsmForm->GroupBox4->Visible=false;
ProsmForm->GroupBox2->Visible=true;
ProsmForm->GroupBox5->Visible=false;
ProsmForm->Height=400;
}
//---------------------------------------------------------------------------
void __fastcall Tmainclientsform::N18Click(TObject *Sender)
{
/* добавление записи резолюция*/
mainflag=false;
BuildaddForms(" Резолюцию", mainclientsform->DataSource1,mainclientsform,"addforms" );
ProsmForm->GroupBox1->Visible=false;
ProsmForm->GroupBox2->Visible=false;
ProsmForm->GroupBox3->Visible=true;
ProsmForm->GroupBox4->Visible=false;
ProsmForm->GroupBox5->Visible=false;
ProsmForm->Height=400;
}
//---------------------------------------------------------------------------
void __fastcall Tmainclientsform::N19Click(TObject *Sender)
{
mainflag=false;
/* добавление записи вид документа*/
BuildaddForms("Вид документа", mainclientsform->DataSource1,mainclientsform,"addforms" );
ProsmForm->GroupBox1->Visible=false;
ProsmForm->GroupBox2->Visible=false;
ProsmForm->GroupBox3->Visible=false;
ProsmForm->GroupBox4->Visible=true;
ProsmForm->GroupBox5->Visible=false;
ProsmForm->GroupBox7->Visible=false;
ProsmForm->Height=400;
}
//---------------------------------------------------------------------------
void __fastcall Tmainclientsform::N14Click(TObject *Sender)
{
/* добавление записи документ*/
BuildaddForms("Создать заявку", mainclientsform->DataSource1,mainclientsform,"addforms" );
ProsmForm->GroupBox1->Visible=false;
ProsmForm->GroupBox2->Visible=false;
ProsmForm->GroupBox3->Visible=false;
ProsmForm->GroupBox4->Visible=false;
ProsmForm->GroupBox5->Visible=true;
ProsmForm->GroupBox7->Visible=false;
ProsmForm->Height=400;
}
//---------------------------------------------------------------------------
void __fastcall Tmainclientsform::DataSource1DataChange(TObject *Sender,
TField *Field)
{
/* просмотр записей таблицы*/
if (mainflag )
{
if (flag2) {
int kodzakazchik,kodispoln,kodsotr, kod_neispr,kodzakaz, kodzayavka;
String notes, status;
kodzakazchik =mainclientsform->DataSource1->DataSet->FieldByName("kodzakazchik")->AsInteger;
kodispoln =mainclientsform->DataSource1->DataSet->FieldByName("kodispoln")->AsInteger;
kodsotr =mainclientsform->DataSource1->DataSet->FieldByName("kodsotr")->AsInteger;
kod_neispr =mainclientsform->DataSource1->DataSet->FieldByName("kod_neispr")->AsInteger;
kodzakaz =mainclientsform->DataSource1->DataSet->FieldByName("kodzakaz")->AsInteger;
kodzayavka=mainclientsform->DataSource1->DataSet->FieldByName("kodzayavka")->AsInteger;
notes=mainclientsform->DataSource1->DataSet->FieldByName("notes")->AsString;
status=mainclientsform->DataSource1->DataSet->FieldByName("otmetka")->AsString;
ProsmForm1->Edit70->Text=IntToStr(kodzayavka);
ProsmForm1->Edit71->Text=status;
ProsmForm1->Edit72->Text=notes;
TLocateOptions Options;
Options << loPartialKey,loCaseInsensitive;
mainclientsform->ADOTable3->Active=true;
mainclientsform->ADOTable3->Locate("kodispoln",kodispoln,Options);
ProsmForm1->Edit78->Text=DateToStr(mainclientsform->ADOTable3->FieldByName("dateispoln")->AsDateTime);
ProsmForm1->Edit74->Text=mainclientsform->ADOTable3->FieldByName("otchet")->AsString;
ProsmForm1->Edit76->Text=mainclientsform->ADOTable3->FieldByName("rabot")->AsString;
mainclientsform->ADOTable6->Active=true;
mainclientsform->ADOTable6->Locate("kodzakazchik", kodzakazchik,Options);
ProsmForm1->Edit75->Text=mainclientsform->ADOTable6->FieldByName("fam")->AsString;
ProsmForm1->Edit77->Text=mainclientsform->ADOTable6->FieldByName("name")->AsString;
ProsmForm1->Edit80->Text=mainclientsform->ADOTable6->FieldByName("secname")->AsString;
ProsmForm1->Edit67->Text=mainclientsform->ADOTable6->FieldByName("telefone")->AsString;
ProsmForm1->Edit65->Text=mainclientsform->ADOTable6->FieldByName("mob")->AsString;
mainclientsform->ADOTable5->Active=true;
mainclientsform->ADOTable5->Locate("kod_neispr", kod_neispr,Options);
ProsmForm1->Edit64->Text=mainclientsform->ADOTable5->FieldByName("naimenovanie")->AsString;
ProsmForm1->Edit83->Text=mainclientsform->ADOTable5->FieldByName("block")->AsString;
ProsmForm1->Edit86->Text=mainclientsform->ADOTable5->FieldByName("station")->AsString;
mainclientsform->ADOTable7->Active=true;
mainclientsform->ADOTable7->Locate("kodzakaz", kodzakaz,Options);
ProsmForm1->Edit82->Text=mainclientsform->ADOTable7->FieldByName("naimenovanie")->AsString;
ProsmForm1->Edit87->Text=mainclientsform->ADOTable7->FieldByName("kolvo")->AsString;
mainclientsform->ADOTable8->Active=true;
mainclientsform->ADOTable8->Locate("kodsotr", kodsotr,Options);
ProsmForm1->Edit79->Text=mainclientsform->ADOTable8->FieldByName("fam")->AsString;
ProsmForm1->Edit88->Text=mainclientsform->ADOTable8->FieldByName("name")->AsString;
ProsmForm1->Edit66->Text=mainclientsform->ADOTable8->FieldByName("otch")->AsString;
ProsmForm1->Edit19->Text=mainclientsform->ADOTable8->FieldByName("telefon")->AsString;
ProsmForm1->Edit20->Text=mainclientsform->ADOTable8->FieldByName("mobtel")->AsString;
}
}
}
//---------------------------------------------------------------------------
void __fastcall Tmainclientsform::N20Click(TObject *Sender)
{
// настройка параметров поиска
nomer_poisk=1;
int i;
for ( int i = mainclientsform->MDIChildCount-1; i>=0; i--)
{
if (mainclientsform->MDIChildren[i]->Name == "addforms")
{
mainclientsform->MDIChildren[i]->Free();} }
for ( int i = mainclientsform->MDIChildCount-1; i>=0; i--)
{
if (mainclientsform->MDIChildren[i]->Name == "DBDirectoryTemplateForm")
{
mainclientsform->MDIChildren[i]->Free();} }
BuildPoiskForms("Параметры поиска", mainclientsform->DataSource1,mainclientsform,"parampoiskform" );
Poisk->GroupBox3->Visible=false;
Poisk->GroupBox2->Visible=false;
Poisk->GroupBox1->Visible=true;
}
//---------------------------------------------------------------------------
void __fastcall Tmainclientsform::N23Click(TObject *Sender)
{
// настройка параметров поиска
nomer_poisk=4;
int i;
for ( int i = mainclientsform->MDIChildCount-1; i>=0; i--)
{
if (mainclientsform->MDIChildren[i]->Name == "addforms")
{
mainclientsform->MDIChildren[i]->Free();} }
for ( int i = mainclientsform->MDIChildCount-1; i>=0; i--)
{
if (mainclientsform->MDIChildren[i]->Name == "DBDirectoryTemplateForm")
{
mainclientsform->MDIChildren[i]->Free();} }
BuildPoiskForms("Параметры поиска", mainclientsform->DataSource1,mainclientsform,"parampoiskform" );
Poisk->GroupBox1->Visible=false;
Poisk->GroupBox2->Visible=true;
Poisk->GroupBox3->Visible=false;
}
//---------------------------------------------------------------------------
void __fastcall Tmainclientsform::N22Click(TObject *Sender)
{
// настройка параметров поиска
nomer_poisk=3;
int i;
for ( int i = mainclientsform->MDIChildCount-1; i>=0; i--)
{
if (mainclientsform->MDIChildren[i]->Name == "addforms")
{
mainclientsform->MDIChildren[i]->Free();} }
for ( int i = mainclientsform->MDIChildCount-1; i>=0; i--)
{
if (mainclientsform->MDIChildren[i]->Name == "DBDirectoryTemplateForm")
{
mainclientsform->MDIChildren[i]->Free();} }
//
BuildPoiskForms("Параметры поиска", mainclientsform->DataSource1,mainclientsform,"parampoiskform" );
Poisk->GroupBox1->Visible=false;
Poisk->GroupBox1->Caption="Неотработанные документы";
Poisk->GroupBox2->Visible=false;
Poisk->GroupBox3->Visible=false;
}
//---------------------------------------------------------------------------
void __fastcall Tmainclientsform::N21Click(TObject *Sender)
{
// настройка параметров поиска
nomer_poisk=2;
int i;
for ( int i = mainclientsform->MDIChildCount-1; i>=0; i--)
{
if (mainclientsform->MDIChildren[i]->Name == "addforms")
{
mainclientsform->MDIChildren[i]->Free();} }
for ( int i = mainclientsform->MDIChildCount-1; i>=0; i--)
{
if (mainclientsform->MDIChildren[i]->Name == "DBDirectoryTemplateForm")
{
mainclientsform->MDIChildren[i]->Free();} }
BuildPoiskForms("Параметры поиска", mainclientsform->DataSource1,mainclientsform,"parampoiskform" );
Poisk->GroupBox1->Visible=false;
Poisk->GroupBox2->Visible=false;
Poisk->GroupBox3->Visible=true;
}
//---------------------------------------------------------------------------
void __fastcall Tmainclientsform::FormCreate(TObject *Sender)
{
/* настройка соединения бвзы данных при открытии */
WideString NewConnection;
WideString qqq;
ADOConnection1->Close();
// указываем файл .udl для ADOConnection1
ADOConnection1->ConnectionString ="Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=ksk;Data Source=MICROSOF-203043";
ADOConnection1->Open();
mainclientsform->ADOTable1->Active=true;
mainclientsform->ADOTable2->Active=true;
mainclientsform->ADOTable3->Active=true;
mainclientsform->ADOTable4->Active=true;
mainclientsform->ADOTable5->Active=true;
mainclientsform->ADOTable6->Active=true;
mainclientsform->ADOTable7->Active=true;
mainclientsform->ADOTable8->Active=true;
}
//---------------------------------------------------------------------------
void __fastcall Tmainclientsform::N24Click(TObject *Sender)
{
mainclientsform->N3Click(Sender);
mainflag=true;
flag2=true;
flag1=false;
BuildaddForms1("Просмотр базы данных", mainclientsform->DataSource1,mainclientsform,"addforms" );
ProsmForm1->GroupBox2->Visible=false;
ProsmForm1->GroupBox3->Visible=false;
ProsmForm1->GroupBox1->Visible=false;
ProsmForm1->GroupBox4->Visible=false;
ProsmForm1->GroupBox5->Visible=false;