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_uno c = new tbl_presentacion_uno(); 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_uno.Add(c); db.SaveChanges(); i++; } return(RedirectToAction("Create", "Dos")); } else { return(RedirectToAction("Login", "Uno")); } }
public ActionResult DeleteConfirmed(int id) { tbl_presentacion_uno tbl_presentacion_uno = db.tbl_presentacion_uno.Find(id); db.tbl_presentacion_uno.Remove(tbl_presentacion_uno); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "id,fk_candidatas_id,fk_users_id,nota1,nota2,nota3")] tbl_presentacion_uno tbl_presentacion_uno) { if (ModelState.IsValid) { db.Entry(tbl_presentacion_uno).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.fk_candidatas_id = new SelectList(db.tbl_candidatas, "id", "nombres", tbl_presentacion_uno.fk_candidatas_id); ViewBag.fk_users_id = new SelectList(db.tbl_users_jueces, "id", "nombres_completos", tbl_presentacion_uno.fk_users_id); return(View(tbl_presentacion_uno)); }
// GET: Uno/Details/5 public ActionResult Details(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } tbl_presentacion_uno tbl_presentacion_uno = db.tbl_presentacion_uno.Find(id); if (tbl_presentacion_uno == null) { return(HttpNotFound()); } return(View(tbl_presentacion_uno)); }
// GET: Uno/Edit/5 public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } tbl_presentacion_uno tbl_presentacion_uno = db.tbl_presentacion_uno.Find(id); if (tbl_presentacion_uno == null) { return(HttpNotFound()); } ViewBag.fk_candidatas_id = new SelectList(db.tbl_candidatas, "id", "nombres", tbl_presentacion_uno.fk_candidatas_id); ViewBag.fk_users_id = new SelectList(db.tbl_users_jueces, "id", "nombres_completos", tbl_presentacion_uno.fk_users_id); return(View(tbl_presentacion_uno)); }