Ejemplo n.º 1
0
        public ActionResult Editar(string id)
        {
            EducationLevelBL oBL = new EducationLevelBL();
            int pIntID           = 0;

            int.TryParse(id, out pIntID);
            EducationLevelViewModel pEducationLevelViewModel = oBL.Obtener(pIntID);

            return(View(pEducationLevelViewModel));
        }
Ejemplo n.º 2
0
        public JsonResult Verificar(int id_education_level, string name)
        {
            EducationLevelBL oBL = new EducationLevelBL();
            var resultado        = oBL.VerificarDuplicado(id_education_level, name);

            return(Json(new
            {
                // this is what datatables wants sending back
                valido = resultado,
            }));
        }
Ejemplo n.º 3
0
        public JsonResult Eliminar(int id)
        {
            EducationLevelBL oEducationLevelBL = new EducationLevelBL();

            oEducationLevelBL.Eliminar(id);

            return(Json(new
            {
                // this is what datatables wants sending back
                status = "1",
            }));
        }
Ejemplo n.º 4
0
        public ActionResult Editar([Bind(Include = "education_level_id,name")] EducationLevelViewModel pEducationLevelViewModel)
        {
            // TODO: Add insert logic here

            if (pEducationLevelViewModel == null)
            {
                return(HttpNotFound());
            }
            EducationLevelBL oEducationLevelBL = new EducationLevelBL();

            pEducationLevelViewModel.user_id_modified = AuthorizeUserAttribute.UsuarioLogeado().user_id;
            oEducationLevelBL.Modificar(pEducationLevelViewModel);
            return(RedirectToAction("Index"));
        }
Ejemplo n.º 5
0
        public JsonResult ObtenerLista(DataTableAjaxPostModel ofilters)//DataTableAjaxPostModel model
        {
            EducationLevelBL oEducationLevelBL = new EducationLevelBL();
            //EducationLevelFiltersViewModel ofilters = new EducationLevelFiltersViewModel();
            GridModel <EducationLevelViewModel> grid = oEducationLevelBL.ObtenerLista(ofilters);

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

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

            EducationLevelBL oBL = new EducationLevelBL();

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