Esempio n. 1
0
        public ActionResult AccountEmail(UserAccountViewModel.UserAccountEmailViewModel userAccountEmailViewModel)
        {
            if(ModelState.IsValid)
            {
                var user = _userTasks.GetUser(_principal.Identity.Name);
                user.UpdateEmail(userAccountEmailViewModel.Email);
                this.FlashSuccess("Email Updated");
                return RedirectToAction("Account");
            }

            //NOTE:we don't need to set the RouteData.Values["action"] like we do in the other failures
            //because Account() explicity sets the view name whereas the other
            //functions just call View();
            return Account();
        }
Esempio n. 2
0
        public UserAccountViewModel GetUserAccount(IPrincipal requestingUser)
        {
            UserAccountViewModel retVal = null;

            //get the requesting sender
            User user = GetUser(requestingUser.Identity.Name);

            if (user != null)
            {
                retVal = new UserAccountViewModel();

                FillBaseProperties(retVal, user, requestingUser);
            }

            return retVal;
        }
Esempio n. 3
0
        public ActionResult AccountLocation(UserAccountViewModel.UserAccountLocationViewModel userAccountLocationViewModel)
        {
            if (ModelState.IsValid)
            {
                var user = _userTasks.GetUser(_principal.Identity.Name);
                var locationData = GetLocationData();
                _userTasks.SaveLocation(user, locationData);
                this.FlashSuccess("Location Updated");
                return RedirectToAction("Account");
            }

            return Account();
        }
Esempio n. 4
0
        public ActionResult AccountPassword(UserAccountViewModel.UserAccountPasswordViewModel userAccountPasswordViewModel)
        {
            if (ModelState.IsValid)
            {
                var user = _userTasks.GetUser(_principal.Identity.Name);
                _userTasks.SavePassword(user,userAccountPasswordViewModel.Password);
                this.FlashSuccess("Password Updated");
                return RedirectToAction("Account");
            }

            return Account();
        }