public IActionResult OnGet(string errorMessage = "", string successMessage = "")
        {
            ErrorMessage   = errorMessage;
            SuccessMessage = successMessage;

            var email = Request.Cookies["EmailCookie"];

            Account = _accountServiceProvider.Get(email);

            ReviewsReceived = _reviewServiceProvider.GetAllByReviewee(email);
            ReviewsGiven    = _reviewServiceProvider.GetAllByReviewer(email);

            return(Page());
        }
        public IActionResult OnPostUpdate()
        {
            var token       = Request.Cookies["TokenCookie"];
            var email       = Request.Cookies["EmailCookie"];
            var password    = Request.Form["password"];
            var firstName   = Request.Form["firstName"];
            var lastName    = Request.Form["lastName"];
            var dateOfBirth = Request.Form["dateOfBirth"];
            var phoneNumber = Request.Form["phoneNumber"];

            var account = new Data.Models.Entities.Account()
            {
                Email       = email,
                FirstName   = firstName,
                LastName    = lastName,
                Password    = password,
                DateOfBirth = dateOfBirth,
                Phone       = phoneNumber,
            };

            return(_accountServiceProvider.Update(account, token)
                ? OnGet()
                : OnGet("Your account could not be updated"));
        }
Esempio n. 3
0
 public IActionResult OnPostRegister([FromForm] Data.Models.Entities.Account account)
 {
     return(_accountServiceProvider.Register(account)
         ? RedirectToPage("/Index", new { accountCreated = true })
         : RedirectToPage("./Register", new { accountCreated = false }));
 }