public ActionResult DeleteConfirmed(int id) { PrinterTonerCompatibility printerTonerCompatibility = db.PrinterTonerCompatibilitys.Find(id); db.PrinterTonerCompatibilitys.Remove(printerTonerCompatibility); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "PrinterTonerCompatibilityID,PrinterID,TonerID")] PrinterTonerCompatibility printerTonerCompatibility) { if (ModelState.IsValid) { db.Entry(printerTonerCompatibility).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.PrinterID = new SelectList(db.Printers, "PrinterID", "PrinterModel", printerTonerCompatibility.PrinterID); ViewBag.TonerID = new SelectList(db.Toners, "TonerID", "TonerModel", printerTonerCompatibility.TonerID); return(View(printerTonerCompatibility)); }
// GET: PrinterTonerCompatibilities/Details/5 public ActionResult Details(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } PrinterTonerCompatibility printerTonerCompatibility = db.PrinterTonerCompatibilitys.Find(id); if (printerTonerCompatibility == null) { return(HttpNotFound()); } return(View(printerTonerCompatibility)); }
// GET: PrinterTonerCompatibilities/Edit/5 public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } PrinterTonerCompatibility printerTonerCompatibility = db.PrinterTonerCompatibilitys.Find(id); if (printerTonerCompatibility == null) { return(HttpNotFound()); } ViewBag.PrinterID = new SelectList(db.Printers, "PrinterID", "PrinterModel", printerTonerCompatibility.PrinterID); ViewBag.TonerID = new SelectList(db.Toners, "TonerID", "TonerModel", printerTonerCompatibility.TonerID); return(View(printerTonerCompatibility)); }