Exemplo n.º 1
0
        /// <summary>
        /// 根据指定字段的值是否存在
        /// </summary>
        /// <param name="field">字段名</param>
        /// <param name="value">值</param>
        /// <returns>是否存在</returns>
        public bool Exist(string field, string value)
        {
            Member member = new Member();
            Type   type   = member.GetType();

            PropertyInfo[] propertyInfos = type.GetProperties();
            List <string>  propertys     = propertyInfos.Select(p => p.Name).ToList();

            if (propertys.Contains(field))
            {
                if (field.ToLower() == "email")
                {
                    return(CurrentRepository.Exist(m => m.Email == value));
                }
                else
                {
                    return(CurrentRepository.Exist(m => m.Phone_mob == value));
                }
            }
            return(false);
        }
Exemplo n.º 2
0
 public bool Exist(string Name)
 {
     return(CurrentRepository.Exist(u => u.RoleName == Name));
 }
Exemplo n.º 3
0
 public bool Login(string name, string password)
 {
     return(CurrentRepository.Exist(u => u.name == name && u.password == password));
 }
Exemplo n.º 4
0
 public bool Exist(string userName)
 {
     return(CurrentRepository.Exist(u => u.UserName == userName));
 }
Exemplo n.º 5
0
 public bool Exist(string loginName)
 {
     return(CurrentRepository.Exist(u => u.LoginName == loginName));
 }
Exemplo n.º 6
0
 public bool Exist(Expression <Func <User, bool> > anyLambda)
 {
     return(CurrentRepository.Exist(anyLambda));
 }
Exemplo n.º 7
0
 public bool Exist(string userName)
 {
     return(CurrentRepository.Exist(it => it.name == userName));
 }