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

📄 roominfochange.h

📁 导致教室占用的变更
💻 H
字号:
#pragma once
#include "FileRW.h"

using namespace System;
using namespace System::ComponentModel;
using namespace System::Collections;
using namespace System::Windows::Forms;
using namespace System::Data;
using namespace System::Drawing;


namespace ClassRoom {

	/// <summary>
	/// RoomInfoChange 摘要
	///
	/// 警告: 如果更改此类的名称,则需要更改
	///          与此类所依赖的所有 .resx 文件关联的托管资源编译器工具的
	///          “资源文件名”属性。否则,
	///          设计器将不能与此窗体的关联
	///          本地化资源正确交互。
	/// </summary>
	public ref class RoomInfoChange : public System::Windows::Forms::Form
	{
	 public: 

		String^ filePath_State;//教室状态信息文件路径

		RoomInfoChange(void)
		{
			InitializeComponent();

			DateIndex  = -1;
			TimeSegmentIndex = -1;
			IdlesseClassRoomIndex = -1;
		    UsingClassRoomIndex  = -1;
			SyllabusList = gcnew ArrayList();
			RoomNameList = gcnew ArrayList();
			DateArray = gcnew array<String^>{"星期一","星期二","星期三","星期四",
				"星期五","星期六","星期日"};

			TimeSegmentArray = gcnew array<String^>{"上午第一大节","上午第二大节",
				"下午第一大节","下午第二大节","晚上第一大节"};
			filePath_State = gcnew String("");

			this->comboBox1->Items->AddRange( DateArray  );
			this->comboBox2->Items->AddRange( TimeSegmentArray );
			file = gcnew FileRW();
			IdlesseClassRoomString = gcnew String("") ;
			UsingClassRoomString = gcnew String("") ;
			//
			//TODO: 在此处添加构造函数代码
			//
		}

	protected:
		/// <summary>
		/// 清理所有正在使用的资源。
		/// </summary>
		~RoomInfoChange()
		{
			if (components)
			{
				delete components;
			}
		}
	private: System::Windows::Forms::GroupBox^  groupBox1;
	private: System::Windows::Forms::DataGridView^  dataGridView1;
	private: System::Windows::Forms::Label^  label1;
	private: System::Windows::Forms::ComboBox^  comboBox1;
	private: System::Windows::Forms::ComboBox^  comboBox2;
	private: System::Windows::Forms::Button^  button1;
	private: System::Windows::Forms::Label^  label2;
	private: System::Windows::Forms::GroupBox^  groupBox2;
	private: System::Windows::Forms::Label^  label3;
	private: System::Windows::Forms::ComboBox^  comboBox3;
	private: System::Windows::Forms::Button^  button2;
	private: System::Windows::Forms::Label^  label4;
	private: System::Windows::Forms::ComboBox^  comboBox4;
	private: System::Windows::Forms::DataGridViewTextBoxColumn^  Column1;

	private:
		/// <summary>
		/// 必需的设计器变量。
		/// </summary>
		System::ComponentModel::Container ^components;

		array<String^>^ DateArray;//存放星期的数组
		array<String^>^ TimeSegmentArray;//存放大课节数的数组
		array<String^>^ ClassRoomArray;//存放教室名称的数组
		int DateIndex ;//返回选择星期的编号,用在下拉菜单中
		int TimeSegmentIndex ;//返回大课节数的编号
		int IdlesseClassRoomIndex ;//返回空闲教室的编号
		int UsingClassRoomIndex ;//返回被占用教室的编号
		FileRW^ file ;//文件读取对象
		ArrayList^ IdlesseClassRoomList ;//存放空闲教室的数组链表
		ArrayList^ SyllabusList; //存每个教室课程字符串的数组列表
		ArrayList^ RoomNameList;//存放灭个教室名称的数组列表
		String^ IdlesseClassRoomString ;//被选定的空闲教室名称
		String^ UsingClassRoomString ;//被选定的被占用教室名称

#pragma region Windows Form Designer generated code
		/// <summary>
		/// 设计器支持所需的方法 - 不要
		/// 使用代码编辑器修改此方法的内容。
		/// </summary>
		void InitializeComponent(void)
		{
			System::ComponentModel::ComponentResourceManager^  resources = (gcnew System::ComponentModel::ComponentResourceManager(RoomInfoChange::typeid));
			this->groupBox1 = (gcnew System::Windows::Forms::GroupBox());
			this->button1 = (gcnew System::Windows::Forms::Button());
			this->label2 = (gcnew System::Windows::Forms::Label());
			this->comboBox2 = (gcnew System::Windows::Forms::ComboBox());
			this->label1 = (gcnew System::Windows::Forms::Label());
			this->comboBox1 = (gcnew System::Windows::Forms::ComboBox());
			this->dataGridView1 = (gcnew System::Windows::Forms::DataGridView());
			this->Column1 = (gcnew System::Windows::Forms::DataGridViewTextBoxColumn());
			this->groupBox2 = (gcnew System::Windows::Forms::GroupBox());
			this->button2 = (gcnew System::Windows::Forms::Button());
			this->label4 = (gcnew System::Windows::Forms::Label());
			this->comboBox4 = (gcnew System::Windows::Forms::ComboBox());
			this->label3 = (gcnew System::Windows::Forms::Label());
			this->comboBox3 = (gcnew System::Windows::Forms::ComboBox());
			this->groupBox1->SuspendLayout();
			(cli::safe_cast<System::ComponentModel::ISupportInitialize^  >(this->dataGridView1))->BeginInit();
			this->groupBox2->SuspendLayout();
			this->SuspendLayout();
			// 
			// groupBox1
			// 
			this->groupBox1->BackColor = System::Drawing::Color::Transparent;
			this->groupBox1->Controls->Add(this->button1);
			this->groupBox1->Controls->Add(this->label2);
			this->groupBox1->Controls->Add(this->comboBox2);
			this->groupBox1->Controls->Add(this->label1);
			this->groupBox1->Controls->Add(this->comboBox1);
			this->groupBox1->Controls->Add(this->dataGridView1);
			this->groupBox1->Font = (gcnew System::Drawing::Font(L"宋体", 10.5F, System::Drawing::FontStyle::Bold, System::Drawing::GraphicsUnit::Point, 
				static_cast<System::Byte>(134)));
			this->groupBox1->Location = System::Drawing::Point(14, 12);
			this->groupBox1->Name = L"groupBox1";
			this->groupBox1->Size = System::Drawing::Size(447, 299);
			this->groupBox1->TabIndex = 0;
			this->groupBox1->TabStop = false;
			this->groupBox1->Text = L"空闲教室检索";
			// 
			// button1
			// 
			this->button1->Location = System::Drawing::Point(268, 219);
			this->button1->Name = L"button1";
			this->button1->Size = System::Drawing::Size(75, 23);
			this->button1->TabIndex = 5;
			this->button1->Text = L"检索";
			this->button1->UseVisualStyleBackColor = true;
			this->button1->Click += gcnew System::EventHandler(this, &RoomInfoChange::Button1_Click);
			// 
			// label2
			// 
			this->label2->AutoSize = true;
			this->label2->Location = System::Drawing::Point(225, 109);
			this->label2->Name = L"label2";
			this->label2->Size = System::Drawing::Size(67, 14);
			this->label2->TabIndex = 4;
			this->label2->Text = L"大课节数";
			// 
			// comboBox2
			// 
			this->comboBox2->DropDownStyle = System::Windows::Forms::ComboBoxStyle::DropDownList;
			this->comboBox2->FormattingEnabled = true;
			this->comboBox2->Location = System::Drawing::Point(309, 105);
			this->comboBox2->Name = L"comboBox2";
			this->comboBox2->Size = System::Drawing::Size(107, 22);
			this->comboBox2->TabIndex = 3;
			this->comboBox2->SelectedIndexChanged += gcnew System::EventHandler(this, &RoomInfoChange::comboBox2_SelectedIndexChanged);
			// 
			// label1
			// 
			this->label1->AutoSize = true;
			this->label1->ForeColor = System::Drawing::Color::FromArgb(static_cast<System::Int32>(static_cast<System::Byte>(192)), static_cast<System::Int32>(static_cast<System::Byte>(64)), 
				static_cast<System::Int32>(static_cast<System::Byte>(0)));
			this->label1->Location = System::Drawing::Point(225, 41);
			this->label1->Name = L"label1";
			this->label1->Size = System::Drawing::Size(67, 14);
			this->label1->TabIndex = 2;
			this->label1->Text = L"星期编号";
			// 
			// comboBox1
			// 
			this->comboBox1->DropDownStyle = System::Windows::Forms::ComboBoxStyle::DropDownList;
			this->comboBox1->FormattingEnabled = true;
			this->comboBox1->Location = System::Drawing::Point(309, 36);
			this->comboBox1->Name = L"comboBox1";
			this->comboBox1->Size = System::Drawing::Size(107, 22);
			this->comboBox1->TabIndex = 1;
			this->comboBox1->SelectedIndexChanged += gcnew System::EventHandler(this, &RoomInfoChange::comboBox1_SelectedIndexChanged);
			// 
			// dataGridView1
			// 
			this->dataGridView1->ColumnHeadersHeightSizeMode = System::Windows::Forms::DataGridViewColumnHeadersHeightSizeMode::AutoSize;
			this->dataGridView1->Columns->AddRange(gcnew cli::array< System::Windows::Forms::DataGridViewColumn^  >(1) {this->Column1});
			this->dataGridView1->Location = System::Drawing::Point(18, 36);
			this->dataGridView1->Name = L"dataGridView1";
			this->dataGridView1->RowHeadersBorderStyle = System::Windows::Forms::DataGridViewHeaderBorderStyle::None;
			this->dataGridView1->RowTemplate->Height = 23;
			this->dataGridView1->Size = System::Drawing::Size(147, 247);
			this->dataGridView1->TabIndex = 0;
			// 
			// Column1
			// 
			this->Column1->HeaderText = L"空闲教室";
			this->Column1->Name = L"Column1";
			this->Column1->ReadOnly = true;
			// 
			// groupBox2
			// 
			this->groupBox2->BackColor = System::Drawing::Color::Transparent;
			this->groupBox2->Controls->Add(this->button2);
			this->groupBox2->Controls->Add(this->label4);
			this->groupBox2->Controls->Add(this->comboBox4);
			this->groupBox2->Controls->Add(this->label3);
			this->groupBox2->Controls->Add(this->comboBox3);
			this->groupBox2->Font = (gcnew System::Drawing::Font(L"宋体", 10.5F, System::Drawing::FontStyle::Regular, System::Drawing::GraphicsUnit::Point, 
				static_cast<System::Byte>(134)));
			this->groupBox2->ForeColor = System::Drawing::Color::Black;
			this->groupBox2->Location = System::Drawing::Point(14, 331);
			this->groupBox2->Name = L"groupBox2";
			this->groupBox2->Size = System::Drawing::Size(447, 135);
			this->groupBox2->TabIndex = 1;
			this->groupBox2->TabStop = false;
			this->groupBox2->Text = L"教室占用信息更改";
			// 
			// button2
			// 
			this->button2->Location = System::Drawing::Point(327, 69);
			this->button2->Name = L"button2";
			this->button2->Size = System::Drawing::Size(75, 23);
			this->button2->TabIndex = 4;
			this->button2->Text = L"保存修改";
			this->button2->UseVisualStyleBackColor = true;
			this->button2->Click += gcnew System::EventHandler(this, &RoomInfoChange::Button2_Click);
			// 
			// label4
			// 
			this->label4->AutoSize = true;
			this->label4->ForeColor = System::Drawing::Color::Black;
			this->label4->Location = System::Drawing::Point(130, 36);
			this->label4->Name = L"label4";
			this->label4->Size = System::Drawing::Size(133, 14);
			this->label4->TabIndex = 3;
			this->label4->Text = L"从空闲转为占用状态";
			// 
			// comboBox4
			// 
			this->comboBox4->DropDownStyle = System::Windows::Forms::ComboBoxStyle::DropDownList;
			this->comboBox4->FormattingEnabled = true;
			this->comboBox4->Location = System::Drawing::Point(22, 73);
			this->comboBox4->Name = L"comboBox4";
			this->comboBox4->Size = System::Drawing::Size(86, 22);
			this->comboBox4->TabIndex = 2;
			this->comboBox4->SelectedIndexChanged += gcnew System::EventHandler(this, &RoomInfoChange::comboBox4_SelectedIndexChanged);
			// 
			// label3
			// 
			this->label3->AutoSize = true;
			this->label3->ForeColor = System::Drawing::Color::Black;
			this->label3->Location = System::Drawing::Point(129, 76);
			this->label3->Name = L"label3";
			this->label3->Size = System::Drawing::Size(133, 14);
			this->label3->TabIndex = 1;
			this->label3->Text = L"从占用转为空闲状态";
			// 
			// comboBox3
			// 
			this->comboBox3->DropDownStyle = System::Windows::Forms::ComboBoxStyle::DropDownList;
			this->comboBox3->FormattingEnabled = true;
			this->comboBox3->Location = System::Drawing::Point(22, 31);
			this->comboBox3->Name = L"comboBox3";
			this->comboBox3->Size = System::Drawing::Size(86, 22);
			this->comboBox3->TabIndex = 0;
			this->comboBox3->SelectedIndexChanged += gcnew System::EventHandler(this, &RoomInfoChange::comboBox3_SelectedIndexChanged);
			// 
			// RoomInfoChange
			// 
			this->AutoScaleDimensions = System::Drawing::SizeF(7, 12);
			this->AutoScaleMode = System::Windows::Forms::AutoScaleMode::Font;
			this->BackgroundImage = (cli::safe_cast<System::Drawing::Image^  >(resources->GetObject(L"$this.BackgroundImage")));
			this->ClientSize = System::Drawing::Size(475, 498);
			this->Controls->Add(this->groupBox2);
			this->Controls->Add(this->groupBox1);
			this->Font = (gcnew System::Drawing::Font(L"宋体", 9, System::Drawing::FontStyle::Bold, System::Drawing::GraphicsUnit::Point, static_cast<System::Byte>(134)));
			this->Name = L"RoomInfoChange";
			this->Text = L"教室状态信息更改";
			this->Load += gcnew System::EventHandler(this, &RoomInfoChange::RoomInfoChange_Load);
			this->groupBox1->ResumeLayout(false);
			this->groupBox1->PerformLayout();
			(cli::safe_cast<System::ComponentModel::ISupportInitialize^  >(this->dataGridView1))->EndInit();
			this->groupBox2->ResumeLayout(false);
			this->groupBox2->PerformLayout();
			this->ResumeLayout(false);

		}
#pragma endregion

		/*读取日期选择编号*/
		private: System::Void comboBox1_SelectedIndexChanged(System::Object^  sender, System::EventArgs^  e);

		/*读取大课节编号的编号*/	 
		private: System::Void comboBox2_SelectedIndexChanged(System::Object^  sender, System::EventArgs^  e) ;

		/*读取教室编号---此教室是空闲教室,用于转换为占用状态*/
		private: System::Void comboBox3_SelectedIndexChanged(System::Object^  sender, System::EventArgs^  e); 

	    /*读取教室编号---此教室是被占用教室,用于转换为空闲状态*/
		private: System::Void RoomInfoChange::comboBox4_SelectedIndexChanged(System::Object^  sender, System::EventArgs^  e);
        
	    /*进行空闲教室的检索,把结果显示在以为列表中*/
		private: System::Void Button1_Click(System::Object^  sender, System::EventArgs^  e) ;

	    /*将状态转换后的结果进行保存*/
		private: System::Void Button2_Click(System::Object^  sender, System::EventArgs^  e) ;
		private: System::Void RoomInfoChange_Load(System::Object^  sender, System::EventArgs^  e);

		/// <summary>
		/// 以下的函数的作用是对使用同一个模板的信息左不同的设置 : 
	    ///
		/// 1)更改GroupBox中的 Text 的字符串 : ChangeGroupBox1(String^)
		/// 2)向 Combox 中添加信息,不同教学楼的教室的名称: AddClassRoomName( array<String^>^)
		/// 3) 从文件中读入信息,有教室的名字,教室的课标信息等:ReadSyllabus(),ReadRoomName()()。
	    ///
		/// </summary>
		
		public :  void  ChangeGroupBox1(String^ text);
		public :  void  AddClassRoomName( array<String^>^ newArray );
		public :  void  ReadSyllabus();
		public :  void  ReadRoomName();
};
}

⌨️ 快捷键说明

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