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

📄 sbbsql.cs

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

namespace bggl.cs
{
	/// <summary>
	/// sbbsql 的摘要说明。
	/// </summary>
	public class sbbsql
	{
		conn.conn con=new bggl.conn.conn();
		DataSet objset;
		public sbbsql()
		{
			//
			// TODO: 在此处添加构造函数逻辑
			//
		}
		public DataSet selectexeshu(){
			string selectsql="select distinct slx from BG_SBB";
			try
			{
				objset=con.selectexe(selectsql,"BG_SBB");
			}
			catch(Exception e)
			{
				MessageBox.Show(e.ToString());
			}
			return objset;
		}
		public DataSet selectexeshu2()
		{
			string selectsql="select distinct slx,sname from BG_SBB";
			try
			{
				objset=con.selectexe(selectsql,"BG_SBB");
			}
			catch(Exception e)
			{
				MessageBox.Show(e.ToString());
			}
			return objset;
		}
		public DataSet selectexe()
		{
			string selectsql="select * from BG_SBB";
			try
			{
				objset=con.selectexe(selectsql,"BG_SBB");
			}
			catch(Exception e)
			{
				MessageBox.Show(e.ToString());
			}
			return objset;
		}
		public bool upexetjsb(string id,string sid)
		{
			string upsql;
			if(id.Trim()=="")
			{
				upsql="update BG_SBB set sfjh='' where sid="+sid+"";
			}
			else
			{
				upsql="update BG_SBB set sfjh='"+id+"' where sid="+sid+"";
			}
			try
			{
				con.execomm(upsql);
			}
			catch(Exception ex)
			{
				MessageBox.Show(ex.ToString());
				return false;
			}
			return true;
		}
		public bool insertexe(string slx,string sname,string srq,string sgmr,string sjg,string sbz)
		{
			string inssql;
			if(sbz.Trim()=="")
			{
				inssql="insert into BG_SBB values('"+slx+"','"+sname+"','"+srq+"','"+sgmr+"',"+sjg+",'')";
			}
			else
			{
				inssql="insert into BG_SBB values('"+slx+"','"+sname+"','"+srq+"','"+sgmr+"',"+sjg+",'"+sbz+"')";;
			}
			try
			{
				return con.execomm(inssql);
			}
			catch(Exception ex)
			{
				MessageBox.Show(ex.ToString());
				return false;
			}
		}
		public bool updateexe(string id,string slx,string sname,string srq,string sgmr,string sjg,string sbz)
		{
			string upsql;
			if(sbz=="")
			{
				upsql="update BG_SBB  set slx='"+slx+"',sname='"+sname+"',srq='"+srq+"',sgmr='"+sgmr+"',sjg="+sjg+",sbz='' where sid="+id+"";
			}
			else
			{
				upsql="update BG_SBB  set slx='"+slx+"',sname='"+sname+"',srq='"+srq+"',sgmr='"+sgmr+"',sjg="+sjg+",sbz='"+sbz+"' where sid="+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_SBB where sid="+id+"";
			try
			{
				return con.execomm(delsql);
			}
			catch(Exception ex)
			{
				MessageBox.Show(ex.ToString());
				return false;
			}
		}
	}
}

⌨️ 快捷键说明

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