public static void agencyFunction()
        {
            try
            {
                while (true)
                {
                    Thread.Sleep(3000);
                    lock (lockobj)
                    {
                        if (HotelSupplier.roomPrice1 < HotelSupplier.oldRoomPrice1) // if there is a price drop then a certain range of room are booked.
                        {
                            numberOfRooms = randamount.Next(30, 50);
                        }
                        else
                        {
                            numberOfRooms = randamount.Next(20, 30);
                        }
                        int         cardNumber = randcardNo.Next(5000, 7000);                                                         // uses a random functon to generate a creditcard number
                        OrderObject order      = new OrderObject(Thread.CurrentThread.Name, cardNumber, numberOfRooms, DateTime.Now); //stores the order in the orderobject
                        string      str        = EncodeDecode.encode(order);
                        Program.buffer1.SetCellOne(str);                                                                              // stores the order in the multi cell buffer after encoding

                        //  MultiCellBuffer.SetCellOne(str);

                        Console.WriteLine("\n{0} sent an order of {1} rooms \nTime Stamp Of Order = {2}", Thread.CurrentThread.Name, numberOfRooms, DateTime.Now);
                        Thread.Sleep(500);
                    }
                }
            }

            catch (Exception e)
            {
                Console.WriteLine("Error" + e.Message);
            }
        }
        public void HotelSuppliers()
        {
            Console.WriteLine("{0}  --- current room price $150 \n ---------------------------------", Thread.CurrentThread.Name);
            if (Thread.CurrentThread.Name == "hotel supplier 1")
            {
                // creates 5 travel agency threads
                Thread[] agencyThread = new Thread[5];
                for (int i = 0; i < 5; i++)
                {
                    agencyThread[i]      = new Thread(new ThreadStart(TravelAgency.agencyFunction));
                    agencyThread[i].Name = "agency " + (i + 1).ToString();
                    agencyThread[i].Start();
                }
                try
                {
                    while (true)
                    {
                        Thread.Sleep(500);
                        lock (lockObject)
                        {
                            if (counter >= 20)
                            {
                                break;
                            }
                            // gets the order object from the multicellbuffer and decodes it
                            OrderObject orderObject = EncodeDecode.decode(Program.buffer1.GetCellOne());

                            //  Console.WriteLine("{0}-----------", Thread.CurrentThread.Name);
                            int newRoomPrice1 = PricingModel.calculatePrice(roomPrice1);                                       // calls the pricing model to generate a new price
                            PriceChange(newRoomPrice1);                                                                        // checks the new room price using the price change function
                            //  Console.WriteLine("reciept from {0}", Thread.CurrentThread.Name);
                            Thread processingThread = new Thread(() => OrderProcessing.orderProcess(orderObject, roomPrice1)); // creates the order processing threads
                            processingThread.Start();
                        }
                    }
                }
                catch (Exception e)
                {
                    Console.WriteLine(" Error in hotel supplier " + e.Message);
                }
            }
            else
            {
                // creates 5 travel agency threads
                Thread[] agencyThread = new Thread[5];
                for (int i = 0; i < 5; i++)
                {
                    agencyThread[i]      = new Thread(new ThreadStart(TravelAgency.agencyFunction2));
                    agencyThread[i].Name = "agency " + (i + 1).ToString();
                    agencyThread[i].Start();
                }


                try
                {
                    while (true)
                    {
                        Thread.Sleep(500);
                        lock (lockObject)
                        {
                            if (counter >= 20)
                            {
                                Thread.Sleep(4500);
                                Console.WriteLine("------------EXCEEDED MAXIMUM ALLOWED PRICE CUTS------------- ");
                                break;
                            }
                            // gets the order object from the multicellbuffer and decodes it
                            OrderObject orderObject = EncodeDecode.decode(Program.buffer1.GetCellOne());

                            //  Console.WriteLine("{0}-----------", Thread.CurrentThread.Name);
                            int newRoomPrice2 = PricingModel.calculatePrice(roomPrice2);                                       // calls the pricing model to generate a new price
                            PriceChange2(newRoomPrice2);                                                                       // checks the new room price using the price change function
                            //  Console.WriteLine("reciept from {0}", Thread.CurrentThread.Name);
                            Thread processingThread = new Thread(() => OrderProcessing.orderProcess(orderObject, roomPrice2)); // creates the order processing threads
                            processingThread.Start();
                        }
                    }
                }
                catch (Exception e)
                {
                    Console.WriteLine(" Error in hotel supplier " + e.Message);
                }
            }
        }