Exemplo n.º 1
0
 public ActionResult UserProfilePost(UserProfileVM userProfile)
 {
     if (!ModelState.IsValid)
     {
         return(View(userProfile));
     }
     try
     {
         var userData = TicketUserData.FromContext(HttpContext);
         var command  = new UpdateUserCommand
         {
             Email     = userProfile.Email,
             FirstName = userProfile.FirstName,
             LastName  = userProfile.LastName,
             Password  = userProfile.Password,
             Phone     = userProfile.Phone,
             UserId    = userData.UserId
         };
         pipelineService.HandleCommand(command);
     }
     catch (DomainException ex)
     {
         ModelState.AddModelError(string.Empty, ex);
         return(View(userProfile));
     }
     return(Redirect("~"));
 }
Exemplo n.º 2
0
        public ActionResult UserProfile()
        {
            TicketUserData userData = TicketUserData.FromContext(HttpContext);
            User           user     = userQueries.GetById(userData.UserId);

            return(View(new UserProfileVM(user)));
        }