示例#1
0
 private static void blowUpIfEmployeeCannotLogin(User user)
 {
     if (user == null)
     {
         throw new InvalidCredentialException(
             "That user doesn't exist or is not valid.");
     }
 }
示例#2
0
        public ActionResult Edit(UserForm form)
        {
            if (ModelState.IsValid)
            {
                //mapping from conferenceform to conference
                User user = new User();
                _userMapper.MapToModel1(form, user);

                //saving the conference with the repository
                _userRepository.Save(user);
                form = _userMapper.Map(user);
                return View(form);
            }

            return View(form);
        }
示例#3
0
 public void LogIn(User user)
 {
     blowUpIfEmployeeCannotLogin(user);
     FormsAuthentication.RedirectFromLoginPage(user.Username, false);
 }
 public bool PasswordMatches(User user, string password)
 {
     string passwordHash = _cryptographer.GetPasswordHash(password, user.PasswordSalt);
     return passwordHash.Equals(user.PasswordHash);
 }