public int PalceOrder(string phoneName, int customerId)
        {
            Console.WriteLine("[" + this.GetType().ToString() + "]" + " Looking for customer in repository");
            ICustomer customer = customers.Find(customerId);

            if (null == customer)
            {
                Console.WriteLine("Customer not found.");
                return(-1);
            }
            Console.WriteLine("[" + this.GetType().ToString() + "]" + " Customer found");
            Console.WriteLine("[" + this.GetType().ToString() + "]" + " Calculating order price");
            int price = priceCalculator.CalculatePrice(customer);

            Console.WriteLine("[" + this.GetType().ToString() + "]" + " Creating order");
            IOrder newOrder = salesFactory.CreateOrder(phoneName, customerId, price);

            Console.WriteLine("[" + this.GetType().ToString() + "]" + " Saving order");
            int orderId = orders.Save(newOrder);

            Console.WriteLine("[" + this.GetType().ToString() + "]" + " Sending email to customer");
            string message = "Your order was accepted! Order ID -- " + orderId;

            emailSender.SendEmail(customer.Email, message);
            return(orderId);
        }
        public int PalceOrder(string phoneName, int customerId)
        {
            Console.WriteLine("[" + this.GetType().ToString() + "]" + " Looking for customer in repository");
            ICustomer customer = customers.Find(customerId);

            if (null == customer)
            {
                Console.WriteLine("Customer not found.");
                return(-1);
            }
            Console.WriteLine("[" + this.GetType().ToString() + "]" + " Customer found");
            Console.WriteLine("[" + this.GetType().ToString() + "]" + " Calculating order price");
            int price = priceCalculator.CalculatePrice(customer);

            Console.WriteLine("[" + this.GetType().ToString() + "]" + " Creating order");
            IOrder newOrder = salesFactory.CreateOrder(phoneName, customerId, price);

            Console.WriteLine("[" + this.GetType().ToString() + "]" + " Saving order");
            int orderId = orders.Save(newOrder);

            return(orderId);
        }