コード例 #1
0
        public ActionResult Add(DelegationSetting model)
        {
            if (ModelState.IsValid)
            {
                try
                {
                    this.delegationRepository.Add(model);
                    TempData["Message"] = Resources.DelegationController.RealmAdded;
                    return RedirectToAction("Configure", new { id = model.UserName });
                }
                catch (ValidationException ex)
                {
                    ModelState.AddModelError("", ex.Message);
                }
                catch
                {
                    ModelState.AddModelError("", Resources.DelegationController.ErrorAddingDelegationSetting);
                }
            }

            var vm = new DelegationSettingsForUserViewModel(this.delegationRepository, this.userManagementRepository, model.UserName);
            return View("Configure", vm);
        }
コード例 #2
0
 public ActionResult Configure(string id = null)
 {
     var vm = new DelegationSettingsForUserViewModel(this.delegationRepository, this.userManagementRepository, id);
     return View("Configure", vm);
 }