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

            int.TryParse(id, out pIntID);
            InstitutionViewModel pInstitutionViewModel = oBL.Obtener(pIntID);

            return(View(pInstitutionViewModel));
        }
Exemplo n.º 2
0
        public JsonResult Verificar(int id_institution, string name)
        {
            InstitutionBL oBL       = new InstitutionBL();
            var           resultado = oBL.VerificarDuplicado(id_institution, name);

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

            oInstitutionBL.Eliminar(id);

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

            if (pInstitutionViewModel == null)
            {
                return(HttpNotFound());
            }
            InstitutionBL oInstitutionBL = new InstitutionBL();

            pInstitutionViewModel.user_id_modified = AuthorizeUserAttribute.UsuarioLogeado().user_id;
            oInstitutionBL.Modificar(pInstitutionViewModel);
            return(RedirectToAction("Index"));
        }
Exemplo n.º 5
0
        public JsonResult ObtenerLista(DataTableAjaxPostModel ofilters)//DataTableAjaxPostModel model
        {
            InstitutionBL oInstitutionBL = new InstitutionBL();
            //InstitutionFiltersViewModel ofilters = new InstitutionFiltersViewModel();
            GridModel <InstitutionViewModel> grid = oInstitutionBL.ObtenerLista(ofilters);

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

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

            InstitutionBL oBL = new InstitutionBL();

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