Beispiel #1
0
 public ActionResult Edit([Bind(Include = "ProducerId,Name")] Producer producer)
 {
     if (ModelState.IsValid)
     {
         fe.Entry(producer).State = EntityState.Modified;
         fe.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(producer));
 }
Beispiel #2
0
 public ActionResult Edit([Bind(Include = "CategoryId,Name,Description")] Category category)
 {
     if (ModelState.IsValid)
     {
         fe.Entry(category).State = EntityState.Modified;
         fe.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(category));
 }
Beispiel #3
0
 public ActionResult Edit([Bind(Include = "ItemId,CategoryId,ProduceId,Title,Price,ItemArtUrl")] Item item)
 {
     if (ModelState.IsValid)
     {
         fe.Entry(item).State = EntityState.Modified;
         fe.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.CategoryId = new SelectList(fe.Categories, "CategoryId", "Name", item.CategoryId);
     ViewBag.ProduceId  = new SelectList(fe.Producers, "ProducerId", "Name", item.ProduceId);
     return(View(item));
 }