Пример #1
0
        public ActionResult Create(Consignee consignee)
        {
            if (ModelState.IsValid)
            {
                db.Consignees.Add(consignee);
                db.SaveChanges();
                return RedirectToAction("Index");
            }

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