📄 tfdj.cs
字号:
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
namespace 中小型酒店管理信息系统
{
/// <summary>
/// tfdj 的摘要说明。
/// </summary>
public class tfdj : System.Windows.Forms.Form
{
private System.Windows.Forms.Label label1;
private System.Windows.Forms.ComboBox comboBox1;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.ComboBox comboBox2;
private System.Windows.Forms.Button button1;
/// <summary>
/// 必需的设计器变量。
/// </summary>
private System.ComponentModel.Container components = null;
private DataSet ds = new DataSet();
private DataSet ds1 = new DataSet();
private DataSet ds2 = new DataSet();
private LinkDataBase link = new LinkDataBase();
private LinkDataBase link1 = new LinkDataBase();
private LinkDataBase link2 = new LinkDataBase();
public tfdj()
{
//
// 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.comboBox1 = new System.Windows.Forms.ComboBox();
this.label2 = new System.Windows.Forms.Label();
this.comboBox2 = new System.Windows.Forms.ComboBox();
this.button1 = new System.Windows.Forms.Button();
this.SuspendLayout();
//
// label1
//
this.label1.Location = new System.Drawing.Point(32, 40);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(128, 16);
this.label1.TabIndex = 0;
this.label1.Text = "已经入住的房间号";
//
// comboBox1
//
this.comboBox1.Location = new System.Drawing.Point(160, 32);
this.comboBox1.Name = "comboBox1";
this.comboBox1.Size = new System.Drawing.Size(121, 20);
this.comboBox1.TabIndex = 1;
this.comboBox1.Text = "comboBox1";
//
// label2
//
this.label2.Location = new System.Drawing.Point(40, 80);
this.label2.Name = "label2";
this.label2.TabIndex = 2;
this.label2.Text = "要调换的房间号";
//
// comboBox2
//
this.comboBox2.Location = new System.Drawing.Point(160, 72);
this.comboBox2.Name = "comboBox2";
this.comboBox2.Size = new System.Drawing.Size(121, 20);
this.comboBox2.TabIndex = 3;
this.comboBox2.Text = "comboBox2";
//
// button1
//
this.button1.Location = new System.Drawing.Point(136, 120);
this.button1.Name = "button1";
this.button1.TabIndex = 4;
this.button1.Text = "确定";
this.button1.Click += new System.EventHandler(this.button1_Click);
//
// tfdj
//
this.AutoScaleBaseSize = new System.Drawing.Size(6, 14);
this.ClientSize = new System.Drawing.Size(392, 173);
this.Controls.Add(this.button1);
this.Controls.Add(this.comboBox2);
this.Controls.Add(this.label2);
this.Controls.Add(this.comboBox1);
this.Controls.Add(this.label1);
this.Name = "tfdj";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
this.Text = "【调房登记】";
this.Load += new System.EventHandler(this.tfdj_Load);
this.ResumeLayout(false);
}
#endregion
private void tfdj_Load(object sender, System.EventArgs e)
{
scfjh("入住");
scfjh1("空房");
}
private void scfjh(string kong) //生成房间号
{
string sendTableName = "jud_kfxx";
string sendStrSQL ="select fjh from jud_kfxx where ft like'"+kong+"'";
this.ds = this.link.SelectDataBase(sendStrSQL,sendTableName);
comboBox1.DataSource = ds.Tables[sendTableName];
comboBox1.DisplayMember = "fjh";
}
private void scfjh1(string kong) //生成房间号
{
string sendTableName = "jud_kfxx";
string sendStrSQL ="select fjh from jud_kfxx where ft like'"+kong+"'";
this.ds2 = this.link2.SelectDataBase(sendStrSQL,sendTableName);
comboBox2.DataSource = ds2.Tables[sendTableName];
comboBox2.DisplayMember = "fjh";
}
private void button1_Click(object sender, System.EventArgs e)
{
if(MessageBox.Show("确实要调换房间吗?","询问",MessageBoxButtons.YesNo) == DialogResult.Yes)
{
MessageBox.Show("房间调换成功!","提示");
}
else{MessageBox.Show("房间没有调换!","提示");}
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -