public ActionResult Delete(int id,Order ord) { var Order = objContext.Orders.Where(o => o.OrderId == id).First(); if (Order != null) { objContext.Orders.Remove(Order); objContext.SaveChanges(); } return RedirectToAction("Index"); }
public ActionResult Create(Order ord) { objContext.Orders.Add(ord); objContext.SaveChanges(); return RedirectToAction("Index"); }
public ActionResult Create() { var Order = new Order(); return View(Order); }