Ejemplo n.º 1
0
        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;
        }
Ejemplo n.º 2
0
 public addDiscount(iPolicy pol1, iPolicy pol2)
 {
     this.policy1 = pol1;
     this.policy2 = pol2;
 }
Ejemplo n.º 3
0
 public void addPurchasePolicy(iPolicy policy)
 {
     this.purchasePolicies.Add(policy);
 }
Ejemplo n.º 4
0
        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);
        }
Ejemplo n.º 5
0
 public DiscountPolicy(iPolicy pol1, iPolicy pol2)
 {
     this.policy1 = pol1;
     this.policy2 = pol2;
 }
Ejemplo n.º 6
0
 public maxPolicy(iPolicy pol1, iPolicy pol2)
 {
     this.policy1 = pol1;
     this.policy2 = pol2;
 }