Exemple #1
0
        public ActionResult Crear(Inscripcion modelo, bool activo)
        {
            if (ModelState.IsValid)
            {
                modelo.ColegioId     = CustomHelper.getColegioId();
                modelo.ResponsableId = CustomHelper.getUsuarioId();
                modelo.Activo        = activo;

                string strMensaje = new InscripcionBL().Guardar(modelo);

                if (strMensaje.Equals("OK"))
                {
                    TempData["Inscripcion-Success"] = strMensaje;
                    return(RedirectToAction("Index"));
                }
                else
                {
                    ModelState.AddModelError("", strMensaje);
                }
            }

            string strAtributo = "checked='checked'";

            ViewBag.ActivoSi = activo == true ? strAtributo : "";
            ViewBag.ActivoNo = activo == false ? strAtributo : "";

            this.CargaControles();
            return(View(modelo));
        }
Exemple #2
0
        public ActionResult Eliminar(Inscripcion modelo)
        {
            string strMensaje = new InscripcionBL().Eliminar(modelo);

            if (strMensaje.Equals("OK"))
            {
                TempData["Inscripcion_Eliminar-Success"] = strMensaje;
                return(RedirectToAction("Index"));
            }
            else
            {
                ModelState.AddModelError("", strMensaje);
            }

            return(View(new InscripcionBL().ObtenerxId(modelo.InscripcionId, true)));
        }