Пример #1
0
 public ActionResult Edit(Delivery delivery)
 {
     if (ModelState.IsValid)
     {
         db.Entry(delivery).State = EntityState.Modified;
         db.SaveChanges();
         return RedirectToAction("Index");
     }
     return View(delivery);
 }
Пример #2
0
        public ActionResult Create(Delivery delivery)
        {
            if (ModelState.IsValid)
            {
                db.Deliveries.Add(delivery);
                db.SaveChanges();
                return RedirectToAction("Index");
            }

            return View(delivery);
        }