📄 consumeform.h
字号:
this->label5->Location = System::Drawing::Point(431, 178);
this->label5->Name = L"label5";
this->label5->Size = System::Drawing::Size(41, 12);
this->label5->TabIndex = 27;
this->label5->Text = L"数量:";
//
// label4
//
this->label4->AutoSize = true;
this->label4->Location = System::Drawing::Point(293, 178);
this->label4->Name = L"label4";
this->label4->Size = System::Drawing::Size(65, 12);
this->label4->TabIndex = 25;
this->label4->Text = L"折扣价格:";
//
// printDocument1
//
this->printDocument1->PrintPage += gcnew System::Drawing::Printing::PrintPageEventHandler(this, &ConsumeForm::printDocument1_PrintPage);
//
// printPreviewDialog1
//
this->printPreviewDialog1->AutoScrollMargin = System::Drawing::Size(0, 0);
this->printPreviewDialog1->AutoScrollMinSize = System::Drawing::Size(0, 0);
this->printPreviewDialog1->ClientSize = System::Drawing::Size(400, 300);
this->printPreviewDialog1->Enabled = true;
this->printPreviewDialog1->Icon = (cli::safe_cast<System::Drawing::Icon^ >(resources->GetObject(L"printPreviewDialog1.Icon")));
this->printPreviewDialog1->Name = L"printPreviewDialog1";
this->printPreviewDialog1->Visible = false;
//
// 折扣价格TextBox
//
this->折扣价格TextBox->Location = System::Drawing::Point(369, 173);
this->折扣价格TextBox->Name = L"折扣价格TextBox";
this->折扣价格TextBox->Size = System::Drawing::Size(51, 21);
this->折扣价格TextBox->TabIndex = 26;
//
// 消费品名称TextBox
//
this->消费品名称TextBox->Location = System::Drawing::Point(94, 173);
this->消费品名称TextBox->Name = L"消费品名称TextBox";
this->消费品名称TextBox->ReadOnly = true;
this->消费品名称TextBox->Size = System::Drawing::Size(76, 21);
this->消费品名称TextBox->TabIndex = 24;
//
// label3
//
this->label3->AutoSize = true;
this->label3->Location = System::Drawing::Point(6, 178);
this->label3->Name = L"label3";
this->label3->Size = System::Drawing::Size(77, 12);
this->label3->TabIndex = 23;
this->label3->Text = L"消费品名称:";
//
// 酒店房号ComboBox
//
this->酒店房号ComboBox->DropDownStyle = System::Windows::Forms::ComboBoxStyle::DropDownList;
this->酒店房号ComboBox->FormattingEnabled = true;
this->酒店房号ComboBox->Location = System::Drawing::Point(73, 5);
this->酒店房号ComboBox->Name = L"酒店房号ComboBox";
this->酒店房号ComboBox->Size = System::Drawing::Size(87, 20);
this->酒店房号ComboBox->TabIndex = 22;
this->酒店房号ComboBox->SelectedIndexChanged += gcnew System::EventHandler(this, &ConsumeForm::酒店房号ComboBox_SelectedIndexChanged);
//
// 旅客姓名ComboBox
//
this->旅客姓名ComboBox->DropDownStyle = System::Windows::Forms::ComboBoxStyle::DropDownList;
this->旅客姓名ComboBox->FormattingEnabled = true;
this->旅客姓名ComboBox->Location = System::Drawing::Point(233, 5);
this->旅客姓名ComboBox->Name = L"旅客姓名ComboBox";
this->旅客姓名ComboBox->Size = System::Drawing::Size(89, 20);
this->旅客姓名ComboBox->TabIndex = 21;
this->旅客姓名ComboBox->SelectedIndexChanged += gcnew System::EventHandler(this, &ConsumeForm::旅客姓名ComboBox_SelectedIndexChanged);
//
// label2
//
this->label2->AutoSize = true;
this->label2->Location = System::Drawing::Point(164, 10);
this->label2->Name = L"label2";
this->label2->Size = System::Drawing::Size(65, 12);
this->label2->TabIndex = 20;
this->label2->Text = L"旅客姓名:";
//
// label1
//
this->label1->AutoSize = true;
this->label1->Location = System::Drawing::Point(4, 10);
this->label1->Name = L"label1";
this->label1->Size = System::Drawing::Size(65, 12);
this->label1->TabIndex = 19;
this->label1->Text = L"酒店房号:";
//
// groupBox1
//
this->groupBox1->Controls->Add(this->消费品价格DataGridView);
this->groupBox1->Location = System::Drawing::Point(4, 31);
this->groupBox1->Name = L"groupBox1";
this->groupBox1->Size = System::Drawing::Size(533, 136);
this->groupBox1->TabIndex = 18;
this->groupBox1->TabStop = false;
this->groupBox1->Text = L"酒店常用消费品价格信息";
//
// 消费品价格DataGridView
//
this->消费品价格DataGridView->BackgroundColor = System::Drawing::SystemColors::Highlight;
this->消费品价格DataGridView->ColumnHeadersHeightSizeMode = System::Windows::Forms::DataGridViewColumnHeadersHeightSizeMode::AutoSize;
this->消费品价格DataGridView->GridColor = 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->消费品价格DataGridView->Location = System::Drawing::Point(8, 18);
this->消费品价格DataGridView->Name = L"消费品价格DataGridView";
this->消费品价格DataGridView->ReadOnly = true;
this->消费品价格DataGridView->RowHeadersVisible = false;
dataGridViewCellStyle2->BackColor = System::Drawing::Color::Green;
dataGridViewCellStyle2->ForeColor = System::Drawing::Color::Yellow;
this->消费品价格DataGridView->RowsDefaultCellStyle = dataGridViewCellStyle2;
this->消费品价格DataGridView->RowTemplate->Height = 23;
this->消费品价格DataGridView->SelectionMode = System::Windows::Forms::DataGridViewSelectionMode::FullRowSelect;
this->消费品价格DataGridView->Size = System::Drawing::Size(519, 110);
this->消费品价格DataGridView->TabIndex = 0;
this->消费品价格DataGridView->Click += gcnew System::EventHandler(this, &ConsumeForm::消费品价格DataGridView_Click);
//
// ConsumeForm
//
this->AutoScaleDimensions = System::Drawing::SizeF(6, 12);
this->AutoScaleMode = System::Windows::Forms::AutoScaleMode::Font;
this->BackColor = System::Drawing::Color::FromArgb(static_cast<System::Int32>(static_cast<System::Byte>(0)), static_cast<System::Int32>(static_cast<System::Byte>(192)),
static_cast<System::Int32>(static_cast<System::Byte>(192)));
this->ClientSize = System::Drawing::Size(542, 416);
this->Controls->Add(this->旅客消费表DataGridView);
this->Controls->Add(this->保存Button);
this->Controls->Add(this->打印Button);
this->Controls->Add(this->单价TextBox);
this->Controls->Add(this->label6);
this->Controls->Add(this->添加Button);
this->Controls->Add(this->数量TextBox);
this->Controls->Add(this->label5);
this->Controls->Add(this->label4);
this->Controls->Add(this->折扣价格TextBox);
this->Controls->Add(this->消费品名称TextBox);
this->Controls->Add(this->label3);
this->Controls->Add(this->酒店房号ComboBox);
this->Controls->Add(this->旅客姓名ComboBox);
this->Controls->Add(this->label2);
this->Controls->Add(this->label1);
this->Controls->Add(this->groupBox1);
this->FormBorderStyle = System::Windows::Forms::FormBorderStyle::Fixed3D;
this->MaximizeBox = false;
this->MinimizeBox = false;
this->Name = L"ConsumeForm";
this->StartPosition = System::Windows::Forms::FormStartPosition::CenterParent;
this->Text = L"登记旅客消费信息";
this->Load += gcnew System::EventHandler(this, &ConsumeForm::ConsumeForm_Load);
(cli::safe_cast<System::ComponentModel::ISupportInitialize^ >(this->旅客消费表DataGridView))->EndInit();
this->groupBox1->ResumeLayout(false);
(cli::safe_cast<System::ComponentModel::ISupportInitialize^ >(this->消费品价格DataGridView))->EndInit();
this->ResumeLayout(false);
this->PerformLayout();
}
#pragma endregion
private: String^ My消费编号;
private: String^ My入住编号;
public: String^ MyOperator;
public: String^ MyCompany;
private: DateTime^ MyDate;
private: int MyID;
private:static DataTable^ MyConsumeTable = gcnew DataTable();
private: static String^ MyHotelConnectionString= L"Data Source=.;Initial Catalog=MyHotel;Integrated Security=True;Pooling=False";
private: String^ GetNewID()
{
//自动计算消费编号
String^ MySQLConnectionString = MyHotelConnectionString;
SqlConnection^ MyConnection = gcnew SqlConnection(MySQLConnectionString);
MyConnection->Open();
SqlCommand^ MyCommand = MyConnection->CreateCommand();
MyCommand->CommandText = "Select max(自编号) 最大编号 From 消费入帐";
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 = "XF0000000" + MyID.ToString();
break;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -