Hi guys.

Im doing a project for college where i have a booking system.
The people book for a time slot and i would like to work out how to have a break down of time slots say for one hour periods throughout the day.

Something similar to the bottom half of this picture

http://www.filebuzz.com/software_screenshot/full/240697-Online_Rental_System.jpg

How would i go about something like this in VB.NET?


Regards


Ross

Dani AI

Generated

A practical, low-risk approach is to separate a simple booking model from the view and reuse it for month/week/day. Keep a single Bookings table (BookingId, ResourceId for the instructor, StartUtc, EndUtc, Status, ClientId). Detect overlaps in SQL with a single predicate (Start < @newEnd AND End > @newStart) so you can reject conflicting inserts reliably.

For the UI, start simple: build a matrix where rows = time slots and columns = instructors. As suggested, a ListView/Repeater is a good starter — create a 2D array or DTO in the code-behind that maps bookings into slot cells, then bind. Example VB loop to generate hourly slots:

Dim t = DateTime.Today.AddHours(8)
Dim endT = DateTime.Today.AddHours(18)
Dim slot = TimeSpan.FromHours(1)

While t < endT
  ' create row for t
  t = t.Add(slot)
End While

Use a server-side overlap check (or a stored proc) inside a transaction when inserting to avoid race conditions:

SELECT COUNT(*) FROM Bookings
WHERE ResourceId = @r AND StartUtc < @newEnd AND EndUtc > @newStart;

Practical tips: store times in UTC and convert for display to avoid DST bugs; round times to your slot granularity; load only the visible date range to keep queries fast; color-code status and make cell height proportional to duration. If you prefer an off-the-shelf scheduler later, that’s fine (as hinted) — but implement the matrix first so you understand the data and edge cases.

Recommended Answers

All 10 Replies

How's this for a picture?
Forbidden

You don't have permission to access /software_screenshot/full/240697-Online_Rental_System.jpg on this server.

i can view it just fine? :S

Its just a random one i grabbed off google images

Still Forbidden here.
Try attaching the image to your next post.

here it is i think

And which part of that image/app do you have problems with?

Id just like some advice on how to best go about displaying a time slot view like the bottom half of that picture.

Basically, there are 2 people giving lessons. You can book 1 hour lessons with them and they need some form of diary type thing. This needs to display a monthly, weekly and daily view.

Just want some points in the right direction kinda thing

Any ideas guys?

Anyone know of a vb.net component to do this?

Was a.f.f.(away.from.forum:D).
As for a component to do this, I have no clue if there is one or where to find one online.

To get started on something similar to that time slot view, I would use a ListView with columns.
After you get a sense of how all should work, try to create your own Custom ListView and modify it as needed.

Other than that, good luck.

Read here:

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.