public ActionResult DeleteConfirmed(int id) { InviceDetails inviceDetails = db.InviceDetails.Find(id); db.InviceDetails.Remove(inviceDetails); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "ID,ProductName,Amount,InvoicesID")] InviceDetails inviceDetails) { if (ModelState.IsValid) { db.Entry(inviceDetails).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.InvoicesID = new SelectList(db.Invoices, "ID", "ID", inviceDetails.InvoicesID); return(View(inviceDetails)); }
// GET: InviceDetails/Details/5 public ActionResult Details(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } InviceDetails inviceDetails = db.InviceDetails.Find(id); if (inviceDetails == null) { return(HttpNotFound()); } return(View(inviceDetails)); }
// GET: InviceDetails/Edit/5 public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } InviceDetails inviceDetails = db.InviceDetails.Find(id); if (inviceDetails == null) { return(HttpNotFound()); } ViewBag.InvoicesID = new SelectList(db.Invoices, "ID", "ID", inviceDetails.InvoicesID); return(View(inviceDetails)); }