Esempio n. 1
0
        private void calculateTotal()
        {
            double amount;
            double tax            = 0.09 * (double)order.getnoRooms() * order.getPrice();
            double locationCharge = 19;

            amount = (double)order.getnoRooms() * order.getPrice() + tax + locationCharge;
            order.setAmt(amount);

            // inform agency of completed order
            if (orderConfirmation != null)
            {
                orderConfirmation(order);
            }
        }
Esempio n. 2
0
        public void setOrder(OrderClass s)
        {
            StringBuilder temp = new StringBuilder();
            temp.Append(s.getAmt().ToString());  //Appends amount to string
            temp.Append(" ");
            temp.Append(s.getCardNo().ToString()); //Appends card number to string
            temp.Append(" ");
            temp.Append(s.getID().ToString()); //Appends ID to string
            temp.Append(" ");
            temp.Append(s.getOrderId().ToString()); //Appends orderId to string
            temp.Append(" ");
            temp.Append(s.getnoRooms().ToString()); //Appends number of rooms to string
            temp.Append(" ");
            temp.Append(s.getPrice().ToString());  //Appends price per room to string
            temp.Append(" ");

            order = temp.ToString(); //builds string
            EncryptionService.ServiceClient serviceClient = new EncryptionService.ServiceClient(); //Instantiates encryption service
            order = serviceClient.Encrypt(order);  //encrypts string
        }
Esempio n. 3
0
        public void setOrder(OrderClass s)
        {
            StringBuilder temp = new StringBuilder();

            temp.Append(s.getAmt().ToString());     //Appends amount to string
            temp.Append(" ");
            temp.Append(s.getCardNo().ToString());  //Appends card number to string
            temp.Append(" ");
            temp.Append(s.getID().ToString());      //Appends ID to string
            temp.Append(" ");
            temp.Append(s.getOrderId().ToString()); //Appends orderId to string
            temp.Append(" ");
            temp.Append(s.getnoRooms().ToString()); //Appends number of rooms to string
            temp.Append(" ");
            temp.Append(s.getPrice().ToString());   //Appends price per room to string
            temp.Append(" ");


            order = temp.ToString();                                                               //builds string
            EncryptionService.ServiceClient serviceClient = new EncryptionService.ServiceClient(); //Instantiates encryption service
            order = serviceClient.Encrypt(order);                                                  //encrypts string
        }