Exemple #1
0
        public ActionResult EditarCentro(CENTRO_ESTUDIO_LOCAL centro)
        {
            if (!ModelState.IsValid)
            {
                CargarDropDownList();
                return(View());
            }
            CelNegocio negocio = new CelNegocio();

            negocio.Actualizar
            (
                centro.DIRECCION,
                centro.NOMBRE_CENTRO,
                centro.CORREO,
                (int)centro.COD_CEL,
                (int)centro.TELEFONO,
                centro.AREA_ESPECIALIZACION,
                centro.DESCRIPCION,
                (int)centro.FK_COD_CIUDAD,
                centro.NOM_DIRECTOR
            );

            TempData["success"] = "Datos actualizados exitosamente!";
            var centros = db.CENTRO_ESTUDIO_LOCAL.Include(a => a.CIUDAD);

            return(View("MostrarCentros", centros));
            // Funcionando 23-11
        }
Exemple #2
0
        public ActionResult IngresarCentro(CENTRO_ESTUDIO_LOCAL cel)
        {
            if (!ModelState.IsValid)
            {
                CargarDropDownList();
                return(View());
            }
            var nomb = db.CENTRO_ESTUDIO_LOCAL.Where(m => m.NOMBRE_CENTRO.Equals(cel.NOMBRE_CENTRO));

            if (nomb != null)
            {
                TempData["error"] = "El centro '" + cel.NOMBRE_CENTRO + "' ya ha sido ingresado, ingrese otro distinto.";
                CargarDropDownList();
                return(View());
            }

            CelNegocio negocio = new CelNegocio();

            negocio.Crear(cel.DIRECCION, cel.NOMBRE_CENTRO, cel.CORREO, (int)cel.TELEFONO, cel.AREA_ESPECIALIZACION,
                          cel.DESCRIPCION, (int)cel.FK_COD_CIUDAD, cel.NOM_DIRECTOR);

            TempData["success"] = "Centro de Estudio Local ingresado exitosamente!";
            CargarDropDownList();
            return(View());
            //Listo, funcionando.
        }
Exemple #3
0
        // muestra informacion detallada de un centro en especifico.
        public ActionResult DetalleCentro(decimal?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            CENTRO_ESTUDIO_LOCAL centro = db.CENTRO_ESTUDIO_LOCAL.Find(id);

            if (centro == null)
            {
                return(HttpNotFound());
            }
            return(View(centro));
        }
Exemple #4
0
 public ActionResult EliminarCentros(decimal?id)
 {
     if (ValidarSesionAdministrador())
     {
         if (id == null)
         {
             return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
         }
         CENTRO_ESTUDIO_LOCAL centro = db.CENTRO_ESTUDIO_LOCAL.Find(id);
         if (centro == null)
         {
             return(HttpNotFound());
         }
         return(View(centro));
     }
     return(RedirectToAction("DenegarAcceso"));
 }
Exemple #5
0
 public ActionResult EditarCentro(decimal id)
 {
     if (ValidarSesionAdministrador())
     {
         if (id <= 0)
         {
             return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
         }
         CENTRO_ESTUDIO_LOCAL centro = db.CENTRO_ESTUDIO_LOCAL.Find(id);
         if (centro == null)
         {
             return(HttpNotFound());
         }
         CargarDropDownList();
         return(View(centro));
     }
     else
     {
         return(RedirectToAction("DenegarAcceso"));
     }
 }