Example #1
0
        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);
        }
Example #2
0
 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);
 }