📄 checkinform.cs
字号:
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
namespace HotelManage
{
/// <summary>
/// ClientCheck 的摘要说明。
/// </summary>
public class CheckInForm : System.Windows.Forms.Form
{
private System.Windows.Forms.Label label5;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.ComboBox comboBox1;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.Button btnSave;
private System.Windows.Forms.Button btnExit;
private System.Windows.Forms.TextBox textTotalMoney;
private float TotalMoney;
public float FactTotalMoney;
private System.Windows.Forms.GroupBox groupBox1;
private System.Windows.Forms.TextBox textRealMoney;
/// <summary>
/// 必需的设计器变量。
/// </summary>
private System.ComponentModel.Container components = null;
public CheckInForm(float totalmoney)
{
//
// Windows 窗体设计器支持所必需的
//
InitializeComponent();
this.textTotalMoney.Text=Convert.ToString(totalmoney);
this.TotalMoney=totalmoney;
this.FactTotalMoney=this.TotalMoney;
//
// TODO: 在 InitializeComponent 调用后添加任何构造函数代码
//
}
/// <summary>
/// 清理所有正在使用的资源。
/// </summary>
protected override void Dispose( bool disposing )
{
if( disposing )
{
if(components != null)
{
components.Dispose();
}
}
base.Dispose( disposing );
}
#region Windows 窗体设计器生成的代码
/// <summary>
/// 设计器支持所需的方法 - 不要使用代码编辑器修改
/// 此方法的内容。
/// </summary>
private void InitializeComponent()
{
this.textTotalMoney = new System.Windows.Forms.TextBox();
this.label5 = new System.Windows.Forms.Label();
this.label1 = new System.Windows.Forms.Label();
this.textRealMoney = new System.Windows.Forms.TextBox();
this.label2 = new System.Windows.Forms.Label();
this.comboBox1 = new System.Windows.Forms.ComboBox();
this.btnSave = new System.Windows.Forms.Button();
this.btnExit = new System.Windows.Forms.Button();
this.groupBox1 = new System.Windows.Forms.GroupBox();
this.groupBox1.SuspendLayout();
this.SuspendLayout();
//
// textTotalMoney
//
this.textTotalMoney.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.textTotalMoney.Location = new System.Drawing.Point(144, 16);
this.textTotalMoney.Multiline = true;
this.textTotalMoney.Name = "textTotalMoney";
this.textTotalMoney.Size = new System.Drawing.Size(88, 20);
this.textTotalMoney.TabIndex = 18;
this.textTotalMoney.Text = "";
//
// label5
//
this.label5.BackColor = System.Drawing.Color.Transparent;
this.label5.Location = new System.Drawing.Point(56, 16);
this.label5.Name = "label5";
this.label5.Size = new System.Drawing.Size(56, 25);
this.label5.TabIndex = 11;
this.label5.Text = "应收金额";
this.label5.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
//
// label1
//
this.label1.BackColor = System.Drawing.Color.Transparent;
this.label1.Location = new System.Drawing.Point(56, 48);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(32, 25);
this.label1.TabIndex = 1;
this.label1.Text = "打折";
this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
//
// textRealMoney
//
this.textRealMoney.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.textRealMoney.Location = new System.Drawing.Point(144, 80);
this.textRealMoney.Multiline = true;
this.textRealMoney.Name = "textRealMoney";
this.textRealMoney.Size = new System.Drawing.Size(88, 20);
this.textRealMoney.TabIndex = 0;
this.textRealMoney.Text = "";
//
// label2
//
this.label2.BackColor = System.Drawing.Color.Transparent;
this.label2.Location = new System.Drawing.Point(48, 80);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(56, 25);
this.label2.TabIndex = 20;
this.label2.Text = "实收金额";
this.label2.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
//
// comboBox1
//
this.comboBox1.Items.AddRange(new object[] {
"95",
"90",
"85",
"80",
"75",
"70",
""});
this.comboBox1.Location = new System.Drawing.Point(144, 48);
this.comboBox1.Name = "comboBox1";
this.comboBox1.Size = new System.Drawing.Size(88, 20);
this.comboBox1.TabIndex = 19;
this.comboBox1.SelectedIndexChanged += new System.EventHandler(this.comboBox1_SelectedIndexChanged);
//
// btnSave
//
this.btnSave.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnSave.Location = new System.Drawing.Point(80, 112);
this.btnSave.Name = "btnSave";
this.btnSave.Size = new System.Drawing.Size(56, 24);
this.btnSave.TabIndex = 21;
this.btnSave.Text = "确定";
this.btnSave.Click += new System.EventHandler(this.btnSave_Click);
//
// btnExit
//
this.btnExit.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnExit.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft;
this.btnExit.Location = new System.Drawing.Point(152, 112);
this.btnExit.Name = "btnExit";
this.btnExit.Size = new System.Drawing.Size(56, 23);
this.btnExit.TabIndex = 20;
this.btnExit.Text = "退出";
this.btnExit.Click += new System.EventHandler(this.btnExit_Click);
//
// groupBox1
//
this.groupBox1.Controls.Add(this.label5);
this.groupBox1.Controls.Add(this.textTotalMoney);
this.groupBox1.Controls.Add(this.label1);
this.groupBox1.Controls.Add(this.comboBox1);
this.groupBox1.Controls.Add(this.label2);
this.groupBox1.Controls.Add(this.textRealMoney);
this.groupBox1.Controls.Add(this.btnSave);
this.groupBox1.Controls.Add(this.btnExit);
this.groupBox1.Location = new System.Drawing.Point(8, 8);
this.groupBox1.Name = "groupBox1";
this.groupBox1.Size = new System.Drawing.Size(288, 168);
this.groupBox1.TabIndex = 22;
this.groupBox1.TabStop = false;
//
// CheckInForm
//
this.AutoScaleBaseSize = new System.Drawing.Size(6, 14);
this.BackColor = System.Drawing.Color.AliceBlue;
this.ClientSize = new System.Drawing.Size(312, 189);
this.Controls.Add(this.groupBox1);
this.Name = "CheckInForm";
this.Text = "客户结帐";
this.Load += new System.EventHandler(this.ClientCheck_Load);
this.groupBox1.ResumeLayout(false);
this.ResumeLayout(false);
}
#endregion
private void btnExit_Click(object sender, System.EventArgs e)
{
this.Close();
}
private void btnSave_Click(object sender, System.EventArgs e)
{
this.Close();
}
private void ClientCheck_Load(object sender, System.EventArgs e)
{
this.textRealMoney.Text=this.textTotalMoney.Text;
this.FactTotalMoney=this.TotalMoney;
}
private void comboBox1_SelectedIndexChanged(object sender, System.EventArgs e)
{
this.FactTotalMoney=this.TotalMoney*Convert.ToInt16(this.comboBox1.Text)/100;
this.textRealMoney.Text=this.FactTotalMoney.ToString();
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -