public static bool Deduct(int itemId, int quantity) { bool success = false; Product product = ProductRetrieve(itemId); Order items = OrderRetrieve(product); if (items.Quantity >= quantity) { if (items.Quantity > quantity) { OrderRepository.Update(product, quantity, false); success = true; } else { OrderRepository.Delete(items); success = true; } } return(success); }
public static bool CheckOut() { return(OrderRepository.ClearAll()); }
public static IEnumerable <Order> OrderRetrieveAll() { return(OrderRepository.RetrieveAll()); }
public static Order OrderRetrieve(Product item) { return(OrderRepository.Retrieve(item)); }