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

            int.TryParse(id, out pIntID);
            AcademicLevelViewModel pAcademicLevelViewModel = oBL.Obtener(pIntID);

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

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

            oAcademicLevelBL.Eliminar(id);

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

            if (pAcademicLevelViewModel == null)
            {
                return(HttpNotFound());
            }
            AcademicLevelBL oAcademicLevelBL = new AcademicLevelBL();

            pAcademicLevelViewModel.user_id_modified = AuthorizeUserAttribute.UsuarioLogeado().user_id;
            oAcademicLevelBL.Modificar(pAcademicLevelViewModel);
            return(RedirectToAction("Index"));
        }
Ejemplo n.º 5
0
        public JsonResult ObtenerLista(DataTableAjaxPostModel ofilters)//DataTableAjaxPostModel model
        {
            AcademicLevelBL oAcademicLevelBL = new AcademicLevelBL();
            //AcademicLevelFiltersViewModel ofilters = new AcademicLevelFiltersViewModel();
            GridModel <AcademicLevelViewModel> grid = oAcademicLevelBL.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 = "academic_level_id,name")] AcademicLevelViewModel pAcademicLevelViewModel)
        {
            // TODO: Add insert logic here

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

            AcademicLevelBL oBL = new AcademicLevelBL();

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