📄 ydck.cs
字号:
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
namespace bggl.fm
{
/// <summary>
/// ydck 的摘要说明。
/// </summary>
public class ydck : System.Windows.Forms.Form
{
private System.Windows.Forms.ComboBox comboBox2;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.ListView listView5;
private System.Windows.Forms.ColumnHeader columnHeader25;
private System.Windows.Forms.ColumnHeader columnHeader26;
private System.Windows.Forms.ColumnHeader columnHeader27;
private System.Windows.Forms.ColumnHeader columnHeader29;
private System.Windows.Forms.Button button1;
TextBox cb;
string z="";
/// <summary>
/// 必需的设计器变量。
/// </summary>
private System.ComponentModel.Container components = null;
public ydck(TextBox cbz)
{
//
// Windows 窗体设计器支持所必需的
//
InitializeComponent();
cb=cbz;
//
// 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.comboBox2 = new System.Windows.Forms.ComboBox();
this.label2 = new System.Windows.Forms.Label();
this.listView5 = new System.Windows.Forms.ListView();
this.columnHeader25 = new System.Windows.Forms.ColumnHeader();
this.columnHeader26 = new System.Windows.Forms.ColumnHeader();
this.columnHeader27 = new System.Windows.Forms.ColumnHeader();
this.columnHeader29 = new System.Windows.Forms.ColumnHeader();
this.button1 = new System.Windows.Forms.Button();
this.SuspendLayout();
//
// comboBox2
//
this.comboBox2.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.comboBox2.ItemHeight = 12;
this.comboBox2.Location = new System.Drawing.Point(152, 14);
this.comboBox2.Name = "comboBox2";
this.comboBox2.Size = new System.Drawing.Size(152, 20);
this.comboBox2.TabIndex = 22;
this.comboBox2.SelectedIndexChanged += new System.EventHandler(this.comboBox2_SelectedIndexChanged);
//
// label2
//
this.label2.Location = new System.Drawing.Point(16, 16);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(128, 16);
this.label2.TabIndex = 21;
this.label2.Text = "您要显示的房间类型:";
//
// listView5
//
this.listView5.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.listView5.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] {
this.columnHeader25,
this.columnHeader26,
this.columnHeader27,
this.columnHeader29});
this.listView5.FullRowSelect = true;
this.listView5.GridLines = true;
this.listView5.Location = new System.Drawing.Point(8, 48);
this.listView5.Name = "listView5";
this.listView5.Size = new System.Drawing.Size(384, 160);
this.listView5.TabIndex = 20;
this.listView5.View = System.Windows.Forms.View.Details;
this.listView5.DoubleClick += new System.EventHandler(this.listView5_DoubleClick);
//
// columnHeader25
//
this.columnHeader25.Text = "房间号";
this.columnHeader25.Width = 80;
//
// columnHeader26
//
this.columnHeader26.Text = "客房楼层";
this.columnHeader26.Width = 100;
//
// columnHeader27
//
this.columnHeader27.Text = "客房类型";
this.columnHeader27.Width = 100;
//
// columnHeader29
//
this.columnHeader29.Text = "客房电话";
this.columnHeader29.Width = 100;
//
// button1
//
this.button1.Location = new System.Drawing.Point(320, 12);
this.button1.Name = "button1";
this.button1.Size = new System.Drawing.Size(64, 24);
this.button1.TabIndex = 23;
this.button1.Text = "取消";
this.button1.Click += new System.EventHandler(this.button1_Click);
//
// ydck
//
this.AutoScaleBaseSize = new System.Drawing.Size(6, 14);
this.ClientSize = new System.Drawing.Size(400, 213);
this.Controls.Add(this.button1);
this.Controls.Add(this.comboBox2);
this.Controls.Add(this.label2);
this.Controls.Add(this.listView5);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
this.MaximizeBox = false;
this.Name = "ydck";
this.ShowInTaskbar = false;
this.StartPosition = System.Windows.Forms.FormStartPosition.Manual;
this.Text = "ydck";
this.Load += new System.EventHandler(this.ydck_Load);
this.ResumeLayout(false);
}
#endregion
private void ydck_Load(object sender, System.EventArgs e)
{
setlv();
cs.fjlx flsql=new bggl.cs.fjlx();
DataSet fjobjset=flsql.selectexe();
this.comboBox2.Items.Clear();
foreach(DataRow dr in fjobjset.Tables[0].Rows)
{
this.comboBox2.Items.Add(dr["xname"].ToString());
}
this.comboBox2.SelectedIndex=0;
}
private void setlv()
{
cs.kfsql kfsq=new bggl.cs.kfsql();
DataSet objset=kfsq.selectexeshu();
this.listView5.Items.Clear();
foreach(DataRow dr in objset.Tables[0].Rows)//循环记录
{
if(dr["kzt"].ToString().Trim()=="")
{
ListViewItem lst=new ListViewItem();
lst.SubItems.Clear();
lst.SubItems[0].Text=dr["kid"].ToString();
lst.SubItems.Add(dr["klc"].ToString());
lst.SubItems.Add(dr["klx"].ToString());
lst.SubItems.Add(dr["kdh"].ToString());
this.listView5.Items.Add(lst);
}
}
}
private void listView5_DoubleClick(object sender, System.EventArgs e)
{
z=this.listView5.SelectedItems[0].SubItems[0].Text;
cb.Text=z.ToString().Trim();
this.Close();
}
private void comboBox2_SelectedIndexChanged(object sender, System.EventArgs e)
{
cs.kfsql ksql=new bggl.cs.kfsql();
DataSet kfobjset=ksql.selectexeshu();
this.listView5.Items.Clear();
foreach(DataRow dr in kfobjset.Tables[0].Rows)
{
if(this.comboBox2.Text.Trim()==dr["klx"].ToString().Trim())
{
if(dr["kzt"].ToString().Trim()=="")
{
ListViewItem lst=new ListViewItem();
lst.SubItems.Clear();
lst.SubItems[0].Text=dr["kid"].ToString();
lst.SubItems.Add(dr["klc"].ToString());
lst.SubItems.Add(dr["klx"].ToString());
lst.SubItems.Add(dr["kdh"].ToString());
this.listView5.Items.Add(lst);
}
}
}
}
private void button1_Click(object sender, System.EventArgs e)
{
this.Close();
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -