?? roominfochange.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 + -