Esempio n. 1
0
        /// <summary>
        /// 通过登录名或邮箱获取登录信息
        /// </summary>
        /// <param name="mailName"></param>
        /// <param name="vt">条件类别</param>
        /// <returns></returns>
        public List<Membership> GetMemberByMailName(string checkName, ValidType vt)
        {
            MembershipDao md = new MembershipDao();
            Membership ms = new Membership();
            if (string.IsNullOrEmpty(checkName))
                return null;

            switch (vt)
            {
                case ValidType.All:
                    ms.Where = string.Format("LoweredLoginName = {0} OR LoweredEmail= {0}", checkName.ToLower());
                    break;
                case ValidType.Mail:
                    ms.Where = string.Format("LoweredEmail= {0}", checkName.ToLower());
                    break;
                case ValidType.LoginName:
                    ms.Where = string.Format("LoweredLoginName = {0}", checkName.ToLower());
                    break;
                default:
                    ms.Where = string.Format("LoweredLoginName = {0} OR LoweredEmail= {0}", checkName.ToLower());
                    break;
            }

            return md.Select(ms);
        }
Esempio n. 2
0
        /// <summary>
        /// 获取所有登录用户信息
        /// </summary>
        /// <param name="where">查询条件</param>
        /// <returns></returns>
        public List<Membership> GetAllMembers(string where)
        {
            MembershipDao md = new MembershipDao();
            Membership ms = new Membership();

            return md.Select(ms);
        }
Esempio n. 3
0
        /// <summary>
        /// 创建登录用户(注册)
        /// </summary>
        /// <param name="ms"></param>
        /// <returns></returns>
        public bool CreateMember(Membership ms)
        {
            MembershipDao md = new MembershipDao();
            if (md.Insert(ms) > 0)
                return true;

            return false;
        }
Esempio n. 4
0
 /// <summary>
 /// 更新登录信息
 /// </summary>
 /// <param name="ms"></param>
 /// <returns></returns>
 public bool UpdatePassword(Membership ms)
 {
     MembershipDao md = new MembershipDao();
     return md.Update(ms) > 0;
 }