Example #1
0
        public ActionResult Editar(string id)
        {
            ReasonRejectBL oBL    = new ReasonRejectBL();
            int            pIntID = 0;

            int.TryParse(id, out pIntID);
            ReasonRejectViewModel pReasonRejectViewModel = oBL.Obtener(pIntID);

            return(View(pReasonRejectViewModel));
        }
Example #2
0
        public JsonResult Verificar(int id_reason_reject, string name)
        {
            ReasonRejectBL oBL       = new ReasonRejectBL();
            var            resultado = oBL.VerificarDuplicado(id_reason_reject, name);

            return(Json(new
            {
                // this is what datatables wants sending back
                valido = resultado,
            }));
        }
Example #3
0
        public JsonResult Eliminar(int id)
        {
            ReasonRejectBL oReasonRejectBL = new ReasonRejectBL();

            oReasonRejectBL.Eliminar(id);

            return(Json(new
            {
                // this is what datatables wants sending back
                status = "1",
            }));
        }
Example #4
0
        public ActionResult Editar([Bind(Include = "reason_reject_id,name")] ReasonRejectViewModel pReasonRejectViewModel)
        {
            // TODO: Add insert logic here

            if (pReasonRejectViewModel == null)
            {
                return(HttpNotFound());
            }
            ReasonRejectBL oReasonRejectBL = new ReasonRejectBL();

            pReasonRejectViewModel.user_id_modified = AuthorizeUserAttribute.UsuarioLogeado().user_id;
            oReasonRejectBL.Modificar(pReasonRejectViewModel);
            return(RedirectToAction("Index"));
        }
Example #5
0
        public JsonResult ObtenerLista(DataTableAjaxPostModel ofilters)//DataTableAjaxPostModel model
        {
            ReasonRejectBL oReasonRejectBL = new ReasonRejectBL();
            //ReasonRejectFiltersViewModel ofilters = new ReasonRejectFiltersViewModel();
            GridModel <ReasonRejectViewModel> grid = oReasonRejectBL.ObtenerLista(ofilters);

            return(Json(new
            {
                // this is what datatables wants sending back
                draw = ofilters.draw,
                recordsTotal = grid.total,
                recordsFiltered = grid.recordsFiltered,
                data = grid.rows
            }));
        }
Example #6
0
        public ActionResult Crear([Bind(Include = "reason_reject_id,name")] ReasonRejectViewModel pReasonRejectViewModel)
        {
            // TODO: Add insert logic here

            if (pReasonRejectViewModel == null)
            {
                return(HttpNotFound());
            }
            pReasonRejectViewModel.reason_reject_id = 0;
            pReasonRejectViewModel.user_id_created  = AuthorizeUserAttribute.UsuarioLogeado().user_id;

            ReasonRejectBL oBL = new ReasonRejectBL();

            oBL.Agregar(pReasonRejectViewModel);
            return(RedirectToAction("Index"));
        }