Exemple #1
0
        public ActionResult PrepararAgregarItem()
        {
            if (this.IsAdminUserLoggedIn() == false)
            {
                return(View("AccesoDenegado"));
            }

            ViewBag.ModoOper = "NEW";
            RubroCatalogo auxObj = new RubroCatalogo();

            return(View("RubroItem", auxObj));
        }
Exemple #2
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"));
        }
Exemple #3
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"));
        }