public ActionResult DeleteConfirmed(int id) { p_publication p_publication = db.p_publication.Find(id); db.p_publication.Remove(p_publication); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "publication_id,volume_number,published_date,magazine_id")] p_publication p_publication) { if (ModelState.IsValid) { db.Entry(p_publication).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.magazine_id = new SelectList(db.p_magazine, "magazine_id", "magazine_name", p_publication.magazine_id); return(View(p_publication)); }
// GET: p_publication/Details/5 public ActionResult Details(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } p_publication p_publication = db.p_publication.Find(id); if (p_publication == null) { return(HttpNotFound()); } return(View(p_publication)); }
// GET: p_publication/Edit/5 public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } p_publication p_publication = db.p_publication.Find(id); if (p_publication == null) { return(HttpNotFound()); } ViewBag.magazine_id = new SelectList(db.p_magazine, "magazine_id", "magazine_name", p_publication.magazine_id); return(View(p_publication)); }