📄 summaryform.h
字号:
this->dataGridViewTextBoxColumn2->DataPropertyName = L"类型";
this->dataGridViewTextBoxColumn2->HeaderText = L"类型";
this->dataGridViewTextBoxColumn2->Name = L"dataGridViewTextBoxColumn2";
this->dataGridViewTextBoxColumn2->ReadOnly = true;
//
// dataGridViewTextBoxColumn1
//
this->dataGridViewTextBoxColumn1->DataPropertyName = L"自编号";
this->dataGridViewTextBoxColumn1->HeaderText = L"自编号";
this->dataGridViewTextBoxColumn1->Name = L"dataGridViewTextBoxColumn1";
this->dataGridViewTextBoxColumn1->ReadOnly = true;
//
// bindingNavigatorAddNewItem
//
this->bindingNavigatorAddNewItem->Image = (cli::safe_cast<System::Drawing::Image^ >(resources->GetObject(L"bindingNavigatorAddNewItem.Image")));
this->bindingNavigatorAddNewItem->Name = L"bindingNavigatorAddNewItem";
this->bindingNavigatorAddNewItem->RightToLeftAutoMirrorImage = true;
this->bindingNavigatorAddNewItem->Size = System::Drawing::Size(49, 22);
this->bindingNavigatorAddNewItem->Text = L"新增";
this->bindingNavigatorAddNewItem->MouseUp += gcnew System::Windows::Forms::MouseEventHandler(this, &SummaryForm::bindingNavigatorAddNewItem_MouseUp);
//
// 会议纪要管理DataGridView
//
this->会议纪要管理DataGridView->AllowUserToAddRows = false;
this->会议纪要管理DataGridView->AllowUserToDeleteRows = false;
this->会议纪要管理DataGridView->AllowUserToResizeRows = false;
this->会议纪要管理DataGridView->Anchor = static_cast<System::Windows::Forms::AnchorStyles>(((System::Windows::Forms::AnchorStyles::Bottom | System::Windows::Forms::AnchorStyles::Left)
| System::Windows::Forms::AnchorStyles::Right));
this->会议纪要管理DataGridView->AutoGenerateColumns = false;
this->会议纪要管理DataGridView->Columns->AddRange(gcnew cli::array< System::Windows::Forms::DataGridViewColumn^ >(16) {this->dataGridViewTextBoxColumn1,
this->dataGridViewTextBoxColumn2, this->dataGridViewTextBoxColumn3, this->dataGridViewTextBoxColumn4, this->dataGridViewTextBoxColumn5,
this->dataGridViewTextBoxColumn6, this->dataGridViewTextBoxColumn7, this->dataGridViewTextBoxColumn8, this->dataGridViewTextBoxColumn9,
this->dataGridViewTextBoxColumn10, this->dataGridViewTextBoxColumn11, this->dataGridViewTextBoxColumn12, this->dataGridViewTextBoxColumn13,
this->dataGridViewTextBoxColumn14, this->dataGridViewTextBoxColumn15, this->dataGridViewTextBoxColumn16});
this->会议纪要管理DataGridView->DataSource = this->会议纪要管理BindingSource;
this->会议纪要管理DataGridView->Location = System::Drawing::Point(4, 293);
this->会议纪要管理DataGridView->MultiSelect = false;
this->会议纪要管理DataGridView->Name = L"会议纪要管理DataGridView";
this->会议纪要管理DataGridView->ReadOnly = true;
this->会议纪要管理DataGridView->RowHeadersVisible = false;
this->会议纪要管理DataGridView->RowTemplate->Height = 23;
this->会议纪要管理DataGridView->SelectionMode = System::Windows::Forms::DataGridViewSelectionMode::FullRowSelect;
this->会议纪要管理DataGridView->Size = System::Drawing::Size(533, 118);
this->会议纪要管理DataGridView->TabIndex = 51;
//
// 会议纪要管理BindingNavigator
//
this->会议纪要管理BindingNavigator->AddNewItem = this->bindingNavigatorAddNewItem;
this->会议纪要管理BindingNavigator->BindingSource = this->会议纪要管理BindingSource;
this->会议纪要管理BindingNavigator->CountItem = nullptr;
this->会议纪要管理BindingNavigator->DeleteItem = this->bindingNavigatorDeleteItem;
this->会议纪要管理BindingNavigator->Items->AddRange(gcnew cli::array< System::Windows::Forms::ToolStripItem^ >(9) {this->toolStripLabel1,
this->开始日期ToolStripTextBox, this->toolStripLabel2, this->结束日期ToolStripTextBox, this->查询ToolStripButton, this->bindingNavigatorSeparator2,
this->bindingNavigatorAddNewItem, this->bindingNavigatorDeleteItem, this->会议纪要管理BindingNavigatorSaveItem});
this->会议纪要管理BindingNavigator->Location = System::Drawing::Point(0, 0);
this->会议纪要管理BindingNavigator->MoveFirstItem = nullptr;
this->会议纪要管理BindingNavigator->MoveLastItem = nullptr;
this->会议纪要管理BindingNavigator->MoveNextItem = nullptr;
this->会议纪要管理BindingNavigator->MovePreviousItem = nullptr;
this->会议纪要管理BindingNavigator->Name = L"会议纪要管理BindingNavigator";
this->会议纪要管理BindingNavigator->PositionItem = nullptr;
this->会议纪要管理BindingNavigator->Size = System::Drawing::Size(542, 25);
this->会议纪要管理BindingNavigator->TabIndex = 50;
this->会议纪要管理BindingNavigator->Text = L"bindingNavigator1";
//
// bindingNavigatorDeleteItem
//
this->bindingNavigatorDeleteItem->Image = (cli::safe_cast<System::Drawing::Image^ >(resources->GetObject(L"bindingNavigatorDeleteItem.Image")));
this->bindingNavigatorDeleteItem->Name = L"bindingNavigatorDeleteItem";
this->bindingNavigatorDeleteItem->RightToLeftAutoMirrorImage = true;
this->bindingNavigatorDeleteItem->Size = System::Drawing::Size(49, 22);
this->bindingNavigatorDeleteItem->Text = L"删除";
//
// toolStripLabel1
//
this->toolStripLabel1->Name = L"toolStripLabel1";
this->toolStripLabel1->Size = System::Drawing::Size(59, 22);
this->toolStripLabel1->Text = L"开始日期:";
//
// 开始日期ToolStripTextBox
//
this->开始日期ToolStripTextBox->Name = L"开始日期ToolStripTextBox";
this->开始日期ToolStripTextBox->Size = System::Drawing::Size(100, 25);
this->开始日期ToolStripTextBox->Text = L"2000-1-1";
//
// toolStripLabel2
//
this->toolStripLabel2->Name = L"toolStripLabel2";
this->toolStripLabel2->Size = System::Drawing::Size(59, 22);
this->toolStripLabel2->Text = L"结束日期:";
//
// SummaryForm
//
this->AutoScaleDimensions = System::Drawing::SizeF(6, 12);
this->AutoScaleMode = System::Windows::Forms::AutoScaleMode::Font;
this->ClientSize = System::Drawing::Size(542, 416);
this->Controls->Add(this->显示文件Button);
this->Controls->Add(this->选择文件Button);
this->Controls->Add(this->自编号TextBox);
this->Controls->Add(this->类型ComboBox);
this->Controls->Add(this->会次TextBox);
this->Controls->Add(this->会议主题TextBox);
this->Controls->Add(this->会议日期DateTimePicker);
this->Controls->Add(this->开始时间DateTimePicker);
this->Controls->Add(this->结束时间DateTimePicker);
this->Controls->Add(this->会议地点TextBox);
this->Controls->Add(this->主持人TextBox);
this->Controls->Add(this->重要参加人员TextBox);
this->Controls->Add(this->重要缺席人员TextBox);
this->Controls->Add(this->记录人TextBox);
this->Controls->Add(this->出席人数TextBox);
this->Controls->Add(this->存放路径TextBox);
this->Controls->Add(this->说明TextBox);
this->Controls->Add(this->会议内容TextBox);
this->Controls->Add(自编号Label);
this->Controls->Add(类型Label);
this->Controls->Add(会次Label);
this->Controls->Add(会议主题Label);
this->Controls->Add(会议日期Label);
this->Controls->Add(开始时间Label);
this->Controls->Add(结束时间Label);
this->Controls->Add(会议地点Label);
this->Controls->Add(主持人Label);
this->Controls->Add(重要参加人员Label);
this->Controls->Add(重要缺席人员Label);
this->Controls->Add(记录人Label);
this->Controls->Add(出席人数Label);
this->Controls->Add(存放路径Label);
this->Controls->Add(说明Label);
this->Controls->Add(会议内容Label);
this->Controls->Add(this->会议纪要管理DataGridView);
this->Controls->Add(this->会议纪要管理BindingNavigator);
this->Name = L"SummaryForm";
this->StartPosition = System::Windows::Forms::FormStartPosition::CenterParent;
this->Text = L"会议纪要管理";
this->Load += gcnew System::EventHandler(this, &SummaryForm::SummaryForm_Load);
(cli::safe_cast<System::ComponentModel::ISupportInitialize^ >(this->MyOfficeDataSet))->EndInit();
(cli::safe_cast<System::ComponentModel::ISupportInitialize^ >(this->会议纪要管理BindingSource))->EndInit();
(cli::safe_cast<System::ComponentModel::ISupportInitialize^ >(this->会议纪要管理DataGridView))->EndInit();
(cli::safe_cast<System::ComponentModel::ISupportInitialize^ >(this->会议纪要管理BindingNavigator))->EndInit();
this->会议纪要管理BindingNavigator->ResumeLayout(false);
this->会议纪要管理BindingNavigator->PerformLayout();
this->ResumeLayout(false);
this->PerformLayout();
}
#pragma endregion
private: static String^ MyOfficeConnectionString= L"Data Source=.;Initial Catalog=MyOffice;Integrated Security=True;Pooling=False";
private: System::Void 会议纪要管理BindingNavigatorSaveItem_Click(System::Object^ sender, System::EventArgs^ e) {
this->Validate();
this->会议纪要管理BindingSource->EndEdit();
this->会议纪要管理TableAdapter->Update(this->MyOfficeDataSet->会议纪要管理);
}
private: System::Void SummaryForm_Load(System::Object^ sender, System::EventArgs^ e) {
// TODO: 这行代码将数据加载到表“MyOfficeDataSet.会议纪要管理”中。您可以根据需要移动或移除它。
this->会议纪要管理TableAdapter->Fill(this->MyOfficeDataSet->会议纪要管理);
}
private: System::Void 查询ToolStripButton_Click(System::Object^ sender, System::EventArgs^ e) {
try
{
this->会议纪要管理TableAdapter->FillBy(this->MyOfficeDataSet->会议纪要管理, System::Nullable<System::DateTime >((*cli::safe_cast<System::DateTime^>(System::Convert::ChangeType(开始日期ToolStripTextBox->Text,
System::DateTime::typeid)))), System::Nullable<System::DateTime >((*cli::safe_cast<System::DateTime^>(System::Convert::ChangeType(结束日期ToolStripTextBox->Text, System::DateTime::typeid)))));
}
catch (System::Exception^ ex)
{
System::Windows::Forms::MessageBox::Show(ex->Message);
}
}
private: System::Void 选择文件Button_Click(System::Object^ sender, System::EventArgs^ e) {
OpenFileDialog^ MyDlg = gcnew OpenFileDialog();
if (MyDlg->ShowDialog() == System::Windows::Forms::DialogResult::OK)
{
this->存放路径TextBox->Text = MyDlg->FileName;
}
}
private: System::Void 显示文件Button_Click(System::Object^ sender, System::EventArgs^ e) {
System::Diagnostics::Process::Start(this->存放路径TextBox->Text);
}
private: System::Void bindingNavigatorAddNewItem_MouseUp(System::Object^ sender, System::Windows::Forms::MouseEventArgs^ e) {
//自动计算自编号
String^ MySQLConnectionString = MyOfficeConnectionString;
SqlConnection^ MyConnection = gcnew SqlConnection(MySQLConnectionString);
MyConnection->Open();
String^ MySQL = "Select max(自编号) 自编号 From 会议纪要管理";
SqlCommand^ MyCommand = gcnew SqlCommand(MySQL, MyConnection);
System::Object^ MyResult = MyCommand->ExecuteScalar();
System::Int64 MyID = 1;
if (MyResult != System::DBNull::Value)
{
String^ MyMaxID = MyResult->ToString()->Trim();
MyMaxID = MyMaxID->Substring(2, MyMaxID->Length - 2);
MyID = Convert::ToInt64(MyMaxID) + 1;
}
int MyLength = MyID.ToString()->Length;
String^ MyNewID = "";
switch (MyLength)
{
case 1:
MyNewID = "JY0000000" + MyID.ToString();
break;
case 2:
MyNewID = "JY000000" + MyID.ToString();
break;
case 3:
MyNewID = "JY00000" + MyID.ToString();
break;
case 4:
MyNewID = "JY0000" + MyID.ToString();
break;
case 5:
MyNewID = "JY000" + MyID.ToString();
break;
case 6:
MyNewID = "JY00" + MyID.ToString();
break;
case 7:
MyNewID = "JY0" + MyID.ToString();
break;
}
this->自编号TextBox->Text = MyNewID;
}
};
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -