예제 #1
0
        public static void EshopDemo()
        {
            List <Variation> variations = new List <Variation>()
            {
                new ColorVariation(),
                new SizeVariation(),
                new FabricVariation()
            };

            Console.WriteLine("Hello,What tshirt color u want?");
            var colorInput = Console.ReadLine().Trim().ToUpper();
            var color      = SetColor(colorInput);

            Console.WriteLine("How about Size?");
            var sizeInput = Console.ReadLine().Trim().ToUpper();
            var size      = SetSize(sizeInput);

            Console.WriteLine("Material?");
            var fabricInput = Console.ReadLine().Trim().ToUpper();
            var fabric      = SetFabric(fabricInput);

            Console.WriteLine("Choose Payment Method 1) Credit Card 2) Cash 3) Bank Transfer");
            var paymentInput = Convert.ToInt32(Console.ReadLine().Trim());
            var tShirt       = new TShirt(color, size, fabric);
            var eshop        = new Eshop();

            eshop.SetVariationStrategy(variations);
            eshop.SelectPaymentMethod(paymentInput);
            eshop.PayTShirt(tShirt);
        }
        static void Main(string[] args)
        {
            IEnumerable <Variation> variations = new List <Variation>()
            {
                new ColorVariation(),
                new SizeVariation(),
                new FabricVariation()
            };


            var Tshirt       = CustomerInteraction.TshirtCreation();
            var paymentInput = CustomerInteraction.PaymentPreference();

            var eshop = new Eshop();

            eshop.SelectVariationMethod(variations);
            eshop.SelectPaymentMethod(paymentInput);
            eshop.PayTShirt(Tshirt);
        }
예제 #3
0
        static void Main(string[] args)
        {
            //Greek globalization system

            Console.OutputEncoding     = System.Text.Encoding.UTF8;
            CultureInfo.CurrentCulture = CultureInfo.CreateSpecificCulture("gr-GR");

            //Calculate Total cost and communicate the tshirt details with the user

            decimal amount = Eshop.CostAndCommunication();

            //Pay and type your shipment details

            Eshop.EShopDemo(amount);

            // Wait for user

            Console.WriteLine("Please press enter to continue");

            Console.Read();
        }
예제 #4
0
 static void Main(string[] args)
 {
     Eshop.EShopInterface();
 }