Esempio n. 1
0
 public ActionResult Index(string action, IPModel[] list)
 {
     if (action == "delete") return Delete(list);
     if (action == "new") return Create();
     ModelState.AddModelError("", Resources.IPController.InvalidAction);
     var vm = new IdentityProvidersViewModel(this.identityProviderRepository);
     return View("Index", vm);
 }
Esempio n. 2
0
 ActionResult Delete(IPModel[] list)
 {
     if (ModelState.IsValid)
     {
         try
         {
             if (list != null)
             {
                 foreach (var item in list.Where(x => x.Delete))
                 {
                     this.identityProviderRepository.Delete(item.ID);
                 }
                 TempData["Message"] = Resources.IPController.IdentityProvidersDeleted;
             }
             return RedirectToAction("Index");
         }
         catch (ValidationException ex)
         {
             ModelState.AddModelError("", ex.Message);
         }
         catch
         {
             ModelState.AddModelError("", Resources.IPController.ErrorDeletingIdentityProviders);
         }
     }
     var vm = new IdentityProvidersViewModel(this.identityProviderRepository);
     return View("Index", vm);
 }