예제 #1
0
 public ActionResult Edit([Bind(Include = "id,name,address")] Stores stores)
 {
     if (ModelState.IsValid)
     {
         db.Entry(stores).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(stores));
 }
예제 #2
0
 public ActionResult Edit([Bind(Include = "id,name,description,price,total_in_shelf,total_in_vault,store_id")] Articles articles)
 {
     if (ModelState.IsValid)
     {
         db.Entry(articles).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.store_id = new SelectList(db.Stores, "id", "name", articles.store_id);
     return(View(articles));
 }