Exemplo n.º 1
0
        public IActionResult EditProfile()
        {
            string userID = signInManager.UserManager.GetUserId(HttpContext.User);
            AccountMyProfileEditVM currentProfile = webShopDBContext.GetUserEditProfile(userID);

            return(PartialView("_MyProfileEditPartial", currentProfile));
        }
Exemplo n.º 2
0
        //Olika beroende på inloggad eller inte
        public IActionResult CheckOut()
        {
            AccountMyProfileEditVM currentProfile;

            if (User.Identity.IsAuthenticated)
            {
                string userID = signInManager.UserManager.GetUserId(HttpContext.User);
                currentProfile = webShopDBContext.GetUserEditProfile(userID);
            }
            else
            {
                currentProfile = new AccountMyProfileEditVM()
                {
                    FirstName   = "",
                    LastName    = "",
                    Email       = "",
                    PhoneNumber = "",
                    AddressLine = "",
                    ZipCode     = "",
                    City        = "",
                };
            }
            return(View(currentProfile));
        }