Quantcast
Channel: VBForums - Visual Basic .NET
Viewing all articles
Browse latest Browse all 27417

How do i go about this ...

$
0
0
Im writing a booking programme which has time slots down the left. When a booking is made a label is dynamically created at the hr of booking start and its size equates to the size of the booking. Im currently now doing the code for when another booking exists at the same time so that the new booking appears to the right of the exisiting booking. Its not pretty but did that using a select case changing the variable to 1 when its taken -

Code:

Case Timeout.Contains("08:00")
                    Select Case True
                        Case slot81 = "0"
                            label.Location = CType(New System.Drawing.Point(107, 38), Point)
                            slot81 = "1"
                        Case slot82 = "0"
                            label.Location = CType(New System.Drawing.Point(243, 38), Point)
                            slot82 = "1"
                        Case slot83 = "0"
                            label.Location = CType(New System.Drawing.Point(379, 38), Point)

It works fine for any booking starting at the same time but i need to also check for bookings that cover times too. So a booking at 8am till 12 means another booking from 11 to 13 will have to appear in column 2 but without doing stupid amounts of code i cant think/know how to do it?

I know the length of the bookings in hrs if that helps for when the label is drawn i use it to set the height of the label, again using a select case :

Code:

Select Case slotlength

            Case "1"
                label.Size = CType(New System.Drawing.Size(130, 82), Point)

                    Case ("2")
                label.Size = CType(New System.Drawing.Size(130, 170), Point)

                          Case "3"
                label.Size = CType(New System.Drawing.Size(130, 258), Point)

Any advice?

Viewing all articles
Browse latest Browse all 27417

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>