Example #1
0
        public ActionResult Create(int[] imagen_id, int[] notaUno, int[] notaDos, int[] notaTres, int[] notaCuatro)
        {
            if (Session["id"] == null)
            {
                return(RedirectToAction("Index", "Error"));
            }
            int i      = 0;
            int juezID = ((int)Session["id"]);

            if (ModelState.IsValid)
            {
                foreach (int cand in imagen_id)
                {
                    tbl_presentacion_cuatro c = new tbl_presentacion_cuatro();
                    c.fk_candidatas_id = cand;
                    c.fk_users_id      = juezID;
                    c.nota1            = Convert.ToByte(notaUno[i]);
                    c.nota2            = Convert.ToByte(notaDos[i]);
                    c.nota3            = Convert.ToByte(notaTres[i]);
                    c.nota4            = Convert.ToByte(notaCuatro[i]);
                    db.tbl_presentacion_cuatro.Add(c);
                    db.SaveChanges();
                    i++;
                }
                return(RedirectToAction("Create", "Cuatro"));
            }
            else
            {
                return(RedirectToAction("Login", "Uno"));
            }
        }
Example #2
0
        public ActionResult DeleteConfirmed(int id)
        {
            tbl_presentacion_cuatro tbl_presentacion_cuatro = db.tbl_presentacion_cuatro.Find(id);

            db.tbl_presentacion_cuatro.Remove(tbl_presentacion_cuatro);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Example #3
0
 public ActionResult Edit([Bind(Include = "id,fk_candidatas_id,fk_users_id,nota1,nota2,nota3,nota4")] tbl_presentacion_cuatro tbl_presentacion_cuatro)
 {
     if (ModelState.IsValid)
     {
         db.Entry(tbl_presentacion_cuatro).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.fk_candidatas_id = new SelectList(db.tbl_candidatas, "id", "nombres", tbl_presentacion_cuatro.fk_candidatas_id);
     ViewBag.fk_users_id      = new SelectList(db.tbl_users_jueces, "id", "nombres_completos", tbl_presentacion_cuatro.fk_users_id);
     return(View(tbl_presentacion_cuatro));
 }
Example #4
0
        // GET: Tres/Details/5
        public ActionResult Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            tbl_presentacion_cuatro tbl_presentacion_cuatro = db.tbl_presentacion_cuatro.Find(id);

            if (tbl_presentacion_cuatro == null)
            {
                return(HttpNotFound());
            }
            return(View(tbl_presentacion_cuatro));
        }
Example #5
0
        // GET: Tres/Edit/5
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            tbl_presentacion_cuatro tbl_presentacion_cuatro = db.tbl_presentacion_cuatro.Find(id);

            if (tbl_presentacion_cuatro == null)
            {
                return(HttpNotFound());
            }
            ViewBag.fk_candidatas_id = new SelectList(db.tbl_candidatas, "id", "nombres", tbl_presentacion_cuatro.fk_candidatas_id);
            ViewBag.fk_users_id      = new SelectList(db.tbl_users_jueces, "id", "nombres_completos", tbl_presentacion_cuatro.fk_users_id);
            return(View(tbl_presentacion_cuatro));
        }