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