Ejemplo n.º 1
0
        public Int32 rejected_order = 0;   // get the count of rejected order
        public void orderFunc(OrderObject order)
        {
            // get the card number for the order
            int cardNo = order.getCardNum();

            // check if the card is vald
            if (cardNo >= 5000 && cardNo <= 7000)
            {
                // get the total amount of the order
                double orderTotal = order.getUnitPrice() * order.getAmount() * .081;
                string recev_id   = order.getReceiverID();

                // order valid , so put the order in the confirmation buffer
                Program.confirmed_order.Put(order.getSenderID(), orderTotal, recev_id);
            }
            else
            {
                rejected_order++; // if order rejected then increament the count of rejected order
            }
        }
Ejemplo n.º 2
0
        //Function to encrypt the order
        public static string encrypt(OrderObject oo)
        {
            string encrypted = oo.getSenderID() + ":" + oo.getCardNum() + ":" + oo.getReceiverID() + ":" + oo.getAmount() + ":" + oo.getUnitPrice();

            return(encrypted);
        }