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

📄 fmreckoningrid.cs

📁 一个基本的酒店管理系统
💻 CS
字号:
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using ShowInfoLibrary;
using ConnectDBLibrary;
using System.Data;


namespace UI
{
	/// <summary>
	/// fmreckoningRid 的摘要说明。
	/// </summary>
	public class fmreckoningRid : System.Windows.Forms.Form
	{
		/// <summary>
		/// 必需的设计器变量。
		/// </summary>
		private System.ComponentModel.Container components = null;
		private Point mouseOffset;
		private System.Windows.Forms.Label label1;
		private System.Windows.Forms.TextBox txtreckoning;
		private System.Windows.Forms.Button btnsure;
		private System.Windows.Forms.Button btncancel;
		bool isMouseDown;

		public fmreckoningRid()
		{
			//
			// 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()
		{
			this.label1 = new System.Windows.Forms.Label();
			this.txtreckoning = new System.Windows.Forms.TextBox();
			this.btnsure = new System.Windows.Forms.Button();
			this.btncancel = new System.Windows.Forms.Button();
			this.SuspendLayout();
			// 
			// label1
			// 
			this.label1.Location = new System.Drawing.Point(32, 24);
			this.label1.Name = "label1";
			this.label1.Size = new System.Drawing.Size(160, 16);
			this.label1.TabIndex = 0;
			this.label1.Text = "请输入要结帐的房间号:";
			// 
			// txtreckoning
			// 
			this.txtreckoning.Location = new System.Drawing.Point(32, 40);
			this.txtreckoning.Name = "txtreckoning";
			this.txtreckoning.Size = new System.Drawing.Size(232, 21);
			this.txtreckoning.TabIndex = 1;
			this.txtreckoning.Text = "";
			// 
			// btnsure
			// 
			this.btnsure.Location = new System.Drawing.Point(96, 72);
			this.btnsure.Name = "btnsure";
			this.btnsure.TabIndex = 2;
			this.btnsure.Text = "确定";
			this.btnsure.Click += new System.EventHandler(this.btnsure_Click);
			// 
			// btncancel
			// 
			this.btncancel.Location = new System.Drawing.Point(184, 72);
			this.btncancel.Name = "btncancel";
			this.btncancel.TabIndex = 3;
			this.btncancel.Text = "取消";
			this.btncancel.Click += new System.EventHandler(this.btncancel_Click);
			// 
			// fmreckoningRid
			// 
			this.AutoScaleBaseSize = new System.Drawing.Size(6, 14);
			this.BackColor = System.Drawing.Color.MistyRose;
			this.ClientSize = new System.Drawing.Size(292, 104);
			this.Controls.Add(this.btncancel);
			this.Controls.Add(this.btnsure);
			this.Controls.Add(this.txtreckoning);
			this.Controls.Add(this.label1);
			this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
			this.Name = "fmreckoningRid";
			this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
			this.Text = "fmreckoningRid";
			this.MouseDown += new System.Windows.Forms.MouseEventHandler(this.fmreckoningRid_MouseDown);
			this.MouseUp += new System.Windows.Forms.MouseEventHandler(this.fmreckoningRid_MouseUp);
			this.MouseMove += new System.Windows.Forms.MouseEventHandler(this.fmreckoningRid_MouseMove);
			this.ResumeLayout(false);

		}
		#endregion

		private void fmreckoningRid_MouseDown(object sender, System.Windows.Forms.MouseEventArgs e)
		{
			if (e.Button == MouseButtons.Left) 
			{
				mouseOffset = new Point(-e.X, -e.Y);
				isMouseDown = true;
			}
		}

		private void fmreckoningRid_MouseMove(object sender, System.Windows.Forms.MouseEventArgs e)
		{
			if (isMouseDown) 
			{
				Point mousePos = Control.MousePosition;
				mousePos.Offset(mouseOffset.X, mouseOffset.Y);
				Location = mousePos;
			}
		
		}

		private void fmreckoningRid_MouseUp(object sender, System.Windows.Forms.MouseEventArgs e)
		{
			isMouseDown=false;
		
		}

		private void btnsure_Click(object sender, System.EventArgs e)
		{
			
			Reckoning_Calrecord caldata=new  Reckoning_Calrecord();//承载数据
			Reckoning_CalrecordBusiness busi=new Reckoning_CalrecordBusiness();
			busi.calrecordBusiness(caldata);
			//产生帐单号
			string la=caldata.Tables[0].Rows[0]["total"].ToString();
			int las=int.Parse(la)+1;
			string last=las.ToString();
		    string str=DateTime.Now.ToString();
			string year=str.Substring(0,4);
			string month=str.Substring(5,2);
			string day=str.Substring(8,2);
			string STR="ZD"+year+month+day+"000"+last;
			//判断是追加房间还是单人开房
			Reckoning_isSuperadditionData isdata=new Reckoning_isSuperadditionData();
			Reckoning_isSuperadditionBusiness busi2=new Reckoning_isSuperadditionBusiness();
			busi2.isSuperadditionBusiness(this.txtreckoning.Text,isdata);
			string remark=isdata.Tables[0].Rows[0]["Remark"].ToString();
			string REM=remark.Substring(0,2);
			MessageBox.Show(REM+":截取的字符串!");
			if(str.Equals("主单"))
			{
				fmreckoning fm=new fmreckoning(this.txtreckoning.Text,STR);
				fm.Show();
				this.Close();

			}
			else
			{
				fmreckoning fm=new fmreckoning("结帐区内房间",STR);
				fm.Show();
				this.Close();

			}


			
			
			

			
		   
		
		}

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

⌨️ 快捷键说明

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