public ActionResult DeleteConfirmed(short id) { Riviste riviste = db.Riviste.Find(id); db.Riviste.Remove(riviste); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult DeleteRiviste(int AnnoP, int CodP, string CodRiv) { Riviste riviste = db.Riviste.Find(AnnoP, CodP, CodRiv); db.Riviste.Remove(riviste); db.SaveChanges(); UpdateDovuto(AnnoP, CodP); return(RedirectToAction("Edit", new { codp = riviste.CodP, annop = riviste.AnnoP })); }
public ActionResult Edit([Bind(Include = "AnnoP,CodP,CodRiv,Ncopie")] Riviste riviste) { if (ModelState.IsValid) { db.Entry(riviste).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.CodP = new SelectList(db.Pag, "CodP", "Tiscr", riviste.CodP); ViewBag.AnnoP = new SelectList(db.TabRiv, "AnnoRiv", "NCodRiv", riviste.AnnoP); return(View(riviste)); }
// GET: Riviste/Details/5 public ActionResult Details(short?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } Riviste riviste = db.Riviste.Find(id); if (riviste == null) { return(HttpNotFound()); } return(View(riviste)); }
public ActionResult CreateRiviste([Bind(Include = "AnnoP,CodP,CodRiv,Ncopie")] Riviste riviste) { if (ModelState.IsValid) { db.Riviste.Add(riviste); db.SaveChanges(); UpdateDovuto(riviste.AnnoP, riviste.CodP); return(RedirectToAction("Edit", new { codp = riviste.CodP, annop = riviste.AnnoP })); } ViewBag.CodP = new SelectList(db.Pag, "CodP", "Tiscr", riviste.CodP); ViewBag.AnnoP = new SelectList(db.TabRiv, "AnnoRiv", "NCodRiv", riviste.AnnoP); return(RedirectToAction("Edit", new { codp = riviste.CodP, annop = riviste.AnnoP })); }
// GET: Riviste/Edit/5 public ActionResult Edit(short?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } Riviste riviste = db.Riviste.Find(id); if (riviste == null) { return(HttpNotFound()); } ViewBag.CodP = new SelectList(db.Pag, "CodP", "Tiscr", riviste.CodP); ViewBag.AnnoP = new SelectList(db.TabRiv, "AnnoRiv", "NCodRiv", riviste.AnnoP); return(View(riviste)); }