public static void EShopDemo()
        {
            var color  = FactoryTShirt.ChoseColor();
            var size   = FactoryTShirt.ChoseSize();
            var fabric = FactoryTShirt.ChoseFabric();

            TShirt shirt = new TShirt(color, size, fabric);

            FactoryCostTShirt.CostTShirt(shirt);

            CustomerPay.PayTShirt(shirt);
        }
        public static TShirt CostTShirt(TShirt shirt)
        {
            ColorVariation colorVariation = new ColorVariation();

            colorVariation.Cost(shirt);
            SizeVariation sizeVariation = new SizeVariation();

            sizeVariation.Cost(shirt);
            FabricVariation fabricVariation = new FabricVariation();

            fabricVariation.Cost(shirt);
            return(shirt);
        }
        public static void PayTShirt(TShirt shirt)
        {
            Console.ForegroundColor = ConsoleColor.Green;
            Console.WriteLine($"Your tshirt cost: {shirt.Price}");
            Console.ForegroundColor = ConsoleColor.Yellow;
            Console.WriteLine("-----------------------------------------------------------------------------------------------");
            Console.Write("How would you like to pay? 1) Debit Cart , 2) Bank Transfer, 3) Cash: ");
            Console.ForegroundColor = ConsoleColor.White;

            var paytmentType = int.Parse(Console.ReadLine().Trim());
            var choice       = new ChoiceCustomer();

            choice.SetDueAmount(shirt.Price);
            var simpleEshop = new SimpleEshop();
            var success     = simpleEshop.PayOrder(paytmentType, choice);

            Console.WriteLine(success);
            Console.Read();
        }
Ejemplo n.º 4
0
 public override decimal Cost(TShirt tshirt)
 {
     tshirt.Price += _fabricVariations[tshirt.Fabric];
     return(tshirt.Price);
 }
Ejemplo n.º 5
0
 public override decimal Cost(TShirt tshirt)
 {
     tshirt.Price += _sizeCosts[tshirt.Size];
     return(tshirt.Price);
 }
Ejemplo n.º 6
0
 public override decimal Cost(TShirt tshirt)
 {
     tshirt.Price += _colorCosts[tshirt.Color];
     return(tshirt.Price);
 }
Ejemplo n.º 7
0
 public abstract decimal Cost(TShirt tshirt);