⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 clientbookin.cs

📁 酒店管理系统是个不错的 系统 自己做的毕业设计 里面功能齐全
💻 CS
字号:
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using HotelsManage.BusinessLevel;
namespace HotelsManage.UILevel
{
	/// <summary>
	/// ClientBookIn 的摘要说明。
	/// </summary>
	public class ClientBookIn : System.Windows.Forms.Form
	{
		private System.Windows.Forms.GroupBox groupBox1;
		private System.Windows.Forms.Label label7;
		private System.Windows.Forms.DateTimePicker dtTimePicker;
		private System.Windows.Forms.TextBox txtRemark;
		private System.Windows.Forms.TextBox txtClientID;
		private System.Windows.Forms.TextBox txtClientName;
		private System.Windows.Forms.ComboBox cmbSex;
		private System.Windows.Forms.ComboBox cmbNativePlace;
		private System.Windows.Forms.Label label5;
		private System.Windows.Forms.Label label4;
		private System.Windows.Forms.Label label3;
		private System.Windows.Forms.Label label6;
		private System.Windows.Forms.Label label2;
		private System.Windows.Forms.Label label1;
		private System.Windows.Forms.TextBox txtRoomID;
		private System.Windows.Forms.Button btnReset;
		private System.Windows.Forms.Button btnCancel;
		private System.Windows.Forms.Button btnSave;
		/// <summary>
		/// 必需的设计器变量。
		/// </summary>
		/// 
		string Roomid;
		private System.ComponentModel.Container components = null;

		public ClientBookIn(string roomid)
		{
			this.Roomid=roomid;
			//
			// Windows 窗体设计器支持所必需的
			//
			InitializeComponent();

			//
			// 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()
		{
			System.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeof(ClientBookIn));
			this.groupBox1 = new System.Windows.Forms.GroupBox();
			this.label7 = new System.Windows.Forms.Label();
			this.dtTimePicker = new System.Windows.Forms.DateTimePicker();
			this.txtRemark = new System.Windows.Forms.TextBox();
			this.txtClientID = new System.Windows.Forms.TextBox();
			this.txtClientName = new System.Windows.Forms.TextBox();
			this.cmbSex = new System.Windows.Forms.ComboBox();
			this.cmbNativePlace = new System.Windows.Forms.ComboBox();
			this.label5 = new System.Windows.Forms.Label();
			this.label4 = new System.Windows.Forms.Label();
			this.label3 = new System.Windows.Forms.Label();
			this.label6 = new System.Windows.Forms.Label();
			this.label2 = new System.Windows.Forms.Label();
			this.label1 = new System.Windows.Forms.Label();
			this.txtRoomID = new System.Windows.Forms.TextBox();
			this.btnReset = new System.Windows.Forms.Button();
			this.btnCancel = new System.Windows.Forms.Button();
			this.btnSave = new System.Windows.Forms.Button();
			this.groupBox1.SuspendLayout();
			this.SuspendLayout();
			// 
			// groupBox1
			// 
			this.groupBox1.Controls.Add(this.label7);
			this.groupBox1.Controls.Add(this.dtTimePicker);
			this.groupBox1.Controls.Add(this.txtRemark);
			this.groupBox1.Controls.Add(this.txtClientID);
			this.groupBox1.Controls.Add(this.txtClientName);
			this.groupBox1.Controls.Add(this.cmbSex);
			this.groupBox1.Controls.Add(this.cmbNativePlace);
			this.groupBox1.Controls.Add(this.label5);
			this.groupBox1.Controls.Add(this.label4);
			this.groupBox1.Controls.Add(this.label3);
			this.groupBox1.Controls.Add(this.label6);
			this.groupBox1.Controls.Add(this.label2);
			this.groupBox1.Controls.Add(this.label1);
			this.groupBox1.Controls.Add(this.txtRoomID);
			this.groupBox1.ForeColor = System.Drawing.SystemColors.Desktop;
			this.groupBox1.Location = new System.Drawing.Point(16, 8);
			this.groupBox1.Name = "groupBox1";
			this.groupBox1.Size = new System.Drawing.Size(488, 120);
			this.groupBox1.TabIndex = 23;
			this.groupBox1.TabStop = false;
			this.groupBox1.Text = "客户入住";
			// 
			// label7
			// 
			this.label7.BackColor = System.Drawing.Color.White;
			this.label7.Location = new System.Drawing.Point(272, 56);
			this.label7.Name = "label7";
			this.label7.Size = new System.Drawing.Size(60, 25);
			this.label7.TabIndex = 27;
			this.label7.Text = "入住日期";
			this.label7.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
			// 
			// dtTimePicker
			// 
			this.dtTimePicker.AllowDrop = true;
			this.dtTimePicker.Location = new System.Drawing.Point(344, 56);
			this.dtTimePicker.Name = "dtTimePicker";
			this.dtTimePicker.Size = new System.Drawing.Size(112, 21);
			this.dtTimePicker.TabIndex = 26;
			// 
			// txtRemark
			// 
			this.txtRemark.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
			this.txtRemark.Location = new System.Drawing.Point(72, 88);
			this.txtRemark.Multiline = true;
			this.txtRemark.Name = "txtRemark";
			this.txtRemark.Size = new System.Drawing.Size(384, 20);
			this.txtRemark.TabIndex = 25;
			this.txtRemark.Text = "";
			// 
			// txtClientID
			// 
			this.txtClientID.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
			this.txtClientID.Cursor = System.Windows.Forms.Cursors.No;
			this.txtClientID.Location = new System.Drawing.Point(200, 24);
			this.txtClientID.MaxLength = 18;
			this.txtClientID.Multiline = true;
			this.txtClientID.Name = "txtClientID";
			this.txtClientID.Size = new System.Drawing.Size(112, 21);
			this.txtClientID.TabIndex = 24;
			this.txtClientID.Text = "";
			// 
			// txtClientName
			// 
			this.txtClientName.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
			this.txtClientName.Location = new System.Drawing.Point(384, 24);
			this.txtClientName.Name = "txtClientName";
			this.txtClientName.Size = new System.Drawing.Size(68, 21);
			this.txtClientName.TabIndex = 23;
			this.txtClientName.Text = "";
			// 
			// cmbSex
			// 
			this.cmbSex.Items.AddRange(new object[] {
														"男",
														"女"});
			this.cmbSex.Location = new System.Drawing.Point(72, 56);
			this.cmbSex.Name = "cmbSex";
			this.cmbSex.Size = new System.Drawing.Size(56, 20);
			this.cmbSex.TabIndex = 22;
			// 
			// cmbNativePlace
			// 
			this.cmbNativePlace.Items.AddRange(new object[] {
																"北京市",
																"上海市",
																"天津市",
																"河北省",
																"广东省",
																"四川省",
																"河南省"});
			this.cmbNativePlace.Location = new System.Drawing.Point(200, 56);
			this.cmbNativePlace.Name = "cmbNativePlace";
			this.cmbNativePlace.Size = new System.Drawing.Size(64, 20);
			this.cmbNativePlace.TabIndex = 21;
			// 
			// label5
			// 
			this.label5.BackColor = System.Drawing.Color.White;
			this.label5.Location = new System.Drawing.Point(8, 88);
			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;
			// 
			// label4
			// 
			this.label4.BackColor = System.Drawing.Color.White;
			this.label4.Location = new System.Drawing.Point(136, 56);
			this.label4.Name = "label4";
			this.label4.Size = new System.Drawing.Size(56, 25);
			this.label4.TabIndex = 10;
			this.label4.Text = "顾客籍贯";
			this.label4.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
			// 
			// label3
			// 
			this.label3.BackColor = System.Drawing.Color.White;
			this.label3.Location = new System.Drawing.Point(8, 56);
			this.label3.Name = "label3";
			this.label3.Size = new System.Drawing.Size(60, 25);
			this.label3.TabIndex = 9;
			this.label3.Text = "顾客性别";
			this.label3.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
			// 
			// label6
			// 
			this.label6.BackColor = System.Drawing.Color.White;
			this.label6.Location = new System.Drawing.Point(312, 24);
			this.label6.Name = "label6";
			this.label6.Size = new System.Drawing.Size(60, 25);
			this.label6.TabIndex = 6;
			this.label6.Text = "顾客姓名";
			this.label6.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
			// 
			// label2
			// 
			this.label2.BackColor = System.Drawing.Color.White;
			this.label2.Location = new System.Drawing.Point(144, 24);
			this.label2.Name = "label2";
			this.label2.Size = new System.Drawing.Size(48, 25);
			this.label2.TabIndex = 2;
			this.label2.Text = "顾客ID";
			this.label2.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
			// 
			// label1
			// 
			this.label1.BackColor = System.Drawing.Color.White;
			this.label1.Location = new System.Drawing.Point(16, 24);
			this.label1.Name = "label1";
			this.label1.Size = new System.Drawing.Size(48, 25);
			this.label1.TabIndex = 1;
			this.label1.Text = "房间号";
			this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
			// 
			// txtRoomID
			// 
			this.txtRoomID.AcceptsTab = true;
			this.txtRoomID.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
			this.txtRoomID.Location = new System.Drawing.Point(72, 24);
			this.txtRoomID.Name = "txtRoomID";
			this.txtRoomID.ReadOnly = true;
			this.txtRoomID.Size = new System.Drawing.Size(64, 21);
			this.txtRoomID.TabIndex = 0;
			this.txtRoomID.Text = "";
			// 
			// btnReset
			// 
			this.btnReset.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
			this.btnReset.Image = ((System.Drawing.Image)(resources.GetObject("btnReset.Image")));
			this.btnReset.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft;
			this.btnReset.Location = new System.Drawing.Point(152, 152);
			this.btnReset.Name = "btnReset";
			this.btnReset.Size = new System.Drawing.Size(56, 23);
			this.btnReset.TabIndex = 28;
			this.btnReset.Text = "重置";
			this.btnReset.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
			this.btnReset.Click += new System.EventHandler(this.btnReset_Click);
			// 
			// btnCancel
			// 
			this.btnCancel.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
			this.btnCancel.Image = ((System.Drawing.Image)(resources.GetObject("btnCancel.Image")));
			this.btnCancel.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft;
			this.btnCancel.Location = new System.Drawing.Point(232, 152);
			this.btnCancel.Name = "btnCancel";
			this.btnCancel.Size = new System.Drawing.Size(56, 23);
			this.btnCancel.TabIndex = 27;
			this.btnCancel.Text = "取消";
			this.btnCancel.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
			this.btnCancel.Click += new System.EventHandler(this.btnCancel_Click);
			// 
			// btnSave
			// 
			this.btnSave.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
			this.btnSave.Image = ((System.Drawing.Image)(resources.GetObject("btnSave.Image")));
			this.btnSave.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft;
			this.btnSave.Location = new System.Drawing.Point(312, 152);
			this.btnSave.Name = "btnSave";
			this.btnSave.Size = new System.Drawing.Size(56, 24);
			this.btnSave.TabIndex = 26;
			this.btnSave.Text = "保存";
			this.btnSave.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
			this.btnSave.Click += new System.EventHandler(this.btnSave_Click);
			// 
			// ClientBookIn
			// 
			this.AutoScaleBaseSize = new System.Drawing.Size(6, 14);
			this.BackColor = System.Drawing.SystemColors.ControlLightLight;
			this.ClientSize = new System.Drawing.Size(520, 198);
			this.Controls.Add(this.btnReset);
			this.Controls.Add(this.btnCancel);
			this.Controls.Add(this.btnSave);
			this.Controls.Add(this.groupBox1);
			this.Name = "ClientBookIn";
			this.Text = "客户入住";
			this.Load += new System.EventHandler(this.ClientBookIn_Load);
			this.groupBox1.ResumeLayout(false);
			this.ResumeLayout(false);

		}
		#endregion

		private void ClientBookIn_Load(object sender, System.EventArgs e)
		{
			this.txtRoomID.Text=this.Roomid;
		}

		private void btnReset_Click(object sender, System.EventArgs e)
		{
			this.txtClientID.Text="";
			this.txtClientName.Text="";
			this.cmbSex.Text="";
			this.cmbNativePlace.Text="";
			this.txtRemark.Text="";
		}

		private void btnCancel_Click(object sender, System.EventArgs e)
		{
			this.Close();
		}

		private void btnSave_Click(object sender, System.EventArgs e)
		{
		   RoomSearch Rsch=new RoomSearch(this.txtRoomID.Text,this.txtClientID.Text,this.txtClientName.Text,this.cmbSex.Text,this.cmbNativePlace.Text,this.dtTimePicker.Value.ToString(),this.txtRemark.Text);
			if(RoomSearch.ClientIn(Rsch))
			{ 
//				this.Dataupdate();
				MessageBox.Show("用户入住成功");              
			
			}
			else
			{
			 MessageBox.Show("用户入住失败");
			}
          this.Close();
		}
		private void Dataupdate()
		{
			Login lg=new Login();
				HotelsManage.UILevel.MainForm mf=new MainForm(lg.Sort);
			for(int i=0;i<mf.MdiChildren.Length;i++)
			{
			 Form f=(Form)mf.MdiChildren[i];
				f.Close();
			
			}
		      RoomSearchFrom Rsf=new RoomSearchFrom();
				
			 
				Rsf.MdiParent=mf;
				Rsf.WindowState=FormWindowState.Maximized;
			Rsf.Show();
		}
	}
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -