예제 #1
0
 public void Delete(int model)
 {
     using (var rep = new ShoppingCartRepository())
        {
        var dev = rep.GetById(model);
        rep.Delete(dev);
        }
 }
예제 #2
0
        public void Update(ShoopingCartView modelVie)
        {
            using (var rep = new ShoppingCartRepository())
               {
               var dev = rep.GetById(modelVie.Id);

               if (dev != null)
               {

                   dev.Qty = modelVie.Qty;
                   dev.SubCost = modelVie.Qty*dev.Price;

                   rep.Update(dev);
               }
               }
        }