943,923 Members | Top Members by Rank

Ad:
  • VB.NET Discussion Thread
  • Unsolved
  • Views: 783
  • VB.NET RSS
Oct 5th, 2008
0

help with time.....

Expand Post »
hi, i'm currently doin a booking system...i have a problem regarding with the booking date...

Ok, lets say i'm booking a table on the 7th of october at 7.00pm which is 2 days from today...once i book the table it is booking from today...the timer runs from now until the 7th of october at 7.00pm...i want the timer to run at 6.00pm on 7th of october any idea how to solve this problem...here is my code

the reservation confirm button

VB.NET Syntax (Toggle Plain Text)
  1.  
  2. Private Sub ButtonA_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CBButton1.Click
  3. Rpanel1.Hide()
  4. Dim time1 As DateTime
  5. time559 = FormatDateTime("5:00:00 PM", DateFormat.LongTime)
  6. time1001 = FormatDateTime("10:01:00 PM", DateFormat.LongTime)
  7. time1 = FormatDateTime(Hour(Btime1.Value) & ":" & Minute(Btime1.Value))
  8. If time1 < time559 Or time1 > time1001 Then
  9. MsgBox("Booking Time is only available from 6.00 PM to 10.00 PM ")
  10. Rpanel1.Show()
  11. ElseIf Bdate1.Value < Today Then
  12. MsgBox("Error date is a past date, Enter again")
  13. Rpanel1.Show()
  14. Else
  15. PListBox1.Items.Add("Customer Name" & ControlChars.Tab & _
  16. ControlChars.Tab & "Booking Date" & ControlChars.Tab & _
  17. ControlChars.Tab & "Booking Time")
  18. status1 = "Booked"
  19. Table1.BackColor = Color.Khaki
  20. PListBox1.Items.Add(Bcusname1.Text & ControlChars.Tab & _
  21. ControlChars.Tab & ControlChars.Tab & Bdate1.Value & ControlChars.Tab & _
  22. ControlChars.Tab & FormatDateTime(Btime1.Value, DateFormat.LongTime))
  23. End If

the timer code...
VB.NET Syntax (Toggle Plain Text)
  1.  
  2. Private Sub Timer2_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer2.Tick
  3. Dim btimeA As DateTime
  4. Dim bdateA As DateTime
  5. bdateA = FormatDateTime(Bdate1.Value, DateFormat.ShortDate)
  6. btimeA = FormatDateTime(Btime1.Value, DateFormat.LongTime)
  7. If FormatDateTime(TimeOfDay, DateFormat.LongTime) = btimeA.AddMinutes(20) And FormatDateTime(Today, DateFormat.ShortDate) = bdateA Then
  8. MsgBox("Booking Time up Mr/Miss " & Bcusname1.Text & " is late,reservation canceled")
  9. Table1.BackColor = Color.PaleGreen
  10. status2 = "Available"
  11. End If

thank u for ur help....
Similar Threads
Reputation Points: 10
Solved Threads: 0
Light Poster
gopi17 is offline Offline
39 posts
since Sep 2008
Oct 5th, 2008
0

Re: help with time.....

you need to decode the booking time .
findout the time 1 hr before that and book accordingly.
Featured Poster
Reputation Points: 665
Solved Threads: 427
Posting Genius
debasisdas is offline Offline
6,406 posts
since Feb 2007

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in VB.NET Forum Timeline: using generic procedures
Next Thread in VB.NET Forum Timeline: Will any one plz help me ??





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC