📄 otherpaymentform.h
字号:
//
this->收款金额Label->AutoSize = true;
this->收款金额Label->Location = System::Drawing::Point(140, 37);
this->收款金额Label->Name = L"收款金额Label";
this->收款金额Label->Size = System::Drawing::Size(65, 12);
this->收款金额Label->TabIndex = 101;
this->收款金额Label->Text = L"收款金额:";
//
// 交款人员TextBox
//
this->交款人员TextBox->Anchor = static_cast<System::Windows::Forms::AnchorStyles>(((System::Windows::Forms::AnchorStyles::Top | System::Windows::Forms::AnchorStyles::Left)
| System::Windows::Forms::AnchorStyles::Right));
this->交款人员TextBox->Location = System::Drawing::Point(460, 7);
this->交款人员TextBox->Name = L"交款人员TextBox";
this->交款人员TextBox->Size = System::Drawing::Size(74, 21);
this->交款人员TextBox->TabIndex = 100;
//
// 交款人员Label
//
this->交款人员Label->AutoSize = true;
this->交款人员Label->Location = System::Drawing::Point(397, 12);
this->交款人员Label->Name = L"交款人员Label";
this->交款人员Label->Size = System::Drawing::Size(65, 12);
this->交款人员Label->TabIndex = 99;
this->交款人员Label->Text = L"交款人员:";
//
// 收款日期TextBox
//
this->收款日期TextBox->Location = System::Drawing::Point(71, 32);
this->收款日期TextBox->Name = L"收款日期TextBox";
this->收款日期TextBox->Size = System::Drawing::Size(66, 21);
this->收款日期TextBox->TabIndex = 98;
this->收款日期TextBox->Text = L"2006-6-1";
//
// 收款日期Label
//
this->收款日期Label->AutoSize = true;
this->收款日期Label->Location = System::Drawing::Point(10, 37);
this->收款日期Label->Name = L"收款日期Label";
this->收款日期Label->Size = System::Drawing::Size(65, 12);
this->收款日期Label->TabIndex = 97;
this->收款日期Label->Text = L"收款日期:";
//
// 收据编号TextBox
//
this->收据编号TextBox->Location = System::Drawing::Point(71, 7);
this->收据编号TextBox->Name = L"收据编号TextBox";
this->收据编号TextBox->Size = System::Drawing::Size(322, 21);
this->收据编号TextBox->TabIndex = 96;
//
// 收据编号Label
//
this->收据编号Label->AutoSize = true;
this->收据编号Label->Location = System::Drawing::Point(10, 12);
this->收据编号Label->Name = L"收据编号Label";
this->收据编号Label->Size = System::Drawing::Size(65, 12);
this->收据编号Label->TabIndex = 95;
this->收据编号Label->Text = L"收据编号:";
//
// 保存Button
//
this->保存Button->Anchor = static_cast<System::Windows::Forms::AnchorStyles>((System::Windows::Forms::AnchorStyles::Top | System::Windows::Forms::AnchorStyles::Right));
this->保存Button->Image = (cli::safe_cast<System::Drawing::Image^ >(resources->GetObject(L"保存Button.Image")));
this->保存Button->Location = System::Drawing::Point(451, 54);
this->保存Button->Name = L"保存Button";
this->保存Button->Size = System::Drawing::Size(80, 23);
this->保存Button->TabIndex = 113;
this->保存Button->Text = L"保存";
this->保存Button->TextAlign = System::Drawing::ContentAlignment::MiddleRight;
this->保存Button->TextImageRelation = System::Windows::Forms::TextImageRelation::ImageBeforeText;
this->保存Button->UseVisualStyleBackColor = true;
this->保存Button->Click += gcnew System::EventHandler(this, &OtherPaymentForm::保存Button_Click);
//
// 打印Button
//
this->打印Button->Anchor = static_cast<System::Windows::Forms::AnchorStyles>((System::Windows::Forms::AnchorStyles::Top | System::Windows::Forms::AnchorStyles::Right));
this->打印Button->Image = (cli::safe_cast<System::Drawing::Image^ >(resources->GetObject(L"打印Button.Image")));
this->打印Button->Location = System::Drawing::Point(365, 54);
this->打印Button->Name = L"打印Button";
this->打印Button->Size = System::Drawing::Size(80, 23);
this->打印Button->TabIndex = 112;
this->打印Button->Text = L"打印";
this->打印Button->TextAlign = System::Drawing::ContentAlignment::MiddleRight;
this->打印Button->TextImageRelation = System::Windows::Forms::TextImageRelation::ImageBeforeText;
this->打印Button->UseVisualStyleBackColor = true;
this->打印Button->Click += gcnew System::EventHandler(this, &OtherPaymentForm::打印Button_Click);
//
// 新增Button
//
this->新增Button->Anchor = static_cast<System::Windows::Forms::AnchorStyles>((System::Windows::Forms::AnchorStyles::Top | System::Windows::Forms::AnchorStyles::Right));
this->新增Button->Image = (cli::safe_cast<System::Drawing::Image^ >(resources->GetObject(L"新增Button.Image")));
this->新增Button->Location = System::Drawing::Point(279, 54);
this->新增Button->Name = L"新增Button";
this->新增Button->Size = System::Drawing::Size(80, 23);
this->新增Button->TabIndex = 111;
this->新增Button->Text = L"新增";
this->新增Button->TextAlign = System::Drawing::ContentAlignment::MiddleRight;
this->新增Button->TextImageRelation = System::Windows::Forms::TextImageRelation::ImageBeforeText;
this->新增Button->UseVisualStyleBackColor = true;
this->新增Button->Click += gcnew System::EventHandler(this, &OtherPaymentForm::新增Button_Click);
//
// OtherPaymentForm
//
this->AutoScaleDimensions = System::Drawing::SizeF(6, 12);
this->AutoScaleMode = System::Windows::Forms::AutoScaleMode::Font;
this->ClientSize = System::Drawing::Size(542, 176);
this->Controls->Add(this->补充说明TextBox);
this->Controls->Add(this->补充说明Label);
this->Controls->Add(this->收款事由TextBox);
this->Controls->Add(this->收款事由Label);
this->Controls->Add(this->收款形式TextBox);
this->Controls->Add(this->收款形式Label);
this->Controls->Add(this->收款人员Label);
this->Controls->Add(this->收款人员TextBox);
this->Controls->Add(this->收款金额TextBox);
this->Controls->Add(this->收款金额Label);
this->Controls->Add(this->交款人员TextBox);
this->Controls->Add(this->交款人员Label);
this->Controls->Add(this->收款日期TextBox);
this->Controls->Add(this->收款日期Label);
this->Controls->Add(this->收据编号TextBox);
this->Controls->Add(this->收据编号Label);
this->Controls->Add(this->保存Button);
this->Controls->Add(this->打印Button);
this->Controls->Add(this->新增Button);
this->Name = L"OtherPaymentForm";
this->ShowInTaskbar = false;
this->StartPosition = System::Windows::Forms::FormStartPosition::CenterParent;
this->Text = L"费用管理[其他费用交纳]";
this->ResumeLayout(false);
this->PerformLayout();
}
#pragma endregion
public: String^ MyCommunity;
public: String^ MyOperator;
public:String^ MySQLConnectionString;
private: System::Void 新增Button_Click(System::Object^ sender, System::EventArgs^ e)
{//新增其他费用信息
this->收据编号TextBox->Text = System::Guid::NewGuid().ToString()->ToUpper();
this->收款日期TextBox->Text = DateTime::Now.ToShortDateString();
this->收款人员TextBox->Text = this->MyOperator;
}
private: System::Void 打印Button_Click(System::Object^ sender, System::EventArgs^ e)
{//打印其他费用交款收据
this->printPreviewDialog1->Document = this->printDocument1;
this->printPreviewDialog1->ShowDialog();
}
private: System::Void printDocument1_PrintPage(System::Object^ sender, System::Drawing::Printing::PrintPageEventArgs^ e)
{
e->Graphics->DrawString(this->MyCommunity + "物业管理服务收费收据", gcnew System::Drawing::Font("宋体", 20), Brushes::Black, 150, 90);
e->Graphics->DrawString("收据编号:" + this->收据编号TextBox->Text, gcnew System::Drawing::Font("宋体", 10), Brushes::Black, 100, 145);
e->Graphics->DrawString("收款日期:" + this->收款日期TextBox->Text, gcnew System::Drawing::Font("宋体", 10), Brushes::Black, 550, 145);
e->Graphics->DrawLine(gcnew Pen(Color::Black, (float)3.00), 100, 165, 720, 165);
e->Graphics->DrawString("交款人员:" + this->交款人员TextBox->Text, gcnew System::Drawing::Font("宋体", 10), Brushes::Black, 100, 175);
e->Graphics->DrawString("收款金额:" + this->收款金额TextBox->Text + "元", gcnew System::Drawing::Font("宋体", 10), Brushes::Black, 300, 175);
e->Graphics->DrawString("收款形式:" + this->收款形式TextBox->Text, gcnew System::Drawing::Font("宋体", 10), Brushes::Black, 500, 175);
e->Graphics->DrawLine(gcnew Pen(Color::Black), 100, 195, 720, 195);
e->Graphics->DrawString("收款事由:", gcnew System::Drawing::Font("宋体", 10), Brushes::Black, 100, 200);
e->Graphics->DrawString(this->收款事由TextBox->Text, gcnew System::Drawing::Font("宋体", 10), Brushes::Black, RectangleF(110, 220, 620, 110));
e->Graphics->DrawLine(gcnew Pen(Color::Black), 100, 335, 720, 335);
e->Graphics->DrawString("补充说明:" +this->补充说明TextBox->Text, gcnew System::Drawing::Font("宋体", 10), Brushes::Black, 100, 340);
e->Graphics->DrawLine(gcnew Pen(Color::Black, (float)3.00), 100, 360, 720, 360);
e->Graphics->DrawString("收款人员:" + this->收款人员TextBox->Text, gcnew System::Drawing::Font("宋体", 10), Brushes::Black, 100, 365);
}
private: System::Void 保存Button_Click(System::Object^ sender, System::EventArgs^ e)
{//保存其他收费信息
if (this->收据编号TextBox->Text->Length < 1 || this->交款人员TextBox->Text->Length < 1 || this->收款人员TextBox->Text->Length < 1|| this->收款日期TextBox->Text->Length < 1 || this->收款形式TextBox->Text->Length < 1)
{
return;
}
String^ MySaveInfo = "现在将保存业主交纳的物业管理服务收费信息,是否继续?";
if (MessageBox::Show(MySaveInfo, "信息提示", MessageBoxButtons::YesNo, MessageBoxIcon::Question) == System::Windows::Forms::DialogResult::No)
{
return;
}
SqlConnection^ MyConnection = gcnew SqlConnection(MySQLConnectionString);
MyConnection->Open();
SqlCommand^ MyCommand = MyConnection->CreateCommand();
String^ MySQL = "INSERT INTO 费用收据(收据编号,收款日期,交款人员,收款金额,收款形式,收款人员,收款事由,补充说明) VALUES('";
MySQL += this->收据编号TextBox->Text + "','";
MySQL += this->收款日期TextBox->Text + "','";
MySQL += this->交款人员TextBox->Text + "',";
MySQL += this->收款金额TextBox->Text + ",'";
MySQL += this->收款形式TextBox->Text + "','";
MySQL += this->收款人员TextBox->Text + "','";
MySQL += this->收款事由TextBox->Text + "','";
MySQL += this->补充说明TextBox->Text + "');";
MyCommand->CommandText = MySQL;
MyCommand->ExecuteNonQuery();
if (MyConnection->State == ConnectionState::Open)
{
MyConnection->Close();
}
this->收据编号TextBox->Text="";
this->收款日期TextBox->Text="";
this->交款人员TextBox->Text="";
this->收款金额TextBox->Text="";
this->收款形式TextBox->Text="";
this->收款人员TextBox->Text="";
}
};
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -