コード例 #1
0
        // Decode the order
        public static string Decode(string order)
        {
            string decryptedOrder = Decrypt(order, "ABCDEFGHIJKLMNOP");
            // Debugging
            Console.WriteLine("Order Decrypted", order, decryptedOrder);
            string[] orderParts = decryptedOrder.Split(',');

            OrderClass newOrder = new OrderClass(orderParts[0], Convert.ToInt64(orderParts[1]), orderParts[2], Convert.ToInt32(orderParts[3]), Convert.ToDateTime(orderParts[4]));

            return newOrder.getOrder();
        }
コード例 #2
0
 public void placeorder(int price, string receiverId, long cardNo)
 {
     this.price = price;
     amount = rng.Next(5, 10);
     senderId = Thread.CurrentThread.Name;
     DateTime currentDate = DateTime.Now;
     Console.WriteLine("Order placed by Travel Agency {0} at : {1}", Thread.CurrentThread.Name, currentDate);
     OrderClass Order = new OrderClass(senderId, cardNo, receiverId, amount, currentDate);
     EncodedOrder = EncoderDecoder.Encode(Order.getOrder());
     Program.mcb.setOneCell(EncodedOrder);
 }