public ActionResult DeleteConfirmed(int id) { MakeToner makeToner = db.MakeToners.Find(id); db.MakeToners.Remove(makeToner); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "MakeTonerID,MakeTonerDate,MakeTonerQuantity,MakeTonerPrice,Remark,TonerID,OwnerID")] MakeToner makeToner) { if (ModelState.IsValid) { db.Entry(makeToner).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.OwnerID = new SelectList(db.Owners, "OwnerID", "OwnerName", makeToner.OwnerID); ViewBag.TonerID = new SelectList(db.Toners, "TonerID", "TonerModel", makeToner.TonerID); return(View(makeToner)); }
// GET: MakeToners/Details/5 public ActionResult Details(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } MakeToner makeToner = db.MakeToners.Find(id); if (makeToner == null) { return(HttpNotFound()); } return(View(makeToner)); }
// GET: MakeToners/Edit/5 public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } MakeToner makeToner = db.MakeToners.Find(id); if (makeToner == null) { return(HttpNotFound()); } ViewBag.OwnerID = new SelectList(db.Owners, "OwnerID", "OwnerName", makeToner.OwnerID); ViewBag.TonerID = new SelectList(db.Toners, "TonerID", "TonerModel", makeToner.TonerID); return(View(makeToner)); }