Esempio n. 1
0
 /*
  * Methods
  */
 public void Ship(Customer customer, DeliveryService service)
 {
     if (!customer.IsLocal)
     {
         service.Deliver(this, customer);
     }
 }
Esempio n. 2
0
        static void Main(string[] args)
        {
            Product tinkerToys = new Product()
            {
                Title       = "Tinker Toys",
                Description = "You can build anything you want",
                Price       = 32.49,
                Quantity    = 25
            };

            Customer marcus = new Customer()
            {
                FirstName = "Marcus",
                LastName  = "Fulbright",
                IsLocal   = false
            };

            DeliveryService UPS = new DeliveryService()
            {
                Name        = "UPS",
                TransitType = "train"
            };

            // Ship the tinker toys to Marcus using UPS
            tinkerToys.Ship(marcus, UPS);
        }
Esempio n. 3
0
        static void Main(string[] args)
        {
            Customer customer = new Customer();

            customer.ChangeFirstName("a");
            Console.Write(customer.FullName);



            Product tinkerToys = new Product()
            {
                Title       = "Tinker Toys",
                Description = "You can build anything you want"
            };

            Customer marcus = new Customer()
            {
                FirstName = "Marcus",
                LastName  = "Fulbright",
                IsLocal   = false
            };

            Customer jane = new Customer();

            jane.FirstName = "Jane";
            jane.LastName  = "Doe";
            jane.IsLocal   = false;

            DeliveryService UPS = new DeliveryService()
            {
                Name        = "UPS",
                TransitType = "train"
            };

            Console.WriteLine(tinkerToys.Quantity);

            //UPS.TransitType = "carrier pigeon";


            // Ship the tinker toys to Marcus using UPS
            tinkerToys.Ship(marcus, UPS);
        }