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

📄 roommanageform.cs

📁 本设备管理系统采用了三层结构的设计思想
💻 CS
📖 第 1 页 / 共 2 页
字号:
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
using System.Data.SqlClient;


namespace HotelManage
{
	/// <summary>
	/// Form1 的摘要说明。
	/// </summary>
	public class RoomManageForm : System.Windows.Forms.Form
	{
		private System.Windows.Forms.Panel panel1;
		private System.Windows.Forms.TextBox textRemark;
		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 textRoomID;		
		private string selectStr;
		private SqlCommand sqlCommand1=null;
		private SqlDataReader sqlDataReader1=null;
		private SqlConnection sqlConnection1=null;
		private bool add=false;
			private DataSet ds=null;
		private System.Windows.Forms.Button btnSave;
		private System.Windows.Forms.Button btnNew;		
		/// <summary>
		/// 必需的设计器变量。
		/// </summary>
		private System.ComponentModel.Container components = null;
		private System.Windows.Forms.ComboBox comboRoomPosition;
		private System.Windows.Forms.ComboBox comboBedNum;
		private System.Windows.Forms.ComboBox comboPeopleNum;
		private System.Windows.Forms.ComboBox comboRoomType;
		private System.Windows.Forms.Button btnExit;
		private System.Windows.Forms.DataGrid dataGrid1;
		HotelManage.RoomManage roomManage=new RoomManage();
		

		public RoomManageForm()
		{
			//
			// Windows 窗体设计器支持所必需的
			//
			InitializeComponent();
			this.sqlConnection1=new SqlConnection(HotelManage.util.Connection.ConnString);
			this.sqlCommand1=new SqlCommand();
			this.sqlCommand1.CommandType=CommandType.Text;
			this.sqlCommand1.Connection=this.sqlConnection1;

			//
			// 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.panel1 = new System.Windows.Forms.Panel();
			this.comboPeopleNum = new System.Windows.Forms.ComboBox();
			this.comboBedNum = new System.Windows.Forms.ComboBox();
			this.comboRoomPosition = new System.Windows.Forms.ComboBox();
			this.textRemark = new System.Windows.Forms.TextBox();
			this.label5 = new System.Windows.Forms.Label();
			this.label4 = new System.Windows.Forms.Label();
			this.label3 = new System.Windows.Forms.Label();
			this.comboRoomType = new System.Windows.Forms.ComboBox();
			this.label6 = new System.Windows.Forms.Label();
			this.label2 = new System.Windows.Forms.Label();
			this.label1 = new System.Windows.Forms.Label();
			this.textRoomID = new System.Windows.Forms.TextBox();
			this.btnSave = new System.Windows.Forms.Button();
			this.btnNew = new System.Windows.Forms.Button();
			this.btnExit = new System.Windows.Forms.Button();
			this.dataGrid1 = new System.Windows.Forms.DataGrid();
			this.panel1.SuspendLayout();
			((System.ComponentModel.ISupportInitialize)(this.dataGrid1)).BeginInit();
			this.SuspendLayout();
			// 
			// panel1
			// 
			this.panel1.BackColor = System.Drawing.SystemColors.Window;
			this.panel1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
			this.panel1.Controls.Add(this.comboPeopleNum);
			this.panel1.Controls.Add(this.comboBedNum);
			this.panel1.Controls.Add(this.comboRoomPosition);
			this.panel1.Controls.Add(this.textRemark);
			this.panel1.Controls.Add(this.label5);
			this.panel1.Controls.Add(this.label4);
			this.panel1.Controls.Add(this.label3);
			this.panel1.Controls.Add(this.comboRoomType);
			this.panel1.Controls.Add(this.label6);
			this.panel1.Controls.Add(this.label2);
			this.panel1.Controls.Add(this.label1);
			this.panel1.Controls.Add(this.textRoomID);
			this.panel1.Controls.Add(this.btnNew);
			this.panel1.Controls.Add(this.btnSave);
			this.panel1.Controls.Add(this.btnExit);
			this.panel1.ForeColor = System.Drawing.SystemColors.Desktop;
			this.panel1.Location = new System.Drawing.Point(8, 16);
			this.panel1.Name = "panel1";
			this.panel1.Size = new System.Drawing.Size(584, 124);
			this.panel1.TabIndex = 2;
			// 
			// comboPeopleNum
			// 
			this.comboPeopleNum.AllowDrop = true;
			this.comboPeopleNum.BackColor = System.Drawing.Color.White;
			this.comboPeopleNum.ForeColor = System.Drawing.SystemColors.Desktop;
			this.comboPeopleNum.IntegralHeight = false;
			this.comboPeopleNum.Items.AddRange(new object[] {
																"1",
																"2",
																"3",
																"4"});
			this.comboPeopleNum.Location = new System.Drawing.Point(64, 52);
			this.comboPeopleNum.Name = "comboPeopleNum";
			this.comboPeopleNum.Size = new System.Drawing.Size(76, 20);
			this.comboPeopleNum.Sorted = true;
			this.comboPeopleNum.TabIndex = 17;
			this.comboPeopleNum.Text = "选择";
			// 
			// comboBedNum
			// 
			this.comboBedNum.AllowDrop = true;
			this.comboBedNum.BackColor = System.Drawing.Color.White;
			this.comboBedNum.ForeColor = System.Drawing.SystemColors.Desktop;
			this.comboBedNum.IntegralHeight = false;
			this.comboBedNum.Items.AddRange(new object[] {
															 "1",
															 "2",
															 "3",
															 "4"});
			this.comboBedNum.Location = new System.Drawing.Point(208, 52);
			this.comboBedNum.Name = "comboBedNum";
			this.comboBedNum.Size = new System.Drawing.Size(88, 20);
			this.comboBedNum.Sorted = true;
			this.comboBedNum.TabIndex = 16;
			this.comboBedNum.Text = "选择";
			// 
			// comboRoomPosition
			// 
			this.comboRoomPosition.AllowDrop = true;
			this.comboRoomPosition.BackColor = System.Drawing.Color.White;
			this.comboRoomPosition.ForeColor = System.Drawing.SystemColors.Desktop;
			this.comboRoomPosition.IntegralHeight = false;
			this.comboRoomPosition.Items.AddRange(new object[] {
																   "二层",
																   "三层",
																   "四层",
																   "一层"});
			this.comboRoomPosition.Location = new System.Drawing.Point(356, 12);
			this.comboRoomPosition.Name = "comboRoomPosition";
			this.comboRoomPosition.Size = new System.Drawing.Size(84, 20);
			this.comboRoomPosition.Sorted = true;
			this.comboRoomPosition.TabIndex = 15;
			this.comboRoomPosition.Text = "选择";
			// 
			// textRemark
			// 
			this.textRemark.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
			this.textRemark.Location = new System.Drawing.Point(64, 84);
			this.textRemark.Multiline = true;
			this.textRemark.Name = "textRemark";
			this.textRemark.Size = new System.Drawing.Size(364, 20);
			this.textRemark.TabIndex = 14;
			this.textRemark.Text = "";
			// 
			// label5
			// 
			this.label5.BackColor = System.Drawing.Color.White;
			this.label5.Location = new System.Drawing.Point(12, 84);
			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(144, 48);
			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(4, 48);
			this.label3.Name = "label3";
			this.label3.Size = new System.Drawing.Size(60, 25);

⌨️ 快捷键说明

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