Beispiel #1
0
        public ActionResult EditProfile()
        {
            string userName             = this.User.Identity.Name;
            CustomerEditProfileVm cepvm = this.service.GetCustomerEditProfileVm(userName);

            return(this.View(cepvm));
        }
Beispiel #2
0
        public CustomerEditProfileVm GetCustomerEditProfileVm(string userName)
        {
            ApplicationUser currentUser =
                this.Context.Users.FirstOrDefault(u => u.Name == userName);
            CustomerEditProfileVm cepvm = Mapper.Map <ApplicationUser, CustomerEditProfileVm>(currentUser);

            return(cepvm);
        }
Beispiel #3
0
        public ActionResult EditProfile(CustomerEditProfileBm bindingModel)
        {
            string userId = this.User.Identity.GetUserId();

            if (this.ModelState.IsValid)
            {
                this.service.EditCustomerProfile(bindingModel, userId);
                return(RedirectToAction("Profile"));
            }

            CustomerEditProfileVm cepvm = this.service.GetCustomerEditProfileVm(userId);

            return(this.View(cepvm));
        }