public void E_EliminarCurso() { ListSectorsViewModel a = new ListSectorsViewModel(); a.fill(); int codigo = a.ListSector[a.ListSector.Count - 1].idSector; Sector objSector = new Sector(); objSector.idSector = codigo; AddEditSectorViewModel objViewModel = new AddEditSectorViewModel(); objViewModel.EliminarSector(objSector.idSector); Assert.True(true); }
public ActionResult DeleteSector(int sectorid) { AddEditSectorViewModel objViewModel = new AddEditSectorViewModel(); try { objViewModel.EliminarSector(sectorid); TempData["Mensaje"] = "El sector se se eliminó correctamente"; return(RedirectToAction("ListSectors")); } catch (Exception e) { TempData["MensajeError"] = "Error! " + e.Message.ToList(); return(RedirectToAction("ListSectors")); } }