Esempio n. 1
0
 public ActionResult Add(BusinessGood a)
 {
     if (ModelState.IsValid)
     {
         BusinessGoods.Add(a);
         BusinessGood.AddOrUpdate(a);
         return(RedirectToAction("Index" /*,new { id = (int)Session["page"]}*/));
     }
     else
     {
         return(View(a));
     }
 }
Esempio n. 2
0
 public ActionResult Edit(BusinessGood a)
 {
     if (ModelState.IsValid)
     {
         int index = BusinessGoods
                     .IndexOf(BusinessGoods.FirstOrDefault(x => x.GoodId == a.GoodId));
         BusinessGoods[index] = a;
         BusinessGood.AddOrUpdate(a);
         return(RedirectToAction("Index" /*,new { id = (int)Session["page"]}*/));
     }
     else
     {
         return(View(a));
     }
 }