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

📄 kfyw.cs

📁 一个酒店管理系统
💻 CS
📖 第 1 页 / 共 2 页
字号:
			this.button3.Name = "button3";
			this.button3.Size = new System.Drawing.Size(24, 21);
			this.button3.TabIndex = 19;
			this.button3.Click += new System.EventHandler(this.button3_Click);
			// 
			// groupBox2
			// 
			this.groupBox2.Controls.Add(this.radioButton2);
			this.groupBox2.Controls.Add(this.radioButton1);
			this.groupBox2.Controls.Add(this.label14);
			this.groupBox2.Controls.Add(this.textBox7);
			this.groupBox2.Controls.Add(this.label13);
			this.groupBox2.Controls.Add(this.textBox6);
			this.groupBox2.Location = new System.Drawing.Point(8, 144);
			this.groupBox2.Name = "groupBox2";
			this.groupBox2.Size = new System.Drawing.Size(592, 56);
			this.groupBox2.TabIndex = 19;
			this.groupBox2.TabStop = false;
			this.groupBox2.Text = "消费信息";
			// 
			// radioButton2
			// 
			this.radioButton2.Checked = true;
			this.radioButton2.Location = new System.Drawing.Point(488, 24);
			this.radioButton2.Name = "radioButton2";
			this.radioButton2.Size = new System.Drawing.Size(64, 24);
			this.radioButton2.TabIndex = 13;
			this.radioButton2.TabStop = true;
			this.radioButton2.Text = "正常";
			this.radioButton2.Click += new System.EventHandler(this.radioButton2_Click);
			// 
			// radioButton1
			// 
			this.radioButton1.Location = new System.Drawing.Point(408, 24);
			this.radioButton1.Name = "radioButton1";
			this.radioButton1.Size = new System.Drawing.Size(64, 24);
			this.radioButton1.TabIndex = 12;
			this.radioButton1.Text = "钟点";
			this.radioButton1.Click += new System.EventHandler(this.radioButton1_Click);
			this.radioButton1.CheckedChanged += new System.EventHandler(this.radioButton1_CheckedChanged);
			// 
			// label14
			// 
			this.label14.Location = new System.Drawing.Point(208, 24);
			this.label14.Name = "label14";
			this.label14.Size = new System.Drawing.Size(64, 16);
			this.label14.TabIndex = 10;
			this.label14.Text = "实际单价:";
			// 
			// textBox7
			// 
			this.textBox7.Enabled = false;
			this.textBox7.Location = new System.Drawing.Point(280, 24);
			this.textBox7.Name = "textBox7";
			this.textBox7.Size = new System.Drawing.Size(112, 21);
			this.textBox7.TabIndex = 11;
			this.textBox7.Text = "";
			this.textBox7.TextChanged += new System.EventHandler(this.textBox7_TextChanged);
			// 
			// label13
			// 
			this.label13.Location = new System.Drawing.Point(8, 24);
			this.label13.Name = "label13";
			this.label13.Size = new System.Drawing.Size(64, 16);
			this.label13.TabIndex = 8;
			this.label13.Text = "折扣:";
			// 
			// textBox6
			// 
			this.textBox6.Location = new System.Drawing.Point(80, 24);
			this.textBox6.Name = "textBox6";
			this.textBox6.Size = new System.Drawing.Size(112, 21);
			this.textBox6.TabIndex = 9;
			this.textBox6.Text = "1.00";
			this.textBox6.Leave += new System.EventHandler(this.textBox6_Leave);
			// 
			// button1
			// 
			this.button1.Location = new System.Drawing.Point(344, 216);
			this.button1.Name = "button1";
			this.button1.Size = new System.Drawing.Size(96, 24);
			this.button1.TabIndex = 20;
			this.button1.Text = "确定";
			this.button1.Click += new System.EventHandler(this.button1_Click);
			// 
			// button2
			// 
			this.button2.Location = new System.Drawing.Point(472, 216);
			this.button2.Name = "button2";
			this.button2.Size = new System.Drawing.Size(96, 24);
			this.button2.TabIndex = 21;
			this.button2.Text = "取消";
			this.button2.Click += new System.EventHandler(this.button2_Click);
			// 
			// kfyw
			// 
			this.AutoScaleBaseSize = new System.Drawing.Size(6, 14);
			this.ClientSize = new System.Drawing.Size(608, 253);
			this.Controls.Add(this.button2);
			this.Controls.Add(this.button1);
			this.Controls.Add(this.groupBox2);
			this.Controls.Add(this.groupBox1);
			this.MaximizeBox = false;
			this.Name = "kfyw";
			this.ShowInTaskbar = false;
			this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
			this.Text = "房间开单";
			this.Load += new System.EventHandler(this.kfyw_Load);
			this.groupBox1.ResumeLayout(false);
			this.groupBox2.ResumeLayout(false);
			this.ResumeLayout(false);

		}
		#endregion

		private void kfyw_Load(object sender, System.EventArgs e)
		{
			fz();
			this.comboBox1.Items.Add("男");
			this.comboBox1.Items.Add("女");
			this.comboBox1.SelectedIndex=0;
		
		}
		private void fz()
		{
			if(this.textBox4.Text.Trim()=="")//如果会员号为空 折扣为1
			{
				this.textBox6.Text="1.00";
			}
			label2.Text=fjhm;
			cs.kfsql kfsq=new bggl.cs.kfsql();
			string fjl=kfsq.fjlx(fjhm);//获得当前房间的房间类型
			this.label4.Text=fjl;
			cs.fjlx fjlxsq=new bggl.cs.fjlx();
			string qian;
			if(this.radioButton1.Checked)//根据选择设置钟点还是正常价钱
			{
				qian=fjlxsq.jq(fjl,"1");
			}
			else
			{
				qian=fjlxsq.jq(fjl,"0");
			}
			this.label6.Text=qian.Trim();//获得价钱放入价钱面板
			float z=float.Parse(qian)*float.Parse(this.textBox6.Text.Trim());
			this.textBox7.Text=z.ToString().Trim();
			this.textBox5.Text=fjlxsq.yjdc(fjl);
		}

		private void radioButton1_Click(object sender, System.EventArgs e)
		{
			fz();
		
		}

		private void radioButton2_Click(object sender, System.EventArgs e)
		{
			fz();
		
		}


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

		private void button1_Click(object sender, System.EventArgs e)
		{
			if(this.textBox1.Text.Trim()!=""&&this.textBox2.Text.Trim()!=""&&this.textBox3.Text.Trim()!=""&&this.textBox5.Text.Trim()!=""&&this.textBox6.Text.Trim()!="")
			{
				cs.kfsql kfsq=new bggl.cs.kfsql();
				string zd="";
				if(this.radioButton1.Checked)
				{
					zd="1";//钟点选中是1;
				}
				else
				{
					zd="2";//没选是2;
				}
				bool pd=kfsq.updateexek(this.label2.Text,this.textBox1.Text,this.comboBox1.Text,this.textBox2.Text,this.textBox3.Text,this.textBox4.Text,zd,this.textBox5.Text,this.textBox6.Text);
				if(pd==true)
				{
					MessageBox.Show("登记成功");
					setlv();
					this.Close();
				}
				else
				{
					MessageBox.Show("登记失败,请重新登记");
					setlv();
				}
				
			}
			else{
				MessageBox.Show("资料填写不完整,请重新填写!");
			}
		
		}

		private void radioButton1_CheckedChanged(object sender, System.EventArgs e)
		{
		
		}
		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)
				{
					//点选房间树如果房间类型或 房间名相同就在lv1中显示值
					if(dr["kid"].ToString().Trim()==chuan.Trim()||dr["klx"].ToString().Trim()==chuan.Trim()||chuan.Trim()=="房间")
					{
						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); 
					}
				}		
			}
			
		

		private void textBox7_TextChanged(object sender, System.EventArgs e)
		{
			gong.zhipd zhi=new bggl.gong.zhipd();
			if(zhi.zhi(this.textBox5.Text.Trim())!=true)
			{
				MessageBox.Show("价格只能输入数字!");
				this.textBox5.Text="";
			}
		}

		private void textBox5_TextChanged(object sender, System.EventArgs e)
		{
			gong.zhipd zhi=new bggl.gong.zhipd();
			if(zhi.zhi(this.textBox5.Text.Trim())!=true)
			{
				MessageBox.Show("价格只能输入数字!");
				this.textBox5.Text="";
			}
		}

		private void textBox3_TextChanged(object sender, System.EventArgs e)
		{
			gong.zhipd zhi=new bggl.gong.zhipd();
			if(zhi.zhi(this.textBox3.Text.Trim())!=true)
			{
				MessageBox.Show("只能输入数字!");
				this.textBox3.Text="";
			}
		}

		private void button3_Click(object sender, System.EventArgs e)
		{
			//获得鼠标位置
			int x=Control.MousePosition.X;
			int y=Control.MousePosition.Y;
			hyxs hyx=new hyxs(this.textBox1,this.comboBox1,this.textBox2,this.textBox4,this.textBox6,1);
			//设置出现位置
			hyx.Location = new System.Drawing.Point(x, y);
			hyx.ShowDialog();

		}

		private void textBox6_Leave(object sender, System.EventArgs e)
		{
			gong.zhipd zhi=new bggl.gong.zhipd();
			if(zhi.zhi(this.textBox6.Text.Trim())!=true)
			{
				MessageBox.Show("折扣只能输入数字!");
				this.textBox5.Text="";
			}
			else if(this.textBox6.Text.Trim()!="")
			{
				float z=float.Parse(this.label6.Text.Trim())*float.Parse(this.textBox6.Text.Trim());
				this.textBox7.Text=z.ToString().Trim();
			}
		}
	}
}

⌨️ 快捷键说明

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