コード例 #1
0
        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);
        }
コード例 #2
0
        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"));
            }
        }