Пример #1
0
        /// <summary>
        /// 查询该该用户注册的账号数据库是否存在方法()
        /// </summary>
        /// <param name="model">用户实体类</param>
        /// <returns>数据库受影响的行数,如果大于0则说明该账号已经存在,否则不存在</returns>
        public static int SelectUserName(Model.Customer model)
        {
            string sql = "  select count(*) from Customer where LoginName=@LoginName";

            SqlParameter[] P =
            {
                new SqlParameter("@LoginName", model.LoginName),
            };
            return((int)DbHepler.ExcuteReadCount(sql, P));
        }
Пример #2
0
        /// <summary>
        /// 用户登入方法()
        /// </summary>
        /// <param name="model">用户实体类</param>
        /// <returns>数据库受影响的行数,如果大于0则说明登入成功!,否则失败</returns>
        public static int UserLogin(Model.Customer model)
        {
            string sql = "  select count(*) from Customer where LoginName=@LoginName and [Password]=@pwd";

            SqlParameter[] P =
            {
                new SqlParameter("@LoginName", model.LoginName),
                new SqlParameter("@pwd",       model.Password),
            };
            return((int)DbHepler.ExcuteReadCount(sql, P));
        }