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

📄 updateroomtypeui.cs

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

namespace UI
{
	/// <summary>
	/// UpdateRoomtypeUI 的摘要说明。
	/// </summary>
	public class UpdateRoomtypeUI : System.Windows.Forms.Form
	{
		private ListViewItem item;
		private System.Windows.Forms.Button button1;
		private System.Windows.Forms.RadioButton radioButton2;
		private System.Windows.Forms.RadioButton radioButton1;
		private System.Windows.Forms.TextBox textType;
		private System.Windows.Forms.Label label1;
		private System.Windows.Forms.Label label2;
		private System.Windows.Forms.TextBox textPriceByday;
		private System.Windows.Forms.Label label3;
		private System.Windows.Forms.TextBox textPriceByHour;
		private System.Windows.Forms.Label label4;
		private System.Windows.Forms.TextBox textNum;
		private System.Windows.Forms.Label label5;
		private System.Windows.Forms.Button button2;
		private System.Windows.Forms.Label label6;
		private System.Windows.Forms.Label label7;
		/// <summary>
		/// 必需的设计器变量。
		/// </summary>
		private System.ComponentModel.Container components = null;

		public UpdateRoomtypeUI()
		{
			//
			// Windows 窗体设计器支持所必需的
			//
			InitializeComponent();

			//
			// TODO: 在 InitializeComponent 调用后添加任何构造函数代码
			//
		}
		public UpdateRoomtypeUI(ListViewItem item)
		{
			//
			// Windows 窗体设计器支持所必需的
			//
			InitializeComponent();
			this.item=item;
		}

		/// <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.button1 = new System.Windows.Forms.Button();
			this.radioButton2 = new System.Windows.Forms.RadioButton();
			this.radioButton1 = new System.Windows.Forms.RadioButton();
			this.textType = new System.Windows.Forms.TextBox();
			this.label1 = new System.Windows.Forms.Label();
			this.label2 = new System.Windows.Forms.Label();
			this.textPriceByday = new System.Windows.Forms.TextBox();
			this.label3 = new System.Windows.Forms.Label();
			this.textPriceByHour = new System.Windows.Forms.TextBox();
			this.label4 = new System.Windows.Forms.Label();
			this.textNum = new System.Windows.Forms.TextBox();
			this.label5 = new System.Windows.Forms.Label();
			this.button2 = new System.Windows.Forms.Button();
			this.label6 = new System.Windows.Forms.Label();
			this.label7 = new System.Windows.Forms.Label();
			this.SuspendLayout();
			// 
			// button1
			// 
			this.button1.Location = new System.Drawing.Point(112, 264);
			this.button1.Name = "button1";
			this.button1.TabIndex = 17;
			this.button1.Text = "修改";
			this.button1.Click += new System.EventHandler(this.button1_Click);
			// 
			// radioButton2
			// 
			this.radioButton2.Location = new System.Drawing.Point(280, 176);
			this.radioButton2.Name = "radioButton2";
			this.radioButton2.Size = new System.Drawing.Size(40, 24);
			this.radioButton2.TabIndex = 15;
			this.radioButton2.Text = "否";
			// 
			// radioButton1
			// 
			this.radioButton1.Location = new System.Drawing.Point(216, 176);
			this.radioButton1.Name = "radioButton1";
			this.radioButton1.Size = new System.Drawing.Size(40, 24);
			this.radioButton1.TabIndex = 14;
			this.radioButton1.Text = "是";
			// 
			// textType
			// 
			this.textType.Location = new System.Drawing.Point(208, 56);
			this.textType.Name = "textType";
			this.textType.Size = new System.Drawing.Size(112, 21);
			this.textType.TabIndex = 12;
			this.textType.Text = "";
			// 
			// label1
			// 
			this.label1.AutoSize = true;
			this.label1.Location = new System.Drawing.Point(112, 64);
			this.label1.Name = "label1";
			this.label1.Size = new System.Drawing.Size(72, 17);
			this.label1.TabIndex = 6;
			this.label1.Text = " 房间类型:";
			// 
			// label2
			// 
			this.label2.AutoSize = true;
			this.label2.Location = new System.Drawing.Point(120, 96);
			this.label2.Name = "label2";
			this.label2.Size = new System.Drawing.Size(66, 17);
			this.label2.TabIndex = 5;
			this.label2.Text = "单价/ 天:";
			// 
			// textPriceByday
			// 
			this.textPriceByday.Location = new System.Drawing.Point(208, 96);
			this.textPriceByday.Name = "textPriceByday";
			this.textPriceByday.Size = new System.Drawing.Size(112, 21);
			this.textPriceByday.TabIndex = 13;
			this.textPriceByday.Text = "";
			// 
			// label3
			// 
			this.label3.AutoSize = true;
			this.label3.Location = new System.Drawing.Point(112, 136);
			this.label3.Name = "label3";
			this.label3.Size = new System.Drawing.Size(72, 17);
			this.label3.TabIndex = 9;
			this.label3.Text = "单价/小时:";
			// 
			// textPriceByHour
			// 
			this.textPriceByHour.Location = new System.Drawing.Point(208, 136);
			this.textPriceByHour.Name = "textPriceByHour";
			this.textPriceByHour.Size = new System.Drawing.Size(112, 21);
			this.textPriceByHour.TabIndex = 11;
			this.textPriceByHour.Text = "";
			// 
			// label4
			// 
			this.label4.AutoSize = true;
			this.label4.Location = new System.Drawing.Point(96, 176);
			this.label4.Name = "label4";
			this.label4.Size = new System.Drawing.Size(91, 17);
			this.label4.TabIndex = 7;
			this.label4.Text = "可否钟点计费:";
			// 
			// textNum
			// 
			this.textNum.Location = new System.Drawing.Point(208, 216);
			this.textNum.Name = "textNum";
			this.textNum.Size = new System.Drawing.Size(112, 21);
			this.textNum.TabIndex = 10;
			this.textNum.Text = "";
			// 
			// label5
			// 
			this.label5.AutoSize = true;
			this.label5.Location = new System.Drawing.Point(128, 216);
			this.label5.Name = "label5";
			this.label5.Size = new System.Drawing.Size(54, 17);
			this.label5.TabIndex = 8;
			this.label5.Text = "床位数:";
			// 
			// button2
			// 
			this.button2.Location = new System.Drawing.Point(256, 264);
			this.button2.Name = "button2";
			this.button2.TabIndex = 16;
			this.button2.Text = "取消";
			// 
			// label6
			// 
			this.label6.AutoSize = true;
			this.label6.Location = new System.Drawing.Point(112, 24);
			this.label6.Name = "label6";
			this.label6.Size = new System.Drawing.Size(72, 17);
			this.label6.TabIndex = 6;
			this.label6.Text = " 房间编号:";
			// 
			// label7
			// 
			this.label7.Location = new System.Drawing.Point(216, 24);
			this.label7.Name = "label7";
			this.label7.Size = new System.Drawing.Size(104, 17);
			this.label7.TabIndex = 6;
			// 
			// UpdateRoomtypeUI
			// 
			this.AutoScaleBaseSize = new System.Drawing.Size(6, 14);
			this.ClientSize = new System.Drawing.Size(456, 309);
			this.Controls.Add(this.button1);
			this.Controls.Add(this.radioButton2);
			this.Controls.Add(this.radioButton1);
			this.Controls.Add(this.textType);
			this.Controls.Add(this.label1);
			this.Controls.Add(this.label2);
			this.Controls.Add(this.textPriceByday);
			this.Controls.Add(this.label3);
			this.Controls.Add(this.textPriceByHour);
			this.Controls.Add(this.label4);
			this.Controls.Add(this.textNum);
			this.Controls.Add(this.label5);
			this.Controls.Add(this.button2);
			this.Controls.Add(this.label6);
			this.Controls.Add(this.label7);
			this.Name = "UpdateRoomtypeUI";
			this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
			this.Text = "修改房间类型";
			this.Load += new System.EventHandler(this.UpdateRoomtypeUI_Load);
			this.ResumeLayout(false);

		}
		#endregion

		private void UpdateRoomtypeUI_Load(object sender, System.EventArgs e)
		{
			this.label7.Text=this.item.SubItems[0].Text;
			this.textType.Text=this.item.SubItems[1].Text;
			this.textPriceByday.Text=this.item.SubItems[2].Text;
			this.textPriceByHour.Text=this.item.SubItems[3].Text;
			this.textNum.Text=this.item.SubItems[4].Text;
			if(this.item.SubItems[5].Text.Trim()=="1")
			{
				this.radioButton1.Checked=true;
			}
			else
			{
				this.radioButton2.Checked=true;
			}
		}

		private void button1_Click(object sender, System.EventArgs e)
		{
			try
			{
				string tid=this.label7.Text;
				string type=this.textType.Text.Trim();
				string priceday=this.textPriceByday.Text.Trim();
				string pricehour=this.textPriceByHour.Text.Trim();
				string istimeroom="";
				if(this.radioButton1.Checked)
				{
					istimeroom="1";
				}
				else
				{
					istimeroom="0";
				}
				string setNum=this.textNum.Text.Trim();
				ShowUpdateRoomTypeByTid update=new ShowUpdateRoomTypeByTid();
				if(update.checkedRoomtype(type,priceday,pricehour,istimeroom,setNum))
				{
					if(update.UpdateRoomTypeByTid(tid,type,priceday,pricehour,istimeroom,setNum))
					{
						MessageBox.Show("修改成功");
						this.Close();
					}
					else
					{
						MessageBox.Show("修改失败");
					}
				}
			}
			catch(Exception ex)
			{
				MessageBox.Show(ex.ToString());
			}
			
			
		}
	}
}

⌨️ 快捷键说明

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