Пример #1
0
        public ActionResult Create(int[] imagen_id, int[] notaUno, int[] notaDos, int[] notaTres)
        {
            int i      = 0;
            int juezID = ((int)Session["id"]);

            if (ModelState.IsValid)
            {
                foreach (int cand in imagen_id)
                {
                    tbl_presentacion_dos c = new tbl_presentacion_dos();
                    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]);
                    db.tbl_presentacion_dos.Add(c);
                    db.SaveChanges();
                    i++;
                }
                return(RedirectToAction("Create", "Tres"));
            }
            else
            {
                return(RedirectToAction("Login", "Uno"));
            }
        }
Пример #2
0
        public ActionResult DeleteConfirmed(int id)
        {
            tbl_presentacion_dos tbl_presentacion_dos = db.tbl_presentacion_dos.Find(id);

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

            if (tbl_presentacion_dos == null)
            {
                return(HttpNotFound());
            }
            return(View(tbl_presentacion_dos));
        }
Пример #5
0
        // GET: Dos/Edit/5
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            tbl_presentacion_dos tbl_presentacion_dos = db.tbl_presentacion_dos.Find(id);

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