float cal(float day)
    {
        Boolean isElegible;

        if (customerList.SelectedItem.Text == "Returning Customer")
        {
            isElegible = true;
        }
        else
        {
            isElegible = false;
        }

        float price;

        if (hotelList.SelectedItem.Text == "Tulib")
        {
            price = 150.0f;
        }
        else if (hotelList.SelectedItem.Text == "Seeb")
        {
            price = 250.0f;
        }
        else if (hotelList.SelectedItem.Text == "Naseem")
        {
            price = 200.0f;
        }
        else
        {
            price = 400.0f;
        }

        float totalPrice, discount, GST, RBD;
        int   noofRooms = Convert.ToInt16(roomsLabel.Text);

        if (isElegible)
        {
            totalPrice    = price * noofRooms;
            totalPrice    = totalPrice * day;
            discount      = totalPrice * 0.25f;
            GST           = totalPrice * 0.06f;
            RBD           = totalPrice + GST;
            totalPrice    = totalPrice - discount + GST;
            rbdLabel.Text = RBD.ToString();
            return(totalPrice);
        }
        else
        {
            totalPrice    = price * noofRooms;
            totalPrice    = totalPrice * day;
            GST           = totalPrice * 0.06f;
            totalPrice    = totalPrice + GST;
            rbdLabel.Text = "No Discount";
            return(totalPrice);
        }
    }
示例#2
0
 public void setDatabaseState(RBD.DB.DatabaseState databaseState)
 {
     DatabaseState = databaseState;
 }
示例#3
0
 public void setConnector(RBD.DB.DbConnector connector)
 {
     this.connector = connector;
 }