public ActionResult Create(Order order) { if (ModelState.IsValid) { _ord.Add(order); return RedirectToAction("Index"); } ViewBag.CustomerID = new SelectList(_cus.GetAll(), "CustomerID", "CompanyName", order.CustomerID); return View(order); }
public ActionResult Edit(Order order) { if (ModelState.IsValid) { _ord.Edit(order); //db.Entry(order).State = EntityState.Modified; //db.SaveChanges(); return RedirectToAction("Index"); } ViewBag.CustomerID = new SelectList(_cus.GetAll(), "CustomerID", "CompanyName", order.CustomerID); return View(order); }