📄 dispatchform.h
字号:
// 里程数Label
//
里程数Label->AutoSize = true;
里程数Label->Location = System::Drawing::Point(2, 78);
里程数Label->Name = L"里程数Label";
里程数Label->Size = System::Drawing::Size(47, 12);
里程数Label->TabIndex = 35;
里程数Label->Text = L"里程数:";
//
// 开始日期Label
//
开始日期Label->AutoSize = true;
开始日期Label->Location = System::Drawing::Point(122, 78);
开始日期Label->Name = L"开始日期Label";
开始日期Label->Size = System::Drawing::Size(59, 12);
开始日期Label->TabIndex = 37;
开始日期Label->Text = L"开始日期:";
//
// 结束日期Label
//
结束日期Label->AutoSize = true;
结束日期Label->Location = System::Drawing::Point(328, 78);
结束日期Label->Name = L"结束日期Label";
结束日期Label->Size = System::Drawing::Size(59, 12);
结束日期Label->TabIndex = 39;
结束日期Label->Text = L"结束日期:";
//
// 说明Label
//
说明Label->AutoSize = true;
说明Label->Location = System::Drawing::Point(2, 103);
说明Label->Name = L"说明Label";
说明Label->Size = System::Drawing::Size(35, 12);
说明Label->TabIndex = 41;
说明Label->Text = L"说明:";
//
// dataGridViewTextBoxColumn6
//
this->dataGridViewTextBoxColumn6->DataPropertyName = L"目的地";
this->dataGridViewTextBoxColumn6->HeaderText = L"目的地";
this->dataGridViewTextBoxColumn6->Name = L"dataGridViewTextBoxColumn6";
this->dataGridViewTextBoxColumn6->ReadOnly = true;
//
// dataGridViewTextBoxColumn5
//
this->dataGridViewTextBoxColumn5->DataPropertyName = L"使用部门";
this->dataGridViewTextBoxColumn5->HeaderText = L"使用部门";
this->dataGridViewTextBoxColumn5->Name = L"dataGridViewTextBoxColumn5";
this->dataGridViewTextBoxColumn5->ReadOnly = true;
//
// dataGridViewTextBoxColumn7
//
this->dataGridViewTextBoxColumn7->DataPropertyName = L"里程数";
this->dataGridViewTextBoxColumn7->HeaderText = L"里程数";
this->dataGridViewTextBoxColumn7->Name = L"dataGridViewTextBoxColumn7";
this->dataGridViewTextBoxColumn7->ReadOnly = true;
//
// dataGridViewTextBoxColumn9
//
this->dataGridViewTextBoxColumn9->DataPropertyName = L"结束日期";
this->dataGridViewTextBoxColumn9->HeaderText = L"结束日期";
this->dataGridViewTextBoxColumn9->Name = L"dataGridViewTextBoxColumn9";
this->dataGridViewTextBoxColumn9->ReadOnly = true;
//
// dataGridViewTextBoxColumn8
//
this->dataGridViewTextBoxColumn8->DataPropertyName = L"开始日期";
this->dataGridViewTextBoxColumn8->HeaderText = L"开始日期";
this->dataGridViewTextBoxColumn8->Name = L"dataGridViewTextBoxColumn8";
this->dataGridViewTextBoxColumn8->ReadOnly = true;
//
// dataGridViewTextBoxColumn1
//
this->dataGridViewTextBoxColumn1->DataPropertyName = L"自编号";
this->dataGridViewTextBoxColumn1->HeaderText = L"自编号";
this->dataGridViewTextBoxColumn1->Name = L"dataGridViewTextBoxColumn1";
this->dataGridViewTextBoxColumn1->ReadOnly = true;
//
// 出车使用管理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::Top | 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^ >(10) {this->dataGridViewTextBoxColumn1,
this->dataGridViewTextBoxColumn2, this->dataGridViewTextBoxColumn3, this->dataGridViewTextBoxColumn4, this->dataGridViewTextBoxColumn5,
this->dataGridViewTextBoxColumn6, this->dataGridViewTextBoxColumn7, this->dataGridViewTextBoxColumn8, this->dataGridViewTextBoxColumn9,
this->dataGridViewTextBoxColumn10});
this->出车使用管理DataGridView->DataSource = this->出车使用管理BindingSource;
this->出车使用管理DataGridView->Location = System::Drawing::Point(4, 127);
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(555, 312);
this->出车使用管理DataGridView->TabIndex = 24;
//
// dataGridViewTextBoxColumn2
//
this->dataGridViewTextBoxColumn2->DataPropertyName = L"车牌号";
this->dataGridViewTextBoxColumn2->HeaderText = L"车牌号";
this->dataGridViewTextBoxColumn2->Name = L"dataGridViewTextBoxColumn2";
this->dataGridViewTextBoxColumn2->ReadOnly = true;
//
// dataGridViewTextBoxColumn3
//
this->dataGridViewTextBoxColumn3->DataPropertyName = L"驾驶员";
this->dataGridViewTextBoxColumn3->HeaderText = L"驾驶员";
this->dataGridViewTextBoxColumn3->Name = L"dataGridViewTextBoxColumn3";
this->dataGridViewTextBoxColumn3->ReadOnly = true;
//
// dataGridViewTextBoxColumn4
//
this->dataGridViewTextBoxColumn4->DataPropertyName = L"事由";
this->dataGridViewTextBoxColumn4->HeaderText = L"事由";
this->dataGridViewTextBoxColumn4->Name = L"dataGridViewTextBoxColumn4";
this->dataGridViewTextBoxColumn4->ReadOnly = true;
//
// DispatchForm
//
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->车牌号ComboBox);
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->开始日期DateTimePicker);
this->Controls->Add(this->结束日期DateTimePicker);
this->Controls->Add(this->自编号TextBox);
this->Controls->Add(this->说明TextBox);
this->Controls->Add(this->出车使用管理BindingNavigator);
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->Name = L"DispatchForm";
this->StartPosition = System::Windows::Forms::FormStartPosition::CenterParent;
this->Text = L"出车使用管理";
this->Load += gcnew System::EventHandler(this, &DispatchForm::DispatchForm_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->出车使用管理BindingNavigator))->EndInit();
this->出车使用管理BindingNavigator->ResumeLayout(false);
this->出车使用管理BindingNavigator->PerformLayout();
(cli::safe_cast<System::ComponentModel::ISupportInitialize^ >(this->出车使用管理DataGridView))->EndInit();
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 DispatchForm_Load(System::Object^ sender, System::EventArgs^ e) {
// TODO: 这行代码将数据加载到表“MyOfficeDataSet.出车使用管理”中。您可以根据需要移动或移除它。
this->出车使用管理TableAdapter->Fill(this->MyOfficeDataSet->出车使用管理);
String^ MySQLConnectionString = MyOfficeConnectionString;
SqlConnection^ MyConnection = gcnew SqlConnection(MySQLConnectionString);
MyConnection->Open();
System::Data::DataTable^ MyQueryTable = gcnew System::Data::DataTable();
String^ MySQL = "SELECT 车牌号 FROM 车辆登记管理";
SqlDataAdapter^ MyAdapter = gcnew SqlDataAdapter(MySQL, MyConnection);
MyAdapter->Fill(MyQueryTable);
this->车牌号ComboBox->DataSource = MyQueryTable;
this->车牌号ComboBox->DisplayMember = "车牌号";
this->车牌号ComboBox->ValueMember = "车牌号";
if (MyConnection->State == ConnectionState::Open)
{
MyConnection->Close();
}
}
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);
}
}
};
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -