📄 roomtype.cs
字号:
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
using System.Data.SqlClient;
using HotelManage.DataLevl;
using HotelManage.BussinessLevel;
namespace HotelManage.UILevel
{
/// <summary>
/// Form2 的摘要说明。
/// </summary>
public class RoomType : System.Windows.Forms.Form
{
private System.Windows.Forms.Label label2;
private System.Windows.Forms.Label label3;
private System.Windows.Forms.Label label4;
private System.Windows.Forms.Label label5;
private System.Windows.Forms.Panel panel1;
private System.Windows.Forms.ListView listView1;
private System.Windows.Forms.ColumnHeader columnHeader1;
private System.Windows.Forms.ColumnHeader columnHeader2;
private System.Windows.Forms.ColumnHeader columnHeader3;
private System.Windows.Forms.ColumnHeader columnHeader4;
private System.Windows.Forms.ColumnHeader columnHeader5;
private System.Windows.Forms.ColumnHeader columnHeader6;
private System.Windows.Forms.ColumnHeader columnHeader7;
private System.Windows.Forms.ColumnHeader columnHeader8;
private System.Windows.Forms.Panel panel2;
private System.Windows.Forms.Label label7;
private System.Windows.Forms.Button btnCancel;
private string selectStr;
private SqlConnection sqlConnection1;
private SqlCommand sqlCommand1=null;
private SqlDataReader sqlDataReader1=null;
private bool add;
private System.Windows.Forms.Button btnStart;
private System.Windows.Forms.Button btnSearch;
private System.Windows.Forms.Button btnDelete;
private System.Windows.Forms.Button btnNew;
private System.Windows.Forms.Button btnSave;
private System.Windows.Forms.Button btnExit;
private System.Windows.Forms.TextBox textPrice;
private System.Windows.Forms.TextBox textBedNum;
private System.Windows.Forms.TextBox textArea;
private System.Windows.Forms.TextBox textTypeName;
private System.Windows.Forms.CheckBox checkAirCondition;
private System.Windows.Forms.CheckBox checkTelephone;
private System.Windows.Forms.CheckBox checkToilet;
private System.Windows.Forms.CheckBox checkTV;
private System.Windows.Forms.TextBox textSearch;
HotelManage.BussinessLevel.RoomTypeManage roomtypeManage;
/// <summary>
/// 必需的设计器变量。
/// </summary>
private System.ComponentModel.Container components = null;
public RoomType()
{
//
// Windows 窗体设计器支持所必需的
//
InitializeComponent();
this.sqlConnection1=new SqlConnection(HotelManage.DataLevl.Connection.ConnString);
this.sqlCommand1=new SqlCommand();
this.sqlCommand1.Connection=this.sqlConnection1;
this.add=false;
roomtypeManage=new HotelManage.BussinessLevel.RoomTypeManage();
//
// 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.Windows.Forms.ListViewItem listViewItem1 = new System.Windows.Forms.ListViewItem("");
System.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeof(RoomType));
this.checkAirCondition = new System.Windows.Forms.CheckBox();
this.checkTelephone = new System.Windows.Forms.CheckBox();
this.label5 = new System.Windows.Forms.Label();
this.textPrice = new System.Windows.Forms.TextBox();
this.checkToilet = new System.Windows.Forms.CheckBox();
this.checkTV = new System.Windows.Forms.CheckBox();
this.textBedNum = new System.Windows.Forms.TextBox();
this.textArea = new System.Windows.Forms.TextBox();
this.label4 = new System.Windows.Forms.Label();
this.label3 = new System.Windows.Forms.Label();
this.label2 = new System.Windows.Forms.Label();
this.textTypeName = new System.Windows.Forms.TextBox();
this.panel1 = new System.Windows.Forms.Panel();
this.listView1 = new System.Windows.Forms.ListView();
this.columnHeader1 = new System.Windows.Forms.ColumnHeader();
this.columnHeader3 = new System.Windows.Forms.ColumnHeader();
this.columnHeader2 = new System.Windows.Forms.ColumnHeader();
this.columnHeader4 = new System.Windows.Forms.ColumnHeader();
this.columnHeader7 = new System.Windows.Forms.ColumnHeader();
this.columnHeader6 = new System.Windows.Forms.ColumnHeader();
this.columnHeader5 = new System.Windows.Forms.ColumnHeader();
this.columnHeader8 = new System.Windows.Forms.ColumnHeader();
this.panel2 = new System.Windows.Forms.Panel();
this.btnStart = new System.Windows.Forms.Button();
this.label7 = new System.Windows.Forms.Label();
this.textSearch = new System.Windows.Forms.TextBox();
this.btnSearch = new System.Windows.Forms.Button();
this.btnDelete = new System.Windows.Forms.Button();
this.btnNew = new System.Windows.Forms.Button();
this.btnSave = new System.Windows.Forms.Button();
this.btnCancel = new System.Windows.Forms.Button();
this.btnExit = new System.Windows.Forms.Button();
this.panel1.SuspendLayout();
this.panel2.SuspendLayout();
this.SuspendLayout();
//
// checkAirCondition
//
this.checkAirCondition.Location = new System.Drawing.Point(360, 8);
this.checkAirCondition.Name = "checkAirCondition";
this.checkAirCondition.Size = new System.Drawing.Size(64, 24);
this.checkAirCondition.TabIndex = 1;
this.checkAirCondition.Text = "空调";
//
// checkTelephone
//
this.checkTelephone.Location = new System.Drawing.Point(280, 48);
this.checkTelephone.Name = "checkTelephone";
this.checkTelephone.Size = new System.Drawing.Size(64, 24);
this.checkTelephone.TabIndex = 15;
this.checkTelephone.Text = "电话";
//
// label5
//
this.label5.Location = new System.Drawing.Point(120, 40);
this.label5.Name = "label5";
this.label5.Size = new System.Drawing.Size(32, 23);
this.label5.TabIndex = 14;
this.label5.Text = "价钱";
//
// textPrice
//
this.textPrice.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.textPrice.Location = new System.Drawing.Point(168, 40);
this.textPrice.Name = "textPrice";
this.textPrice.Size = new System.Drawing.Size(72, 21);
this.textPrice.TabIndex = 13;
this.textPrice.Text = "";
//
// checkToilet
//
this.checkToilet.Location = new System.Drawing.Point(360, 48);
this.checkToilet.Name = "checkToilet";
this.checkToilet.Size = new System.Drawing.Size(64, 24);
this.checkToilet.TabIndex = 12;
this.checkToilet.Text = "卫生间";
//
// checkTV
//
this.checkTV.Location = new System.Drawing.Point(280, 8);
this.checkTV.Name = "checkTV";
this.checkTV.Size = new System.Drawing.Size(64, 24);
this.checkTV.TabIndex = 11;
this.checkTV.Text = "电视";
//
// textBedNum
//
this.textBedNum.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.textBedNum.Location = new System.Drawing.Point(40, 40);
this.textBedNum.Name = "textBedNum";
this.textBedNum.Size = new System.Drawing.Size(72, 21);
this.textBedNum.TabIndex = 10;
this.textBedNum.Text = "";
//
// textArea
//
this.textArea.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.textArea.Location = new System.Drawing.Point(168, 8);
this.textArea.Name = "textArea";
this.textArea.Size = new System.Drawing.Size(72, 21);
this.textArea.TabIndex = 9;
this.textArea.Text = "";
//
// label4
//
this.label4.Location = new System.Drawing.Point(8, 40);
this.label4.Name = "label4";
this.label4.Size = new System.Drawing.Size(32, 23);
this.label4.TabIndex = 6;
this.label4.Text = "床位";
//
// label3
//
this.label3.Location = new System.Drawing.Point(120, 16);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(32, 23);
this.label3.TabIndex = 5;
this.label3.Text = "面积";
//
// label2
//
this.label2.Location = new System.Drawing.Point(8, 8);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(32, 23);
this.label2.TabIndex = 4;
this.label2.Text = "名称";
//
// textTypeName
//
this.textTypeName.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.textTypeName.Enabled = false;
this.textTypeName.Location = new System.Drawing.Point(40, 8);
this.textTypeName.Name = "textTypeName";
this.textTypeName.Size = new System.Drawing.Size(72, 21);
this.textTypeName.TabIndex = 2;
this.textTypeName.Text = "";
//
// panel1
//
this.panel1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.panel1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.panel1.Controls.Add(this.label4);
this.panel1.Controls.Add(this.label3);
this.panel1.Controls.Add(this.checkTelephone);
this.panel1.Controls.Add(this.label2);
this.panel1.Controls.Add(this.label5);
this.panel1.Controls.Add(this.textPrice);
this.panel1.Controls.Add(this.textTypeName);
this.panel1.Controls.Add(this.checkToilet);
this.panel1.Controls.Add(this.checkTV);
this.panel1.Controls.Add(this.textBedNum);
this.panel1.Controls.Add(this.textArea);
this.panel1.Controls.Add(this.checkAirCondition);
this.panel1.ForeColor = System.Drawing.SystemColors.Desktop;
this.panel1.Location = new System.Drawing.Point(16, 16);
this.panel1.Name = "panel1";
this.panel1.Size = new System.Drawing.Size(498, 76);
this.panel1.TabIndex = 16;
//
// listView1
//
this.listView1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.listView1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.listView1.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] {
this.columnHeader1,
this.columnHeader3,
this.columnHeader2,
this.columnHeader4,
this.columnHeader7,
this.columnHeader6,
this.columnHeader5,
this.columnHeader8});
this.listView1.ForeColor = System.Drawing.SystemColors.Desktop;
this.listView1.FullRowSelect = true;
this.listView1.GridLines = true;
this.listView1.HeaderStyle = System.Windows.Forms.ColumnHeaderStyle.Nonclickable;
listViewItem1.Checked = true;
listViewItem1.StateImageIndex = 1;
this.listView1.Items.AddRange(new System.Windows.Forms.ListViewItem[] {
listViewItem1});
this.listView1.Location = new System.Drawing.Point(16, 124);
this.listView1.MultiSelect = false;
this.listView1.Name = "listView1";
this.listView1.Size = new System.Drawing.Size(498, 312);
this.listView1.TabIndex = 17;
this.listView1.View = System.Windows.Forms.View.Details;
this.listView1.SelectedIndexChanged += new System.EventHandler(this.listView1_SelectedIndexChanged);
//
// columnHeader1
//
this.columnHeader1.Text = "类型名称";
this.columnHeader1.Width = 80;
//
// columnHeader3
//
this.columnHeader3.Text = "面积";
//
// columnHeader2
//
this.columnHeader2.Text = "床位";
this.columnHeader2.Width = 50;
//
// columnHeader4
//
this.columnHeader4.Text = "价钱";
//
// columnHeader7
//
this.columnHeader7.Text = "空调";
this.columnHeader7.Width = 50;
//
// columnHeader6
//
this.columnHeader6.Text = "电话";
this.columnHeader6.Width = 50;
//
// columnHeader5
//
this.columnHeader5.Text = "电视";
this.columnHeader5.Width = 50;
//
// columnHeader8
//
this.columnHeader8.Text = "卫生间";
this.columnHeader8.Width = 50;
//
// panel2
//
this.panel2.BackColor = System.Drawing.SystemColors.Window;
this.panel2.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.panel2.Controls.Add(this.btnStart);
this.panel2.Controls.Add(this.label7);
this.panel2.Controls.Add(this.textSearch);
this.panel2.Controls.Add(this.btnSearch);
this.panel2.Controls.Add(this.btnDelete);
this.panel2.Controls.Add(this.btnNew);
this.panel2.Controls.Add(this.btnSave);
this.panel2.Controls.Add(this.btnCancel);
this.panel2.Controls.Add(this.btnExit);
this.panel2.Dock = System.Windows.Forms.DockStyle.Right;
this.panel2.ForeColor = System.Drawing.SystemColors.Desktop;
this.panel2.Location = new System.Drawing.Point(556, 0);
this.panel2.Name = "panel2";
this.panel2.Size = new System.Drawing.Size(88, 475);
this.panel2.TabIndex = 19;
//
// btnStart
//
this.btnStart.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnStart.Image = ((System.Drawing.Image)(resources.GetObject("btnStart.Image")));
this.btnStart.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft;
this.btnStart.Location = new System.Drawing.Point(16, 176);
this.btnStart.Name = "btnStart";
this.btnStart.Size = new System.Drawing.Size(56, 23);
this.btnStart.TabIndex = 23;
this.btnStart.Text = "开始";
this.btnStart.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
this.btnStart.Click += new System.EventHandler(this.btnStart_Click);
//
// label7
//
this.label7.BackColor = System.Drawing.Color.White;
this.label7.Location = new System.Drawing.Point(8, 112);
this.label7.Name = "label7";
this.label7.Size = new System.Drawing.Size(72, 25);
this.label7.TabIndex = 22;
this.label7.Text = "输入房间号";
this.label7.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
//
// textSearch
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -