Example #1
0
 public void travelAgentfunction()
 {
     //HotelSupplier hs = new HotelSupplier();
     for (Int32 i = 0; i < 10; i++)
     {
         Thread.Sleep(500);
         Int32 p = HotelSupplier.getPrice();
         Console.WriteLine("Hotel{0} has everyday low price: ${1} each", Thread.CurrentThread.Name, p);
     }
 }
Example #2
0
        public void orderProcessMethod()
        {
            unitPrice = HotelSupplier.getPrice();
            int priceOfRooms = unitPrice * numOfRooms;

            totalAmount = priceOfRooms + (int)(priceOfRooms * tax) + locationCharge;

            //call Bank Service to validate the credit card
            creditCardValidityStatus = "Valid";

            Console.WriteLine("Order Received by Thread ID - " + receiverId + "\n" + "Order Placed by Thread ID - " + senderId + "\n" + "No. of rooms = " + numOfRooms +
                              "\n" + "Credit Card Number = " + cardNo + "\n" + "Total Amount of Charge = " + totalAmount + "\n" + "Credi Card Validity Status = " + creditCardValidityStatus + "\n");
        }