📄 fmroomcoding.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>
/// fmRoomCoding 的摘要说明。
/// </summary>
public class fmRoomCoding : System.Windows.Forms.Form
{
private System.Windows.Forms.Label label1;
private System.Windows.Forms.Button btnSure;
private System.Windows.Forms.Button btnCancel;
private System.Windows.Forms.TextBox txtCoding;
/// <summary>
/// 必需的设计器变量。
/// </summary>
//Download:http://www.codefans.net
private System.ComponentModel.Container components = null;
public fmRoomCoding()
{
//
// 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.txtCoding = 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(24, 16);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(144, 23);
this.label1.TabIndex = 0;
this.label1.Text = "请输入要开单的房间号:";
this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
//
// txtCoding
//
this.txtCoding.Location = new System.Drawing.Point(24, 40);
this.txtCoding.Name = "txtCoding";
this.txtCoding.Size = new System.Drawing.Size(224, 21);
this.txtCoding.TabIndex = 1;
this.txtCoding.Text = "";
//
// btnSure
//
this.btnSure.Location = new System.Drawing.Point(56, 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(152, 72);
this.btnCancel.Name = "btnCancel";
this.btnCancel.TabIndex = 3;
this.btnCancel.Text = "取消";
this.btnCancel.Click += new System.EventHandler(this.btnCancel_Click);
//
// fmRoomCoding
//
this.AutoScaleBaseSize = new System.Drawing.Size(6, 14);
this.BackColor = System.Drawing.Color.MistyRose;
this.ClientSize = new System.Drawing.Size(272, 104);
this.Controls.Add(this.btnCancel);
this.Controls.Add(this.btnSure);
this.Controls.Add(this.txtCoding);
this.Controls.Add(this.label1);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
this.Name = "fmRoomCoding";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
this.Text = "fmRoomCoding";
this.ResumeLayout(false);
}
#endregion
private void btnCancel_Click(object sender, System.EventArgs e)
{
this.Close();
}
private void btnSure_Click(object sender, System.EventArgs e)
{
fmOpenGuest fog=new fmOpenGuest();
fog.getRoomCoding(this.txtCoding.Text.Trim());
NewRoom_JugeRoomData jugedata=new NewRoom_JugeRoomData();
NewRoom_JugeRoomBusiness jugebusiness=new NewRoom_JugeRoomBusiness();
jugebusiness.jugeRoomBusiness(this.txtCoding.Text.Trim(),jugedata);
//int state=jugebusiness.Checkstate(int.Parse(jugedata.view_NewRoom_JugeRoom.Rows[0]["RstateId"].ToString()));
//int state=jugebusiness.Checkstate(jugedata.view_NewRoom_JugeRoom.Rows[0]["RstateId"]);
if(int.Parse(jugedata.view_NewRoom_JugeRoom.Rows[0]["RstateId"].ToString())==2)
{
MessageBox.Show(null,"该房间处于非可供状态!","提示",MessageBoxButtons.OK,MessageBoxIcon.Warning);
return;
}
if(int.Parse(jugedata.view_NewRoom_JugeRoom.Rows[0]["RstateId"].ToString())==5)
{
string str="["+this.txtCoding.Text.Trim()+"]正处于[清理]状态,请确定是否开单";
DialogResult objDialogResult=MessageBox.Show(str,"确认",MessageBoxButtons.YesNo,MessageBoxIcon.Question);
if(objDialogResult==DialogResult.No)
{
return;
}
else
{
fog.Show();
this.Close();
}
}
else
{
fog.Show();
this.Close();
}
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -