예제 #1
0
 public ActionResult EditGroup(DiscountGroupModel model)
 {
     if (!ModelState.IsValid)
     {
         return(View("EditGroup", model));
     }
     else
     {
         using (DiscountContext context = new DiscountContext())
         {
             context.Edit(model);
             context.SetGroupItems(model.DiscountGroupId, model.DiscountList.Trim(','));
         }
         return(RedirectToAction("Groups"));
     }
 }
예제 #2
0
 public ActionResult Edit(DiscountModel model)
 {
     if (!ModelState.IsValid)
     {
         using (DiscountContext context = new DiscountContext())
         {
             ViewBag.DiscountKinds = context.GetDiscountKinds();
         }
         return(View("Edit", model));
     }
     else
     {
         using (DiscountContext context = new DiscountContext())
         {
             context.Edit(model);
         }
         return(RedirectToAction("Index"));
     }
 }