Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Option Strict On
- Public Class Buffet_Calculator
- Dim N_Adult As Double
- Dim N_Senior As Double
- Dim N_Children As Double
- Dim V_Cash As Double
- Dim V_HSBC As Double
- Dim V_DBS As Double
- Dim V_OpenRice As Double
- Dim Buffetdate As Date
- Private Sub B_Calculation_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles B_Calculation.Click
- 'Input the number & set condition for people
- If IsNumeric(T_numberofA.Text) And IsNumeric(T_numberofS.Text) And IsNumeric(T_numberofC.Text) Then
- N_Adult = CDbl(T_numberofA.Text)
- N_Senior = CDbl(T_numberofS.Text)
- N_Children = CDbl(T_numberofC.Text)
- If N_Adult < 0 Or N_Senior < 0 Or N_Children < 0 Then
- MessageBox.Show("Number must be a positive.")
- ElseIf N_Adult + N_Senior + N_Children <= 0 Then
- MessageBox.Show("At least one person must be present")
- End If
- Else : MessageBox.Show("Number of people must be in integer.")
- End If
- 'Define the date for available coupon & price calculation
- Buffetdate = Buffet_DateTimePicker.Value
- If Weekday(Buffetdate) = 0 Or Weekday(Buffetdate) = 6 Then
- End If
- If Buffetdate > #9/29/2012# Then L_ValueofHSBC.Text = "N/A (Beyond Promotion Period)"
- If Buffetdate >= #9/29/2012# And Buffetdate <= #10/2/2012# Then
- L_ValueofDBS.Text = "N/A (Beyond Promotion Period)"
- End If
- If Buffet_DateTimePicker.Value >= #10/31/2012# Then L_ValueofDBS.Text = "N/A (Beyond Promotion Period)"
- If Buffet_DateTimePicker.Value > #7/31/2012# Then L_ValueofOpenRice.Text = "N/A (Beyond Promotion Period)"
- End Sub
- End Class
Add Comment
Please, Sign In to add comment