📄 hotelleaves.h
字号:
#pragma once
#include "LinkDataBase.h"
#include "DataGridNoActiveCellColumn.h"
#include "SelectArrival.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 My
{
/// <summary>
/// HotelLeaves 摘要
///
/// 警告: 如果您更改该类的名称,则将需要更改
/// 与该类所依赖的所有 .resx 文件关联的托管资源编译器工具的
/// “资源文件名”属性。 否则,
/// 设计器将不能与此窗体关联的
/// 本地化资源正确交互。
/// </summary>
public __gc class HotelLeaves : public System::Windows::Forms::Form
{
//--------------------成员声明------------------------
private:
LinkDataBase* MyDataBase; //数据库连接类
SqlDataAdapter* ConsumeAdapter;
SqlDataAdapter* RoomAdapter;
DataView* ConsumeView;
DataSet* ds;
String* strTableName;
String* strSQL;
CurrencyManager* cmRoom;
//-------------------成员声明结束-----------------------
public:
HotelLeaves(void)
{
InitializeComponent();
//初始化
this->MyDataBase = new LinkDataBase();
this->ds = new DataSet();
this->ConsumeAdapter = new SqlDataAdapter();
this->ConsumeView = new DataView();
//查询帐单明细
this->strSQL = S"Select * from 帐单明细";
this->strTableName = S"帐单明细";
this->MyDataBase->SelectDataBase(this->ConsumeAdapter,this->ds,this->strSQL,this->strTableName);
this->ConsumeView->Table = this->ds->Tables->Item[S"帐单明细"];
//查询帐单明细
this->strSQL = S"Select * from 入住单";
this->strTableName = S"入住单";
this->MyDataBase->SelectDataBase(this->ConsumeAdapter,this->ds,this->strSQL,this->strTableName);
this->dgrdRoom->DataSource = this->ds->Tables->Item[S"入住单"];
this->cmRoom = __try_cast<CurrencyManager*>(this->BindingContext->Item[this->ds->Tables->Item[S"入住单"]]);
this->tBoxMoney->DataBindings->Add(S"Text",this->ds->Tables->Item[S"入住单"],S"结帐金额");
//设置DataGrid
this->dgrdConsume->DataSource = this->ConsumeView;
this->DataGridStateControl();
}
protected:
void Dispose(Boolean disposing)
{
if (disposing && components)
{
components->Dispose();
}
__super::Dispose(disposing);
}
private: System::Windows::Forms::ToolBar * toolBar1;
private: System::Windows::Forms::ToolBarButton * tBtnFirstRecord;
private: System::Windows::Forms::ToolBarButton * tBtnNextRecord;
private: System::Windows::Forms::ToolBarButton * tBtnPreviousRecord;
private: System::Windows::Forms::ToolBarButton * tBtnLastRecord;
private: System::Windows::Forms::ToolBarButton * tBtnQuit;
private: System::Windows::Forms::GroupBox * groupBox1;
private: System::Windows::Forms::Button * btnSearch;
private: System::Windows::Forms::Label * label1;
private: System::Windows::Forms::Label * label2;
private: System::Windows::Forms::GroupBox * groupBox2;
private: System::Windows::Forms::Label * label6;
private: System::Windows::Forms::Label * label12;
protected: System::Windows::Forms::ImageList * imageList1;
private: System::Windows::Forms::Button * btnCalculate;
private: System::Windows::Forms::Button * btnPay;
private: System::Windows::Forms::ComboBox * cmbPayment;
private: System::Windows::Forms::TextBox * tBoxRoomID;
private: System::Windows::Forms::DataGrid * dgrdRoom;
private: System::Windows::Forms::TextBox * tBoxArrivalID;
private: System::Windows::Forms::DataGrid * dgrdConsume;
private: System::Windows::Forms::TextBox * tBoxMoney;
private: System::ComponentModel::IContainer * components;
private:
/// <summary>
/// 必需的设计器变量。
/// </summary>
/// <summary>
/// 设计器支持所需的方法 - 不要使用代码编辑器修改
/// 此方法的内容。
/// </summary>
void InitializeComponent(void)
{
this->components = new System::ComponentModel::Container();
System::Resources::ResourceManager * resources = new System::Resources::ResourceManager(__typeof(My::HotelLeaves));
this->toolBar1 = new System::Windows::Forms::ToolBar();
this->tBtnFirstRecord = new System::Windows::Forms::ToolBarButton();
this->tBtnNextRecord = new System::Windows::Forms::ToolBarButton();
this->tBtnPreviousRecord = new System::Windows::Forms::ToolBarButton();
this->tBtnLastRecord = new System::Windows::Forms::ToolBarButton();
this->tBtnQuit = new System::Windows::Forms::ToolBarButton();
this->imageList1 = new System::Windows::Forms::ImageList(this->components);
this->groupBox1 = new System::Windows::Forms::GroupBox();
this->tBoxRoomID = new System::Windows::Forms::TextBox();
this->label2 = new System::Windows::Forms::Label();
this->tBoxArrivalID = new System::Windows::Forms::TextBox();
this->label1 = new System::Windows::Forms::Label();
this->btnSearch = new System::Windows::Forms::Button();
this->dgrdConsume = new System::Windows::Forms::DataGrid();
this->groupBox2 = new System::Windows::Forms::GroupBox();
this->btnPay = new System::Windows::Forms::Button();
this->btnCalculate = new System::Windows::Forms::Button();
this->cmbPayment = new System::Windows::Forms::ComboBox();
this->tBoxMoney = new System::Windows::Forms::TextBox();
this->label12 = new System::Windows::Forms::Label();
this->label6 = new System::Windows::Forms::Label();
this->dgrdRoom = new System::Windows::Forms::DataGrid();
this->groupBox1->SuspendLayout();
(__try_cast<System::ComponentModel::ISupportInitialize * >(this->dgrdConsume))->BeginInit();
this->groupBox2->SuspendLayout();
(__try_cast<System::ComponentModel::ISupportInitialize * >(this->dgrdRoom))->BeginInit();
this->SuspendLayout();
//
// toolBar1
//
System::Windows::Forms::ToolBarButton* __mcTemp__1[] = new System::Windows::Forms::ToolBarButton*[5];
__mcTemp__1[0] = this->tBtnFirstRecord;
__mcTemp__1[1] = this->tBtnNextRecord;
__mcTemp__1[2] = this->tBtnPreviousRecord;
__mcTemp__1[3] = this->tBtnLastRecord;
__mcTemp__1[4] = this->tBtnQuit;
this->toolBar1->Buttons->AddRange(__mcTemp__1);
this->toolBar1->DropDownArrows = true;
this->toolBar1->ImageList = this->imageList1;
this->toolBar1->Location = System::Drawing::Point(0, 0);
this->toolBar1->Name = S"toolBar1";
this->toolBar1->ShowToolTips = true;
this->toolBar1->Size = System::Drawing::Size(760, 41);
this->toolBar1->TabIndex = 0;
this->toolBar1->ButtonClick += new System::Windows::Forms::ToolBarButtonClickEventHandler(this, toolBar1_ButtonClick);
//
// tBtnFirstRecord
//
this->tBtnFirstRecord->ImageIndex = 5;
this->tBtnFirstRecord->Text = S"首记录";
this->tBtnFirstRecord->ToolTipText = S"首记录";
//
// tBtnNextRecord
//
this->tBtnNextRecord->ImageIndex = 8;
this->tBtnNextRecord->Text = S"上一记录";
this->tBtnNextRecord->ToolTipText = S"上一记录";
//
// tBtnPreviousRecord
//
this->tBtnPreviousRecord->ImageIndex = 4;
this->tBtnPreviousRecord->Text = S"下一记录";
this->tBtnPreviousRecord->ToolTipText = S"下一记录";
//
// tBtnLastRecord
//
this->tBtnLastRecord->ImageIndex = 7;
this->tBtnLastRecord->Text = S"尾记录";
this->tBtnLastRecord->ToolTipText = S"尾记录";
//
// tBtnQuit
//
this->tBtnQuit->ImageIndex = 11;
this->tBtnQuit->Text = S"退出";
this->tBtnQuit->ToolTipText = S"退出";
//
// imageList1
//
this->imageList1->ImageSize = System::Drawing::Size(16, 16);
this->imageList1->ImageStream = (__try_cast<System::Windows::Forms::ImageListStreamer * >(resources->GetObject(S"imageList1.ImageStream")));
this->imageList1->TransparentColor = System::Drawing::Color::Transparent;
//
// groupBox1
//
this->groupBox1->Controls->Add(this->tBoxRoomID);
this->groupBox1->Controls->Add(this->label2);
this->groupBox1->Controls->Add(this->tBoxArrivalID);
this->groupBox1->Controls->Add(this->label1);
this->groupBox1->Controls->Add(this->btnSearch);
this->groupBox1->Dock = System::Windows::Forms::DockStyle::Top;
this->groupBox1->Location = System::Drawing::Point(0, 41);
this->groupBox1->Name = S"groupBox1";
this->groupBox1->Size = System::Drawing::Size(760, 79);
this->groupBox1->TabIndex = 1;
this->groupBox1->TabStop = false;
//
// tBoxRoomID
//
this->tBoxRoomID->Location = System::Drawing::Point(408, 39);
this->tBoxRoomID->Name = S"tBoxRoomID";
this->tBoxRoomID->Size = System::Drawing::Size(120, 21);
this->tBoxRoomID->TabIndex = 4;
this->tBoxRoomID->Text = S"";
//
// label2
//
this->label2->Location = System::Drawing::Point(344, 44);
this->label2->Name = S"label2";
this->label2->Size = System::Drawing::Size(56, 11);
this->label2->TabIndex = 3;
this->label2->Text = S"住房编号";
//
// tBoxArrivalID
//
this->tBoxArrivalID->Location = System::Drawing::Point(208, 40);
this->tBoxArrivalID->Name = S"tBoxArrivalID";
this->tBoxArrivalID->Size = System::Drawing::Size(120, 21);
this->tBoxArrivalID->TabIndex = 2;
this->tBoxArrivalID->Text = S"";
//
// label1
//
this->label1->Location = System::Drawing::Point(144, 45);
this->label1->Name = S"label1";
this->label1->Size = System::Drawing::Size(56, 11);
this->label1->TabIndex = 1;
this->label1->Text = S"入住单号";
//
// btnSearch
//
this->btnSearch->ImageAlign = System::Drawing::ContentAlignment::MiddleLeft;
this->btnSearch->ImageIndex = 6;
this->btnSearch->ImageList = this->imageList1;
this->btnSearch->Location = System::Drawing::Point(64, 40);
this->btnSearch->Name = S"btnSearch";
this->btnSearch->Size = System::Drawing::Size(56, 24);
this->btnSearch->TabIndex = 0;
this->btnSearch->Text = S"搜索";
this->btnSearch->TextAlign = System::Drawing::ContentAlignment::MiddleRight;
this->btnSearch->Click += new System::EventHandler(this, btnSearch_Click);
//
// dgrdConsume
//
this->dgrdConsume->DataMember = S"";
this->dgrdConsume->Dock = System::Windows::Forms::DockStyle::Bottom;
this->dgrdConsume->HeaderForeColor = System::Drawing::SystemColors::ControlText;
this->dgrdConsume->Location = System::Drawing::Point(0, 189);
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -