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

📄 ydsql.cs

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

namespace bggl.cs
{
	/// <summary>
	/// ydsql 的摘要说明。
	/// </summary>
	public class ydsql
	{
		conn.conn con=new bggl.conn.conn();
		DataSet objset;
		public ydsql()
		{
			//
			// TODO: 在此处添加构造函数逻辑
			//
		}
		public DataSet selectexe()
		{
			string selectsql="select * from BG_YDB";
			try
			{
				objset=con.selectexe(selectsql,"BG_KF");
			}
			catch(Exception e)
			{
				MessageBox.Show(e.ToString());
			}
			return objset;
		}
		public DataSet selectexe(string rq)
		{
			string selectsql="select * from BG_YDB where yddsj='"+rq+"'";
			try
			{
				objset=con.selectexe(selectsql,"BG_YDB");
			}
			catch(Exception e)
			{
				MessageBox.Show(e.ToString());
			}
			return objset;
		}
		public bool insertexe(string yname,string yfj,string yydsj,string ydh,string yddsj,string yhyh,string yzs)
		{
			string inssql="insert into BG_YDB values('"+yname+"','"+yfj+"','"+yydsj+"','"+ydh+"','"+yddsj+"','"+yhyh+"','"+yzs+"')";

			try
			{
				return con.execomm(inssql);
			}
			catch(Exception ex)
			{
				MessageBox.Show(ex.ToString());
				return false;
			}
		}
		public bool updateexe(string id ,string yname,string yfj,string ydh,string yddsj,string yhyh,string yzs)
		{
			string upsql="update  BG_YDB set yname='"+yname+"',yfj='"+yfj+"',ydh='"+ydh+"',yddsj='"+yddsj+"',yhyh='"+yhyh+"',yzs='"+yzs+"' where yid="+id+"";

			try
			{
				return con.execomm(upsql);
			}
			catch(Exception ex)
			{
				MessageBox.Show(ex.ToString());
				return false;
			}
		}
		public bool delexe(string id)
		{
			string delsql="delete from BG_YDB where yid="+id+"";
			try
			{
				return con.execomm(delsql);
			}
			catch(Exception ex)
			{
				MessageBox.Show(ex.ToString());
				return false;
			}
		}
		public bool delexe1(string fjh)
		{
			string delsql="delete from BG_YDB where yfj="+fjh+"";
			try
			{
				return con.execomm(delsql);
			}
			catch(Exception ex)
			{
				MessageBox.Show(ex.ToString());
				return false;
			}
		}
	}
}

⌨️ 快捷键说明

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