Exemple #1
0
        //登陆操作
        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);
        }
Exemple #2
0
 //判断是否是管理员
 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));
 }
Exemple #3
0
        /// <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)));
        }
Exemple #4
0
 /// <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));
 }
Exemple #5
0
 /// <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));
 }
Exemple #6
0
 //查询日程详情
 public static object selectDetailByRID(int rid)
 {
     sqltext = "select [detail] from [dbo].[richeng] where [rid]='" + rid + "'";
     return(SQLHELPER.ExecuteScalar(sqltext));
 }
Exemple #7
0
 //查询一个
 public static string selectDetail(int gid)
 {
     sqltext = "  select [detail] from [dbo].[Gongggao] where gid='" + gid + "'";
     return(SQLHELPER.ExecuteScalar(sqltext).ToString());
 }
Exemple #8
0
 //查询某一用户的头像url
 public static object selectMyHeader(int uid)
 {
     sqltext = "  select [headImgUrl] from [dbo].[UserInfo] where uid='" + uid + "'";
     return(SQLHELPER.ExecuteScalar(sqltext));
 }
Exemple #9
0
 /// <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));
 }
Exemple #10
0
 /// <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));
 }
Exemple #11
0
 /// <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));
 }
Exemple #12
0
 /// <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));
 }
Exemple #13
0
 /// <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));
 }
Exemple #14
0
 /// <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));
 }
Exemple #15
0
 /// <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());
 }