public ActionResult DeleteConfirmed(int id) { PayMentMethod payMentMethod = db.PayMentMethods.Find(id); db.PayMentMethods.Remove(payMentMethod); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "id,paymentName")] PayMentMethod payMentMethod) { if (ModelState.IsValid) { db.Entry(payMentMethod).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(payMentMethod)); }
public ActionResult Create([Bind(Include = "id,paymentName")] PayMentMethod payMentMethod) { if (ModelState.IsValid) { db.PayMentMethods.Add(payMentMethod); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(payMentMethod)); }
// GET: Admin/PayMentMethods/Delete/5 public ActionResult Delete(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } PayMentMethod payMentMethod = db.PayMentMethods.Find(id); if (payMentMethod == null) { return(HttpNotFound()); } return(View(payMentMethod)); }