public AccountController(AccountService accountService, User user, EditAccountModel editAccountModel, DoctorService doctorService) { _accountService = accountService; _user = user; _doctorService = doctorService; _editAccountModel = editAccountModel; }
public void UpdateAccount(User user) { user.Password = Encryption.GetHash(user.Password); _userRepository.Update(user, _userRepository.GetUserId(user.Email)); }
public ActionResult RegisterPatient(String email, String password) { bool status = _accountService.ValidateRegistration(email); if (status) { var user = new User(); user.Role = "Patient"; user.Email = email; user.Password = password; _accountService.SaveUser(user); return Json("Registration successful", JsonRequestBehavior.AllowGet); } else { return Json("Email already exists", JsonRequestBehavior.AllowGet); } }
public void SaveUser(User user) { user.Password = Encryption.GetHash(user.Password); _userRepository.Add(user); }