Example #1
0
 public AccountController(AccountService accountService, User user, EditAccountModel editAccountModel, DoctorService doctorService)
 {
     _accountService = accountService;
     _user = user;
     _doctorService = doctorService;
     _editAccountModel = editAccountModel;
 }
Example #2
0
 public void UpdateAccount(User user)
 {
     user.Password = Encryption.GetHash(user.Password);
     _userRepository.Update(user, _userRepository.GetUserId(user.Email));
 }
Example #3
0
 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);
     }
 }
Example #4
0
 public void SaveUser(User user)
 {
     user.Password = Encryption.GetHash(user.Password);
     _userRepository.Add(user);
 }