예제 #1
0
        public IActionResult Delete(MasterParmEliminarViewModel model)
        {
            if (ModelState.IsValid)
            {
                var parm = _context.MasterParms.FirstOrDefault(e => e.MParmId == model.MParmId);
                _context.MasterParms.Remove(parm);
                _context.SaveChanges();

                this.ShowSuccess("El parámetro master se ha eliminado correctamente");
                return(this.RedirectAjax(Url.Action("Index")));
            }

            return(PartialView("_DeletePartial", model));
        }
예제 #2
0
        public IActionResult Delete(string id)
        {
            var parm = _context.MasterParms.FirstOrDefault(e => e.MParmId == id);

            if (parm == null)
            {
                this.ShowSuccess("El parámetro que intenta eliminar ya no existe");
                return(this.RedirectAjax(Url.Action("Index")));
            }
            var model = new MasterParmEliminarViewModel()
            {
                MParmId = parm.MParmId
            };

            return(PartialView("_DeletePartial", model));
        }