public ActionResult DeleteConfirmed(int id) { Puff puff = db.Puff.Find(id); db.Puff.Remove(puff); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "Pid,Progid")] Puff puff) { if (ModelState.IsValid) { db.Entry(puff).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.Progid = new SelectList(db.Program, "Id", "ProgramName", "Date", puff.Progid); return(View(puff)); }
public ActionResult Create([Bind(Include = "Pid,Progid")] Puff puff) { if (ModelState.IsValid) { db.Puff.Add(puff); db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.Progid = new SelectList(db.Program, "Id", "ProgramName", puff.Progid); return(View(puff)); }
// GET: Puffs/Details/5 public ActionResult Details(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } Puff puff = db.Puff.Find(id); if (puff == null) { return(HttpNotFound()); } return(View(puff)); }
// GET: Puffs/Edit/5 public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } Puff puff = db.Puff.Find(id); if (puff == null) { return(HttpNotFound()); } ViewBag.Progid = new SelectList(db.Program, "Id", "ProgramName", "Date", puff.Progid); return(View(puff)); }