Guest User

Untitled

a guest
Jan 15th, 2019
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.75 KB | None | 0 0
  1. Option Strict On
  2. Public Class Buffet_Calculator
  3. Dim N_Adult As Double
  4. Dim N_Senior As Double
  5. Dim N_Children As Double
  6. Dim V_Cash As Double
  7. Dim V_HSBC As Double
  8. Dim V_DBS As Double
  9. Dim V_OpenRice As Double
  10. Dim Buffetdate As Date
  11. Private Sub B_Calculation_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles B_Calculation.Click
  12.  
  13. 'Input the number & set condition for people
  14. If IsNumeric(T_numberofA.Text) And IsNumeric(T_numberofS.Text) And IsNumeric(T_numberofC.Text) Then
  15. N_Adult = CDbl(T_numberofA.Text)
  16. N_Senior = CDbl(T_numberofS.Text)
  17. N_Children = CDbl(T_numberofC.Text)
  18. If N_Adult < 0 Or N_Senior < 0 Or N_Children < 0 Then
  19. MessageBox.Show("Number must be a positive.")
  20. ElseIf N_Adult + N_Senior + N_Children <= 0 Then
  21. MessageBox.Show("At least one person must be present")
  22. End If
  23. Else : MessageBox.Show("Number of people must be in integer.")
  24. End If
  25.  
  26. 'Define the date for available coupon & price calculation
  27.  
  28. Buffetdate = Buffet_DateTimePicker.Value
  29.  
  30. If Weekday(Buffetdate) = 0 Or Weekday(Buffetdate) = 6 Then
  31.  
  32. End If
  33.  
  34. If Buffetdate > #9/29/2012# Then L_ValueofHSBC.Text = "N/A (Beyond Promotion Period)"
  35.  
  36. If Buffetdate >= #9/29/2012# And Buffetdate <= #10/2/2012# Then
  37. L_ValueofDBS.Text = "N/A (Beyond Promotion Period)"
  38. End If
  39. If Buffet_DateTimePicker.Value >= #10/31/2012# Then L_ValueofDBS.Text = "N/A (Beyond Promotion Period)"
  40. If Buffet_DateTimePicker.Value > #7/31/2012# Then L_ValueofOpenRice.Text = "N/A (Beyond Promotion Period)"
  41.  
  42.  
  43. End Sub
  44. End Class
Add Comment
Please, Sign In to add comment