help with time.....

Please support our VB.NET advertiser: Intel Parallel Studio Home
Reply

Join Date: Sep 2008
Posts: 23
Reputation: gopi17 is an unknown quantity at this point 
Solved Threads: 0
gopi17 gopi17 is offline Offline
Newbie Poster

help with time.....

 
0
  #1
Oct 5th, 2008
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

  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...
  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....
Reply With Quote Quick reply to this message  
Join Date: Feb 2007
Posts: 2,134
Reputation: debasisdas will become famous soon enough debasisdas will become famous soon enough 
Solved Threads: 132
debasisdas's Avatar
debasisdas debasisdas is offline Offline
Postaholic

Re: help with time.....

 
0
  #2
Oct 5th, 2008
you need to decode the booking time .
findout the time 1 hr before that and book accordingly.
Share your Knowledge.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the VB.NET Forum
Thread Tools Search this Thread



Tag cloud for VB.NET
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC