Exemplo n.º 1
0
        public ActionResult Settings(SettingsViewModel model)
        {
            if (this.ModelState.IsValid)
            {
                var userProfile = this.userProfileRepository.Find(this.authentication.CurrentUserId);
                if (userProfile == null)
                {
                    return this.HttpNotFound();
                }

                userProfile.DisplayName = model.DisplayName;
                userProfile.OrcId = model.OrcId;

                this.userProfileRepository.InsertOrUpdate(userProfile);
                this.userProfileRepository.Save();

                return this.RedirectToAction("Settings", new { saveSuccessful = true });
            }

            return this.View(model);
        }
Exemplo n.º 2
0
        public ActionResult Settings(bool saveSuccessful = false)
        {
            var userProfile = this.userProfileRepository.Find(this.authentication.CurrentUserId);
            if (userProfile == null)
            {
                return this.HttpNotFound();
            }

            var model = new SettingsViewModel { DisplayName = userProfile.DisplayName, OrcId = userProfile.OrcId };
            this.ViewBag.SaveSuccessful = saveSuccessful;

            return this.View(model);
        }