예제 #1
0
 public void AddMultiCart(MultiCart multiCart)
 {
     if (forTests)
     {
         return;
     }
     multiCarts.Add(multiCart);
     SaveChanges();
 }
예제 #2
0
 public void SetUp()
 {
     DbCommerce.GetInstance().StartTests();
     Workshop192.MarketManagment.System.GetInstance().OpenStore("store1");
     Workshop192.MarketManagment.System.GetInstance().OpenStore("store2");
     store1    = Workshop192.MarketManagment.System.GetInstance().GetStore("store1");
     store2    = Workshop192.MarketManagment.System.GetInstance().GetStore("store2");
     multiCart = new MultiCart(1);
     store1.AddProducts(new Product(1, "can", "tin", 5), 5);
     store1.AddProducts(new Product(2, "floor", "wood", 10), 10);
     store2.AddProducts(new Product(3, "nike", "shoes", 25), 5);
 }
예제 #3
0
        public static bool CheckAvailable(int userID)
        {
            MultiCart carts = Workshop192.MarketManagment.System.GetInstance().GetMultiCart(Workshop192.UserManagment.AllRegisteredUsers.GetInstance().GetUser(userID).GetMultiCart());

            return(Workshop192.MarketManagment.System.GetInstance().CheckProductsAvailability(carts));
        }