Example #1
0
 public ActionResult Edit([Bind(Include = "CategoryId,Name,Description")] Category category)
 {
     if (ModelState.IsValid)
     {
         db.Entry(category).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(category));
 }
 public ActionResult Edit([Bind(Include = "ProducerId,Name")] Producer producer)
 {
     if (ModelState.IsValid)
     {
         db.Entry(producer).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(producer));
 }
Example #3
0
 public ActionResult Edit(Order order)
 {
     if (ModelState.IsValid)
     {
         var abc = order.OrderDate.ToShortDateString();
         var cd  = order.FirstName;
         System.Diagnostics.Debug.WriteLine(abc);
         db.Entry(order).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(order));
 }