コード例 #1
0
ファイル: AccountController.cs プロジェクト: x3r/AMS
 public AccountController(AccountService accountService, User user, EditAccountModel editAccountModel, DoctorService doctorService)
 {
     _accountService = accountService;
     _user = user;
     _doctorService = doctorService;
     _editAccountModel = editAccountModel;
 }
コード例 #2
0
ファイル: AccountService.cs プロジェクト: x3r/AMS
 public void UpdateAccount(User user)
 {
     user.Password = Encryption.GetHash(user.Password);
     _userRepository.Update(user, _userRepository.GetUserId(user.Email));
 }
コード例 #3
0
ファイル: AccountController.cs プロジェクト: x3r/AMS
 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);
     }
 }
コード例 #4
0
ファイル: AccountService.cs プロジェクト: x3r/AMS
 public void SaveUser(User user)
 {
     user.Password = Encryption.GetHash(user.Password);
     _userRepository.Add(user);
 }