Example #1
0
        public ActionResult DeleteAction(int Id)
        {
            var Template = serviceTemplate.GetItem(Id);

            try
            {
                if (Template != null && ModelState.IsValid)
                {
                    serviceTemplate.Delete(Id);
                }
                else
                {
                    ModelState.AddModelError("Error", "Algunos datos ingresados no son vĂ¡lidos");
                }
            }
            catch (Exception ex)
            {
                ModelState.AddModelError("Error", "Se ha producido un error: " + ex.Message);
            }

            return(RedirectToAction("Index"));
        }