Exemplo n.º 1
0
 public ActionResult Edit(string id, Category category)
 {
     try
     {
         using (DaVentiDBEntities en = new DaVentiDBEntities())
         {
             en.Entry(category).State = EntityState.Modified;
             en.SaveChanges();
         }
         return(RedirectToAction("Index"));
     }
     catch
     {
         return(View());
     }
 }
Exemplo n.º 2
0
 public ActionResult Edit(string id, Promo promo)
 {
     try
     {
         // TODO: Add update logic here
         using (DaVentiDBEntities dBEntities = new DaVentiDBEntities())
         {
             dBEntities.Entry(promo).State = EntityState.Modified;
             dBEntities.SaveChanges();
         }
         return(RedirectToAction("Index"));
     }
     catch
     {
         return(View());
     }
 }