glysql.cs

来自「一个酒店管理系统」· CS 代码 · 共 87 行

CS
87
字号
using System;
using System.Data.SqlClient;
using System.Data;
using System.Windows.Forms;
namespace bggl.cs
{
	/// <summary>
	/// gly 的摘要说明。
	/// </summary>
	
	public class glysql
	{
		conn.conn con=new bggl.conn.conn();
		DataSet objset;
		public glysql()
		{
			//
			// TODO: 在此处添加构造函数逻辑
			//
		}
		public bool insertexe(string name,string pass,string qx){
			string sqlins="insert into BG_GLY values('"+name+"','"+pass+"','"+qx+"')";
			try
			{
				return con.execomm(sqlins);
			}
			catch(Exception ex){
				MessageBox.Show(ex.ToString());
				return false;
			}
		}

		public DataSet selectexe(){
			string sqlselect="select gid 管理员ID,gname 管理员名,gpass 管理员密码,gqx 管理员权限 from BG_GLY";
			try
			{
				return objset=con.selectexe(sqlselect,"gly");
			}
			catch(Exception e){
					MessageBox.Show(e.ToString());
			}
			return objset;
		}
		public DataSet selectexe1(int i)
		{
			string sqlselect="select * from BG_GLY where gid="+i+"";
			try
			{
				objset=con.selectexe(sqlselect,"gly");
			}
			catch(Exception e)
			{
				MessageBox.Show(e.ToString());
			}
			return objset;
		}
		public bool delexe(string del){
			string delsql="delete from BG_GLY where gid="+del+"";
			try
			{
				return con.execomm(delsql);
			}
			catch(Exception ex)
			{
				MessageBox.Show(ex.ToString());
				return false;
			}
		}
		public bool upexe(string name,string pass,string qx,int gid)
		{
			string upsql="update BG_GLY set gname='"+name+"',gpass='"+pass+"',gqx='"+qx+"' where gid="+gid+"";
			try
			{
				return con.execomm(upsql);
			}
			catch(Exception ex)
			{
				MessageBox.Show(ex.ToString());
				return false;
			}
		}
		

		}
	}

⌨️ 快捷键说明

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