public ActionResult DeleteConfirmed(int id) { QuickPurchase quickPurchase = db.QuickPurchases.Find(id); db.QuickPurchases.Remove(quickPurchase); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "ID,QuickPurchaseName,QuickPurchaseDate,QuickPurchaseAmount,QuickPurchaseOrigin,QuickPurchaseReason")] QuickPurchase quickPurchase) { if (ModelState.IsValid) { db.Entry(quickPurchase).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(quickPurchase)); }
public ActionResult Create([Bind(Include = "ID,QuickPurchaseName,QuickPurchaseDate,QuickPurchaseAmount,QuickPurchaseOrigin,QuickPurchaseReason")] QuickPurchase quickPurchase) { if (ModelState.IsValid) { db.QuickPurchases.Add(quickPurchase); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(quickPurchase)); }
// GET: QuickPurchases/Delete/5 public ActionResult Delete(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } QuickPurchase quickPurchase = db.QuickPurchases.Find(id); if (quickPurchase == null) { return(HttpNotFound()); } return(View(quickPurchase)); }