Пример #1
0
 public object CheckUser(string login, string password)
 {
     password = DecryptPassword(password);
     if (uow.UsersRepository.Get().FirstOrDefault(c => c.Login == login && c.Password == password) != null)
     {
         return(CustomMapper.getUserBLL(uow.UsersRepository.Get().FirstOrDefault(c => c.Login == login && c.Password == password)));
     }
     if (uow.RecruitersRepository.Get().FirstOrDefault(c => c.Login == login && c.Password == password) != null)
     {
         return(CustomMapper.getRecruiterBLL(uow.RecruitersRepository.Get().FirstOrDefault(c => c.Login == login && c.Password == password)));
     }
     if (uow.AdminsRepository.Get().FirstOrDefault(c => c.Login == login && c.Password == password) != null)
     {
         return(CustomMapper.getAdminBLL(uow.AdminsRepository.Get().FirstOrDefault(c => c.Login == login && c.Password == password)));
     }
     else
     {
         return(null);
     }
 }