//登陆操作 public static int Login(UserInfo user) { sqltext = "SELECT COUNT(*) FROM UserInfo Where uid='" + user.Uid + "' AND password='******'AND enable='1'"; int i = (int)SQLHELPER.ExecuteScalar(sqltext); return(i); }
//判断是否是管理员 public static object isAdmin(int uid) { if (uid == 1) { return(1); } sqltext = " select [Admin] from [dbo].[YC_User] where [UID]=" + uid + ""; return(SQLHELPER.ExecuteScalar(sqltext)); }
/// <summary> /// 登录 /// </summary> /// <param name="entity"></param> /// <returns></returns> public int login(UserInfo entity) { string sqltext = "select COUNT(*) from dbo.UserInfo where Name=@name and PassWord=@pwd"; SqlParameter[] parameters = { new SqlParameter("@name", entity.Name), new SqlParameter("@pwd", entity.PassWord) }; return(Convert.ToInt32(SQLHELPER.ExecuteScalar(sqltext, parameters))); }
/// <summary> /// 查询订单是否已关闭 是返回1 /// </summary> /// <param name="oid"></param> /// <returns></returns> public static object isClosed(int oid) { sqltext = " select count(*) from [dbo].[YC_Order] where [isClosed]='1' and [OID]='" + oid + "'"; return(SQLHELPER.ExecuteScalar(sqltext)); }
/// <summary> /// 查询订单是否已完成 是返回1 否返回0 /// </summary> /// <param name="oid"></param> /// <returns></returns> public static object isFinished(int oid) { sqltext = " select count(*) from [dbo].[YC_Order] where [OID]='" + oid + "' and FinishedTime is not NULL"; return(SQLHELPER.ExecuteScalar(sqltext)); }
//查询日程详情 public static object selectDetailByRID(int rid) { sqltext = "select [detail] from [dbo].[richeng] where [rid]='" + rid + "'"; return(SQLHELPER.ExecuteScalar(sqltext)); }
//查询一个 public static string selectDetail(int gid) { sqltext = " select [detail] from [dbo].[Gongggao] where gid='" + gid + "'"; return(SQLHELPER.ExecuteScalar(sqltext).ToString()); }
//查询某一用户的头像url public static object selectMyHeader(int uid) { sqltext = " select [headImgUrl] from [dbo].[UserInfo] where uid='" + uid + "'"; return(SQLHELPER.ExecuteScalar(sqltext)); }
/// <summary> /// 登录 /// </summary> /// <param name="user"></param> /// <returns></returns> public static object login(YC_User user) { sqltext = " select count(*) from [dbo].[YC_User] where [Name]='" + user.Name + "' and [PassWord]='" + user.Password + "'"; return(SQLHELPER.ExecuteScalar(sqltext)); }
/// <summary> /// 查看是否存在这个用户 /// </summary> /// <param name="u"></param> /// <returns></returns> public static object isExists(YC_User u) { sqltext = "select count(*) from [dbo].[YC_User] where [Name]='" + u.Name + "'"; return(SQLHELPER.ExecuteScalar(sqltext)); }
/// <summary> /// 判断输入的用户名对应的密码是否一致 是返回1,不是返回0 /// </summary> /// <param name="u"></param> /// <returns></returns> public static object AuthPwd(YC_User u) { sqltext = " select count(*) from [dbo].[YC_User] where [Name]='" + u.Name + "' AND [PassWord]='" + u.Password + "'"; return(SQLHELPER.ExecuteScalar(sqltext)); }
/// <summary> /// 根据用户名查id /// </summary> /// <param name="name"></param> /// <returns></returns> public static object selectIDbyName(string name) { sqltext = "select [UID] from [dbo].[YC_User] where [Name]='" + name + "'"; return(SQLHELPER.ExecuteScalar(sqltext)); }
/// <summary> /// 统计某一搜索key 的总条数 /// </summary> /// <param name="key"></param> /// <returns></returns> public static object CountByKey(string key) { sqltext = "select count(*) from [dbo].[YC_Goods] where [Name] like '%" + key + "%'"; return(SQLHELPER.ExecuteScalar(sqltext)); }
/// <summary> /// 查找某一分类下的所有商品 /// </summary> /// <param name="GTID"></param> /// <returns></returns> public static object CountByGTID(int GTID) { sqltext = " select count(*) from [dbo].[YC_Goods] where [GTID]='" + GTID + "'"; return(SQLHELPER.ExecuteScalar(sqltext)); }
/// <summary> /// 查询合同详情 /// </summary> /// <param name="hid"></param> /// <returns></returns> public static string detail(int hid) { sqltext = "select [Detail] from [dbo].[Htgl] where [hid]='" + hid + "'"; return(SQLHELPER.ExecuteScalar(sqltext).ToString()); }