public void EventHandler_ConfirmationStatus(string message)
        {
            Decoder decode_test = new Decoder();
            OrderClass obj = new OrderClass();
            obj = decode_test.decryptString(message);

            if (obj.get_senderId() == this.name)
            {
                Console.WriteLine("\n\n\n***************  ORDER STATUS  ***************");
                Console.WriteLine("Travel {0} placed an order of {1} ticktes to Airline {2}", obj.get_senderId(), obj.get_amount(), obj.get_receiverId());
                Console.WriteLine("The price of each ticket is ${0}", obj.get_unitprice());
                Console.WriteLine("The total amount charged is : ${0}", obj.get_totalamount());
                Console.WriteLine("The order is charged to card number  : {0}", obj.get_cardNo());

                if (obj.get_confirmationstatus())
                {
                    Console.WriteLine("Congratulations !! the order has been processed. Have a safe Flight !");
                }
                else
                {
                    Console.WriteLine("No Tickets Available. Your order could not be processed at this time !");
                }

                stopWatch.Stop();
                timeSpan = stopWatch.Elapsed;
                Console.WriteLine("Total time taken for order confirmation: " + timeSpan.Milliseconds);

                Console.WriteLine("**************************************************");
                Console.WriteLine("\n\n\n");

            }
        }
        public void EventHandler_ConfirmationStatus(string message)
        {
            Decoder    decode_test = new Decoder();
            OrderClass obj         = new OrderClass();

            obj = decode_test.decryptString(message);


            if (obj.get_senderId() == this.name)
            {
                Console.WriteLine("\n\n\n***************  ORDER STATUS  ***************");
                Console.WriteLine("Travel {0} placed an order of {1} ticktes to Airline {2}", obj.get_senderId(), obj.get_amount(), obj.get_receiverId());
                Console.WriteLine("The price of each ticket is ${0}", obj.get_unitprice());
                Console.WriteLine("The total amount charged is : ${0}", obj.get_totalamount());
                Console.WriteLine("The order is charged to card number  : {0}", obj.get_cardNo());

                if (obj.get_confirmationstatus())
                {
                    Console.WriteLine("Congratulations !! the order has been processed. Have a safe Flight !");
                }
                else
                {
                    Console.WriteLine("No Tickets Available. Your order could not be processed at this time !");
                }

                stopWatch.Stop();
                timeSpan = stopWatch.Elapsed;
                Console.WriteLine("Total time taken for order confirmation: " + timeSpan.Milliseconds + "milliseconds");

                Console.WriteLine("**************************************************");
                Console.WriteLine("\n\n\n");
            }
        }
        public string encryptString(OrderClass order)
        {
            try
            {
                temp = (order.get_senderId()) + "," + Convert.ToString(order.get_cardNo()) + "," + (order.get_receiverId())
                    + "," + Convert.ToString(order.get_amount()) + "," + Convert.ToString(order.get_unitprice()) + "," +
                    Convert.ToString(order.get_totalamount()) + "," + Convert.ToString(order.get_confirmationstatus());

                encryptedString = client.Encrypt(temp);
            }
            catch(Exception e)
            {
                Console.WriteLine("Exception Occured while Encoding" + e.Message.ToString());
            }

            return encryptedString;
        }
Example #4
0
        public string encryptString(OrderClass order)
        {
            try
            {
                temp = (order.get_senderId()) + "," + Convert.ToString(order.get_cardNo()) + "," + (order.get_receiverId())
                       + "," + Convert.ToString(order.get_amount()) + "," + Convert.ToString(order.get_unitprice()) + "," +
                       Convert.ToString(order.get_totalamount()) + "," + Convert.ToString(order.get_confirmationstatus());

                encryptedString = client.Encrypt(temp);
            }
            catch (Exception e)
            {
                Console.WriteLine("Exception Occured while Encoding" + e.Message.ToString());
            }

            return(encryptedString);
        }