Ejemplo n.º 1
0
 private ICategoryDiscount CreateCategoryDiscount()
 {
     ICategoryDiscount categoryDiscount = null;
     if (this.Product.Category == ProductCategory.Accessories)
     {
         categoryDiscount = new AccessoriesDiscount();
     }
     if (this.Product.Category == ProductCategory.Bikes)
     {
         categoryDiscount = new BikesDiscount();
     }
     if (this.Product.Category == ProductCategory.Cloathing)
     {
         categoryDiscount = new CloathingDiscount();
     }
     return categoryDiscount;
 }
Ejemplo n.º 2
0
        private ICategoryDiscount CreateCategoryDiscount()
        {
            ICategoryDiscount categoryDiscount = null;

            if (this.Product.Category == ProductCategory.Accessories)
            {
                categoryDiscount = new AccessoriesDiscount();
            }
            if (this.Product.Category == ProductCategory.Bikes)
            {
                categoryDiscount = new BikesDiscount();
            }
            if (this.Product.Category == ProductCategory.Cloathing)
            {
                categoryDiscount = new CloathingDiscount();
            }
            return(categoryDiscount);
        }