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

📄 ydjc.cs

📁 一个酒店管理系统
💻 CS
字号:
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Threading;
using System.Data;

namespace bggl.fm
{
	/// <summary>
	/// ydjc 的摘要说明。
	/// </summary>
	public class ydjc : System.Windows.Forms.Form
	{
		public System.Windows.Forms.Timer timer1;
		private System.Windows.Forms.Label label2;
		private System.ComponentModel.IContainer components;
		int x=0;
		private System.Windows.Forms.Label label1;
		int y=120;
		private System.Windows.Forms.LinkLabel linkLabel1;
		private System.Windows.Forms.LinkLabel linkLabel2;
		private System.Windows.Forms.LinkLabel linkLabel3;
		string fjh="";
		int w=0;
		ListView lv;

		public ydjc(string z,int q)
		{
			//
			// Windows 窗体设计器支持所必需的
			//
			InitializeComponent();
			fjh=z;
			w=q;
			//
			// TODO: 在 InitializeComponent 调用后添加任何构造函数代码
			//
		}
		public ydjc(string z,int q,ListView lvv)
		{
			//
			// Windows 窗体设计器支持所必需的
			//
			InitializeComponent();
			fjh=z;
			w=q;
			lv=lvv;
			//
			// 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.components = new System.ComponentModel.Container();
			this.timer1 = new System.Windows.Forms.Timer(this.components);
			this.label2 = new System.Windows.Forms.Label();
			this.label1 = new System.Windows.Forms.Label();
			this.linkLabel1 = new System.Windows.Forms.LinkLabel();
			this.linkLabel2 = new System.Windows.Forms.LinkLabel();
			this.linkLabel3 = new System.Windows.Forms.LinkLabel();
			this.SuspendLayout();
			// 
			// timer1
			// 
			this.timer1.Interval = 50;
			this.timer1.Tick += new System.EventHandler(this.timer1_Tick);
			// 
			// label2
			// 
			this.label2.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(134)));
			this.label2.Location = new System.Drawing.Point(216, 8);
			this.label2.Name = "label2";
			this.label2.Size = new System.Drawing.Size(24, 24);
			this.label2.TabIndex = 1;
			this.label2.Text = "x";
			this.label2.Click += new System.EventHandler(this.label2_Click);
			// 
			// label1
			// 
			this.label1.Location = new System.Drawing.Point(48, 40);
			this.label1.Name = "label1";
			this.label1.Size = new System.Drawing.Size(160, 32);
			this.label1.TabIndex = 2;
			this.label1.Text = "label1";
			// 
			// linkLabel1
			// 
			this.linkLabel1.Location = new System.Drawing.Point(96, 104);
			this.linkLabel1.Name = "linkLabel1";
			this.linkLabel1.Size = new System.Drawing.Size(48, 16);
			this.linkLabel1.TabIndex = 3;
			this.linkLabel1.TabStop = true;
			this.linkLabel1.Text = "知道了";
			this.linkLabel1.Visible = false;
			this.linkLabel1.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.linkLabel1_LinkClicked);
			// 
			// linkLabel2
			// 
			this.linkLabel2.Location = new System.Drawing.Point(56, 104);
			this.linkLabel2.Name = "linkLabel2";
			this.linkLabel2.Size = new System.Drawing.Size(56, 16);
			this.linkLabel2.TabIndex = 4;
			this.linkLabel2.TabStop = true;
			this.linkLabel2.Text = "删除记录";
			this.linkLabel2.Visible = false;
			this.linkLabel2.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.linkLabel2_LinkClicked);
			// 
			// linkLabel3
			// 
			this.linkLabel3.Location = new System.Drawing.Point(160, 104);
			this.linkLabel3.Name = "linkLabel3";
			this.linkLabel3.Size = new System.Drawing.Size(32, 16);
			this.linkLabel3.TabIndex = 5;
			this.linkLabel3.TabStop = true;
			this.linkLabel3.Text = "设置";
			this.linkLabel3.Visible = false;
			this.linkLabel3.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.linkLabel3_LinkClicked);
			// 
			// ydjc
			// 
			this.AutoScaleBaseSize = new System.Drawing.Size(6, 14);
			this.ClientSize = new System.Drawing.Size(250, 150);
			this.Controls.Add(this.linkLabel3);
			this.Controls.Add(this.linkLabel2);
			this.Controls.Add(this.linkLabel1);
			this.Controls.Add(this.label1);
			this.Controls.Add(this.label2);
			this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
			this.Name = "ydjc";
			this.Opacity = 0.8;
			this.ShowInTaskbar = false;
			this.StartPosition = System.Windows.Forms.FormStartPosition.Manual;
			this.Text = "ydjc";
			this.TopMost = true;
			this.Load += new System.EventHandler(this.ydjc_Load);
			this.ResumeLayout(false);

		}
		#endregion

		private void label2_Click(object sender, System.EventArgs e)
		{
			this.Close();

		}

		public void timer1_Tick(object sender, System.EventArgs e)
		{

		
			x=this.Location.X;
			y=y-5;
			this.Location=new System.Drawing.Point(x,this.Location.Y-5);
			if(y<0)
			{
				this.timer1.Stop();
			}
		
		}

		private void ydjc_Load(object sender, System.EventArgs e)
		{
			
			this.timer1.Start();
			if(w==2)
			{
				this.label1.Text=fjh.Trim()+"号房的押金以不足";
				this.linkLabel1.Visible=true;
			}
			else{
				this.label1.Text=fjh.Trim()+"号房的预定时间以到,请做出处理";
				this.linkLabel2.Visible=true;
				this.linkLabel3.Visible=true;
			}
			
		}

		private void linkLabel1_LinkClicked(object sender, System.Windows.Forms.LinkLabelLinkClickedEventArgs e)
		{
			this.Close();
		}

		private void linkLabel3_LinkClicked(object sender, System.Windows.Forms.LinkLabelLinkClickedEventArgs e)
		{
			kfyd kf=new kfyd(fjh,lv);
			this.Close();
			kf.ShowDialog();
			
		}

		private void linkLabel2_LinkClicked(object sender, System.Windows.Forms.LinkLabelLinkClickedEventArgs e)
		{
			DialogResult panduan=new DialogResult();
			panduan=MessageBox.Show("您确定删除当前预定吗?","确认",MessageBoxButtons.YesNo,MessageBoxIcon.Question);
			if(panduan==DialogResult.Yes)
			{
				cs.ydsql ydsq=new bggl.cs.ydsql();
				bool pd=ydsq.delexe1(fjh.Trim());
				if(pd==true)
				{
					MessageBox.Show("删除成功");
					this.Close();
					setlv();
				}
				else
				{
					MessageBox.Show("删除失败,请重新操作!");
				}
			}
		}
		private void setlv(){
			int z=1;
			ListViewItem lstItem;
			cs.kfsql kfsql=new bggl.cs.kfsql();
			DataSet objsetkf=new DataSet();
			objsetkf=kfsql.selectexeshu();
			this.lv.Items.Clear();
			foreach(DataRow dr in objsetkf.Tables[0].Rows)
			{
				if(dr["kzt"].ToString().Trim()=="")
				{
					z=2;
				}
				else if(dr["kzt"].ToString().Trim()=="1")
				{
					z=0;
				}
				else if(dr["kzt"].ToString().Trim()=="2")
				{
					z=1;
					
				}
				lstItem=new ListViewItem();
				lstItem.ImageIndex=z;
				lstItem.SubItems[0].Text=dr["kid"].ToString().Trim();
				this.lv.Items.Add(lstItem); 
			}	
		}
	}
}

⌨️ 快捷键说明

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