⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 roomnamequery.cpp

📁 导致教室占用的变更
💻 CPP
字号:
#include "StdAfx.h"
#include "RoomNameQuery.h"

using namespace ClassRoom;


System::Void RoomNameQuery::comboBox1_SelectedIndexChanged(System::Object^  sender, System::EventArgs^  e) {

				 /*读取教室的选择编号*/
				 RoomIndex = this->comboBox1->SelectedIndex;

		 }
System::Void RoomNameQuery::comboBox2_SelectedIndexChanged(System::Object^  sender, System::EventArgs^  e) {


				 /*读取教学楼的编号*/
				 BuildingIndex = this->comboBox2->SelectedIndex;

				 /*将对应的教学楼的教室输入到盛放教室名字的ComBox中*/
				 ArrayList^ list = gcnew ArrayList();
				 int count = 0 ;
				 while(ClassRoomArray->GetValue(BuildingIndex,count)!="")
				 {
					 list->Add(ClassRoomArray->GetValue(BuildingIndex,count));
					 count++;
				 }
				 array<String^>^ Temp = gcnew array<String^>(count);
				 list->CopyTo(Temp);
				 /*在选择新的教学楼编号时把上次的记录清空*/
				 this->comboBox1->SelectedIndex = -1;
				 this->comboBox1->Items->Clear();
				 this->comboBox1->Items->AddRange(Temp);

		 }

/*对用户输入的选项进行选择,用户的选项包括:教学楼的编号,教室的编号*/
System::Void RoomNameQuery::Button1_Click(System::Object^  sender, System::EventArgs^  e) {


				 if(BuildingIndex == -1)
				 {
					 MessageBox::Show("请先选择教学楼!!!","信息提示",MessageBoxButtons::OK,
						 MessageBoxIcon::Information);
				 }
				 else if(RoomIndex == -1)
				 {
					 MessageBox::Show("请选择教室编号!!!","信息提示",MessageBoxButtons::OK,
						 MessageBoxIcon::Information);
				 }
				 else
				 {
					 file->ReadText(FilePath[BuildingIndex],ClassRoomNumber[BuildingIndex]);
					 array<String^>^ temp ={"","","","","","",""};
					 DataGridViewRowCollection^ row = this->dataGridView1->Rows;
					 row->Clear();
					 SubjectArray = file->chooseRoom( Convert::ToString(ClassRoomArray->GetValue(BuildingIndex,RoomIndex)) );//寻找教室
					 for(int i = 0;i<5;i++)
					{
							for(int j=0;j<7;j++)
							{
								temp->SetValue(SubjectArray->GetValue(i,j),j);
							}
							row->Add(temp);
						}
				 }
				
		 }

System::Void RoomNameQuery::RoomNameQuery_Load(System::Object^  sender, System::EventArgs^  e) {
		 }

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -