Пример #1
0
        public ActionResult AgregarItem([FromBody] RubroCatalogo entidad)
        {
            if (!ModelState.IsValid)
            {
                return(View("Error", new Error()
                {
                    Message = "Error in data"
                }));
            }

            if (this.IsAdminUserLoggedIn() == false)
            {
                return(View("AccesoDenegado"));
            }

            var Repo = new RubroCatalogoBLL();

            Repo.Agregar(entidad);
            ViewBag.Rubros = Repo.Listar();
            return(View("Rubros"));
        }
Пример #2
0
        public ActionResult EliminarItem(int ID)
        {
            if (!ModelState.IsValid)
            {
                return(View("Error", new Error()
                {
                    Message = "Error in data"
                }));
            }

            if (this.IsAdminUserLoggedIn() == false)
            {
                return(View("AccesoDenegado"));
            }

            var Repo   = new RubroCatalogoBLL();
            var auxObj = new RubroCatalogo();

            auxObj.Id = ID;
            Repo.Eliminar(auxObj);
            ViewBag.Rubros = Repo.Listar();
            return(View("Rubros"));
        }