public async Task <ActionResult> Create([Bind(Include = "AdministradorID,Email,Contraseña,Nombre,Lugar_trabajo,Nivel")] Administrador administrador)
        {
            if (ModelState.IsValid)
            {
                db.Administradores.Add(administrador);
                await db.SaveChangesAsync();

                return(RedirectToAction("Index"));
            }

            return(View(administrador));
        }
Exemple #2
0
        public async Task <ActionResult> Create([Bind(Include = "InstitucionID,Nombre")] Institucion institucion)
        {
            if (ModelState.IsValid)
            {
                db.Instituciones.Add(institucion);
                await db.SaveChangesAsync();

                return(RedirectToAction("Index"));
            }

            return(View(institucion));
        }
        public async Task <ActionResult> Create([Bind(Include = "ExperimentoID,Nombre,Objetivo")] Experimento experimento)
        {
            if (ModelState.IsValid)
            {
                db.Experimentos.Add(experimento);
                await db.SaveChangesAsync();

                return(RedirectToAction("Index"));
            }

            return(View(experimento));
        }
        public async Task <ActionResult> Create([Bind(Include = "TelemetriaID,VueloID,Nombre,Valor")] Telemetria telemetria)
        {
            if (ModelState.IsValid)
            {
                db.Telemetrias.Add(telemetria);
                await db.SaveChangesAsync();

                return(RedirectToAction("Index"));
            }

            ViewBag.VueloID = new SelectList(db.Vuelos, "VueloID", "Nombre", telemetria.VueloID);
            return(View(telemetria));
        }
Exemple #5
0
        public async Task <ActionResult> Create([Bind(Include = "VueloID,AdministradorID,Nombre,Objetivo,Fecha,Ubicacion,Plataforma")] Vuelo vuelo)
        {
            if (ModelState.IsValid)
            {
                db.Vuelos.Add(vuelo);
                await db.SaveChangesAsync();

                return(RedirectToAction("Index"));
            }

            ViewBag.AdministradorID = new SelectList(db.Administradores, "AdministradorID", "Email", vuelo.AdministradorID);
            return(View(vuelo));
        }
        public async Task <ActionResult> Create([Bind(Include = "ID,InstitucionID,VueloID,ExperimentoID")] VueloInstitucionExperimento vueloInstitucionExperimento)
        {
            if (ModelState.IsValid)
            {
                db.VueloInstitucionExperimentos.Add(vueloInstitucionExperimento);
                await db.SaveChangesAsync();

                return(RedirectToAction("Index"));
            }

            ViewBag.ExperimentoID = new SelectList(db.Experimentos, "ExperimentoID", "Nombre", vueloInstitucionExperimento.ExperimentoID);
            ViewBag.InstitucionID = new SelectList(db.Instituciones, "InstitucionID", "Nombre", vueloInstitucionExperimento.InstitucionID);
            ViewBag.VueloID       = new SelectList(db.Vuelos, "VueloID", "Nombre", vueloInstitucionExperimento.VueloID);
            return(View(vueloInstitucionExperimento));
        }
        public ActionResult crearVuelo([Bind(Include = "VueloID,AdministradorID,Nombre,Objetivo,Fecha,Ubicacion,Plataforma")] Vuelo vuelo, [Bind(Include = "VueloID,InstitucionID,ExperimentoID")] VueloInstitucionExperimento vue)
        {
            if (ModelState.IsValid)
            {
                db.Vuelos.Add(vuelo);
                db.VueloInstitucionExperimentos.Add(vue);
                db.SaveChangesAsync();
                return(RedirectToAction("Index", "Home"));
            }

            ViewBag.Experimento   = db.Experimentos.ToList();
            ViewBag.Institucion   = new SelectList(db.Instituciones, "InstitucionID", "Nombre");
            ViewBag.Administrador = new SelectList(db.Administradores, "AdministradorID", "Email");
            return(View("Index", vuelo));
        }