Example #1
0
        public bool CheckUserByEmailAndPassword(string email,string password)
        {
            IDAL.IUserDao userDao = new UserDao();
            User user = userDao.FindUserByEmail(email);
            if (user == null) return false;

            return password==user.pwd;
        }
Example #2
0
 public int Register(String email, String pwd, int role)
 {
     IDAL.IUserDao userDao = new UserDao();
     User user = userDao.FindUserByEmail(email);
     if (user != null)
         return 1;
     else
     {
         if (userDao.addUser(email, pwd, role))
         {
             if (sendEmailForRegister(email))
                 return 0;
             else
                 return 2;
         }
         else
             return 3;
     }
 }
Example #3
0
 public User GetUser(string email)
 {
     IDAL.IUserDao userDao = new UserDao();
     User user = userDao.FindUserByEmail(email);
     return user;
 }