Пример #1
0
 public ActionResult Edit(Product product)
 {
     if (ModelState.IsValid)
     {
         db.Entry(product).State = EntityState.Modified;
         db.SaveChanges();
         return RedirectToAction("Index");
     }
     ViewBag.vatID = new SelectList(db.VATInformations, "vatID", "vatID", product.vatID);
     return View(product);
 }
Пример #2
0
        public ActionResult Create(Product product)
        {
            if (ModelState.IsValid)
            {
                db.Products.Add(product);
                db.SaveChanges();
                return RedirectToAction("Index");
            }

            ViewBag.vatID = new SelectList(db.VATInformations, "vatID", "vatID", product.vatID);
            return View(product);
        }