示例#1
0
 public ActionResult Edit(Vendor vendor)
 {
     if (ModelState.IsValid)
     {
         db.Entry(vendor).State = EntityState.Modified;
         db.SaveChanges();
         return RedirectToAction("Index");
     }
     return View(vendor);
 }
示例#2
0
        public ActionResult Create(Vendor vendor)
        {
            if (ModelState.IsValid)
            {
                db.Vendors.Add(vendor);
                db.SaveChanges();
                return RedirectToAction("Index");
            }

            return View(vendor);
        }