public Receipt(ReceiptData receiptData) { this.receiptId = receiptData.receiptID; this.basket = new ShoppingBasket(receiptData.basket); this.discount = null;//new iPolicyDiscount(receiptData.discount); //todo this.purchasePolicy = null; //this.actualProducts = new LinkedList<Product>(); //foreach (ProductsInReceiptData pInR in ProductsInReceiptDAL.getProducts(this.receiptId)) //this.actualProducts.Add(new Product(ProductInfo.getProductInfo(pInR.productID), pInR.amount, 0)); // get products and fill in this.products this.price = receiptData.price; this.date = receiptData.date; this.receiptId = receiptData.receiptID; }
public addDiscount(iPolicy pol1, iPolicy pol2) { this.policy1 = pol1; this.policy2 = pol2; }
public void addPurchasePolicy(iPolicy policy) { this.purchasePolicies.Add(policy); }
public void addCondetioningPolicyByProductAmount(string name, string category, string man, int minAmount, iPolicy condition) { iPolicy policy = new ConditioningPolicy(p => p.info.Equals(ProductInfo.getProductInfo(name, category, man)) && p.amount >= minAmount); // add the condition(s) policy.addPolicy(condition); this.purchasePolicies.Add(policy); }
public DiscountPolicy(iPolicy pol1, iPolicy pol2) { this.policy1 = pol1; this.policy2 = pol2; }
public maxPolicy(iPolicy pol1, iPolicy pol2) { this.policy1 = pol1; this.policy2 = pol2; }