Is there any way I can make this select case more efficient?
Select Case cboBoard.SelectedIndex
Case 0 To 1
If intDaysRented = 0 Then
If intHoursRented > 3 Then
lblCost.Text = FormatCurrency(arrDailyRates(cboBoard.SelectedIndex), , TriState.True, TriState.True)
Else
lblCost.Text = FormatCurrency((arrHourlyRates(cboBoard.SelectedIndex) * intHoursRented), , TriState.True, TriState.True)
End If
Else
If intHoursRented > 3 Then
lblCost.Text = FormatCurrency((arrDailyRates(cboBoard.SelectedIndex) * intDaysRented), , TriState.True, TriState.True)
Else
lblCost.Text = FormatCurrency(((arrDailyRates(cboBoard.SelectedIndex) * intDaysRented) + (arrHourlyRates(0) * intHoursRented)), , TriState.True, TriState.True)
End If
End If
Case 2
If intDaysRented = 0 Then
If intHoursRented > 2 Then
lblCost.Text = FormatCurrency(arrDailyRates(cboBoard.SelectedIndex), , TriState.True, TriState.True)
Else
lblCost.Text = FormatCurrency((arrHourlyRates(cboBoard.SelectedIndex) * intHoursRented), , TriState.True, TriState.True)
End If
Else
If intHoursRented > 2 Then
lblCost.Text = FormatCurrency((arrDailyRates(cboBoard.SelectedIndex) * intDaysRented), , TriState.True, TriState.True)
Else
lblCost.Text = FormatCurrency(((arrDailyRates(cboBoard.SelectedIndex) * intDaysRented) + (arrHourlyRates(2) * intHoursRented)), , TriState.True, TriState.True)
End If
End If
Case Else
MsgBox("Something has gone terribly wrong with board selecting process.")
End
End Select
these would be the possible inputs that can be brought into the calculations. and in my combo box boogie is index 0 paddle 1 and surf 2
arrDailyRates(0) = 10 'for Boogie Board
arrDailyRates(1) = 15 'for Paddle Board
arrDailyRates(2) = 20 'for Surf Board
arrHourlyRates(0) = 3 'for Boogie Board
arrHourlyRates(1) = 5 'for Paddle Board
arrHourlyRates(2) = 7 'for Surf Board