Beispiel #1
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);
               }
               }
        }
Beispiel #2
0
        public void UpdateCheck(string username)
        {
            using (var rep = new ShoppingCartRepository())
               {
               List<ShoppingCart> shop = rep.GetAll().Where(x => x.Username.Equals(username)).ToList();

               foreach (ShoppingCart a in shop)
               {
                   a.isBought = true;

                   rep.Update(a);
               }
               }
        }