Курсовая работа: Структура иерархии классов "Экран курсового проектирования"
return;
}
}
private: System::Void button5_Click(System::Object^ sender, System::EventArgs^ e) {
this->Close();
}
private: System::Void button6_Click(System::Object^ sender, System::EventArgs^ e) {
System::Windows::Forms::DialogResult dialres;
dialres=MessageBox::Show("Выточнохотитеудалитьзапись?","Удалить?",MessageBoxButtons::OKCancel,MessageBoxIcon::Warning);
if(dialres==System::Windows::Forms::DialogResult::OK){
if(this->dataGridView1->SelectedRows->Count > 0 &&
this->dataGridView1->SelectedRows[0]->Index !=
this->dataGridView1->Rows->Count){
this->dataGridView1->Rows->RemoveAt(this->dataGridView1->SelectedRows[0]->Index);
CountDataGrid--;
if(CountDataGrid==0){
button1->Enabled=false;
button2->Enabled=false;
button6->Enabled=false;
checkBox1->Enabled=false;
}
MessageBox::Show("Записьудалена!","Information",MessageBoxButtons::OK,MessageBoxIcon::Information);
}
else{
MessageBox::Show("Невыделенаудаляемаястрока!","Ошибка",MessageBoxButtons::OK,MessageBoxIcon::Error);
}
}
}
private: System::Void button7_Click(System::Object^ sender, System::EventArgs^ e) {
System::Windows::Forms::DialogResult dialres;
Start ^newdlg=gcnew Start();
dialres=newdlg->ShowDialog();
if(dialres==System::Windows::Forms::DialogResult::OK){
this->Text=newdlg->textBox1->Text;
Screen.SetName(newdlg->textBox1->Text);
Screen.SetComposition(newdlg->textBox2->Text);
Screen.SetDate(newdlg->textBox3->Text);
listBox1->Items->Add(Screen.TName);
listBox2->Items->Add("Состав приемной комиссии: ");
listBox2->Items->Add(Screen.Composition);
listBox2->Items->Add("Дата утверждения: ");
listBox2->Items->Add(Screen.Date);
}
}
private: System::Void aboutToolStripMenuItem_Click(System::Object^ sender, System::EventArgs^ e) {
System::Diagnostics::Process::Start("Help.chm");
}
private: System::Void button1_Click(System::Object^ sender, System::EventArgs^ e) {
System::Windows::Forms::DialogResult dialres;
Search ^newdlg=gcnew Search();
dialres=newdlg->ShowDialog();
if(dialres==System::Windows::Forms::DialogResult::OK){
System::String ^srh;
srh=newdlg->textBox1->Text;
if(CountDataGrid!=0){
for(int i=0; i<CountDataGrid; i++){
for(int j=0; j<dataGridView1->ColumnCount; j++){
if(System::Convert::ToString(dataGridView1->Rows[i]->Cells[j]->Value)==srh){
dataGridView1->CurrentCell=dataGridView1->Rows[i]->Cells[j];
System::Windows::Forms::DialogResult dl;
dl=MessageBox::Show("Искатьдалее?","Continue?",MessageBoxButtons::OKCancel,MessageBoxIcon::Question);
if(dl==System::Windows::Forms::DialogResult::Cancel){
break;
4 }
}
}
}
MessageBox::Show("Поискзавершен!","Information",MessageBoxButtons::OK,MessageBoxIcon::Information);
}
}
}
private: System::Void button2_Click(System::Object^ sender, System::EventArgs^ e) {
System::Windows::Forms::DialogResult dl;
dl=MessageBox::Show("Редактироватьзапись?","Изменить?",MessageBoxButtons::OKCancel,MessageBoxIcon::Question);
if(dl==System::Windows::Forms::DialogResult::OK){
if(this->dataGridView1->SelectedRows->Count > 0 &&
this->dataGridView1->SelectedRows[0]->Index !=
this->dataGridView1->Rows->Count){
System::Windows::Forms::DialogResult dialres;
Form2 ^newdlg=gcnew Form2();
newdlg->textBox1->Text=System::Convert::ToString(this->dataGridView1->SelectedRows[0]->Cells[0]->Value);
newdlg->textBox2->Text=System::Convert::ToString(this->dataGridView1->SelectedRows[0]->Cells[1]->Value);
newdlg->textBox3->Text=System::Convert::ToString(this->dataGridView1->SelectedRows[0]->Cells[2]->Value);
newdlg->textBox4->Text=System::Convert::ToString(this->dataGridView1->SelectedRows[0]->Cells[3]->Value);
newdlg->textBox5->Text=System::Convert::ToString(this->dataGridView1->SelectedRows[0]->Cells[4]->Value);
newdlg->textBox6->Text=System::Convert::ToString(this->dataGridView1->SelectedRows[0]->Cells[5]->Value);
newdlg->textBox7->Text=System::Convert::ToString(this->dataGridView1->SelectedRows[0]->Cells[6]->Value);
newdlg->textBox8->Text=System::Convert::ToString(this->dataGridView1->SelectedRows[0]->Cells[7]->Value);
newdlg->textBox9->Text=System::Convert::ToString(this->dataGridView1->SelectedRows[0]->Cells[8]->Value);
newdlg->textBox10->Text=System::Convert::ToString(this->dataGridView1->SelectedRows[0]->Cells[9]->Value);
newdlg->textBox11->Text=System::Convert::ToString(this->dataGridView1->SelectedRows[0]->Cells[10]->Value);
newdlg->textBox12->Text=System::Convert::ToString(this->dataGridView1->SelectedRows[0]->Cells[11]->Value);
newdlg->textBox13->Text=System::Convert::ToString(this->dataGridView1->SelectedRows[0]->Cells[12]->Value);
newdlg->textBox14->Text=System::Convert::ToString(this->dataGridView1->SelectedRows[0]->Cells[13]->Value);
newdlg->textBox15->Text=System::Convert::ToString(this->dataGridView1->SelectedRows[0]->Cells[14]->Value);
newdlg->textBox16->Text=System::Convert::ToString(this->dataGridView1->SelectedRows[0]->Cells[15]->Value);
newdlg->textBox17->Text=System::Convert::ToString(this->dataGridView1->SelectedRows[0]->Cells[16]->Value);
dialres=newdlg->ShowDialog();
if(dialres==System::Windows::Forms::DialogResult::OK){
this->dataGridView1->SelectedRows[0]->Cells[0]->Value=newdlg->textBox1->Text;
this->dataGridView1->SelectedRows[0]->Cells[1]->Value=newdlg->textBox2->Text;
this->dataGridView1->SelectedRows[0]->Cells[2]->Value=newdlg->textBox3->Text;
this->dataGridView1->SelectedRows[0]->Cells[3]->Value=newdlg->textBox4->Text;
this->dataGridView1->SelectedRows[0]->Cells[4]->Value=newdlg->textBox5->Text;
this->dataGridView1->SelectedRows[0]->Cells[5]->Value=newdlg->textBox6->Text;
this->dataGridView1->SelectedRows[0]->Cells[6]->Value=newdlg->textBox7->Text;
this->dataGridView1->SelectedRows[0]->Cells[7]->Value=newdlg->textBox8->Text;
this->dataGridView1->SelectedRows[0]->Cells[8]->Value=newdlg->textBox9->Text;
this->dataGridView1->SelectedRows[0]->Cells[9]->Value=newdlg->textBox10->Text;
this->dataGridView1->SelectedRows[0]->Cells[10]->Value=newdlg->textBox11->Text;
this->dataGridView1->SelectedRows[0]->Cells[11]->Value=newdlg->textBox12->Text;
this->dataGridView1->SelectedRows[0]->Cells[12]->Value=newdlg->textBox13->Text;
this->dataGridView1->SelectedRows[0]->Cells[13]->Value=newdlg->textBox14->Text;
this->dataGridView1->SelectedRows[0]->Cells[14]->Value=newdlg->textBox15->Text;
this->dataGridView1->SelectedRows[0]->Cells[15]->Value=newdlg->textBox16->Text;
this->dataGridView1->SelectedRows[0]->Cells[16]->Value=newdlg->textBox17->Text;
}
MessageBox::Show("Записьотредактирована!","Information",MessageBoxButtons::OK,MessageBoxIcon::Information);
}
else{
MessageBox::Show("Невыделенаредактируемаястрока!","Ошибка",MessageBoxButtons::OK,MessageBoxIcon::Error);
}
}
}
private: System::Void aboutToolStripMenuItem1_Click(System::Object^ sender, System::EventArgs^ e) {
MessageBox::Show("\"\Экранкурсовогопроектирования\"\ Версия 1.0","Опрограмме",MessageBoxButtons::OK,MessageBoxIcon::Information);
}
private: System::Void checkBox1_CheckedChanged(System::Object^ sender, System::EventArgs^ e) {
if(checkBox1->Checked==true&&CountDataGrid!=0){
button2->Enabled=true;
button6->Enabled=true;
dataGridView1->RowHeadersVisible=true;
}
if(checkBox1->Checked==false&&CountDataGrid!=0){
dataGridView1->RowHeadersVisible=false;
button2->Enabled=false;
button6->Enabled=false;
}
}
};
}
ФайлForm2.h. Окнодобавления/редактированиязаписей.
#pragma once
#include "TStudent.h"
namespace WindowsFormApplicationC {
using namespace System;
using namespace System::ComponentModel;
using namespace System::Collections;
using namespace System::Windows::Forms;
using namespace System::Data;
using namespace System::Drawing;
using namespace System::IO;
public ref class Form2 : public System::Windows::Forms::Form
{
public:
Form2(void)
{
InitializeComponent();
}
protected:
~Form2()
{
Страницы: 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11