473,785 Members | 2,446 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Scheduling movies in a database

Hello,

I have a ProgramItem-class as follow:

mItemID as Integer

mDtg as shortDateTime

mMovieID as Integer (linked to a ICollection of Movies from a table Movies)

mTheaterID as Integer (linked to a ICollection Theaters from a table
Theaters)

And a Server 2005 TSQL-tabel MovieProgram:

ID (int)
DTG (shortDateTime)
MovieID (int)
TheaterID (int)

1
22-03-2007 13:00
24
6

2
22-03-2007 14:30
13 (playtime = 02:00 hrs)
4

3
22-03-2007 15:25
68
3

4
22-03-2007 17:00
19
4

5
22-03-2007 20:00
84
3


I wish to schedule a ProgramItem (retrieved movie playtime = 01:30) on
22-03-2007 15:00 in theater 4

How can I find out that:

1: theater 4 is available at that time (in this example it is not)

2: and there is enough time to project the movie before the next planned
movie in the same theater starts (see ID 2 & 4)

I have al ready figure this out:

Dim intTimeslot As integer

Dim prgItem As ProgramItem

With prgItem

..Dtg = "22-03-2007 15:00"

..MovieId = 54

..TheaterID = 4

End With

'Here comes the code for testing if there is enough time to project the
movie, some help 'will be appreciated!

If intTimeslot = 1 then

'Movie can be planned as suggested

ScheduleMovie(p rgItem) ' save object prgItem in table MovieProgram

ElseIf intTimeslot = 2 then

'Movie can be planned but with modified Starttime (DTG)

prgItem.Dtg = '22-03-2007 hh:mm'

scheduleMovie(p rgItem)

Else

MsgBox("Show Error: theater is occupied")

End If

Thanks in advance,

Benny
Feb 22 '07 #1
1 1117
you just need to figure out what a cartesian is.. get a simple
cartesian of 'every possible theater and every possible time for every
possible day'

a cartesian would allow you to see a schedule of 'what moves are
showing this week'
push it into a table and then use action queries (insert, update) in
order to push the calculated values into a table

you might be able to just use the PIVOT key word in order to do
something a whole ton simpler; it just depends on whether you're
looking for a one-time report or seomthing that will get displayed on
your website by 10 million visitors

On Feb 22, 7:08 am, "BenCoo" <teddy...@hotma il.comwrote:
Hello,

I have a ProgramItem-class as follow:

mItemID as Integer

mDtg as shortDateTime

mMovieID as Integer (linked to a ICollection of Movies from a table Movies)

mTheaterID as Integer (linked to a ICollection Theaters from a table
Theaters)

And a Server 2005 TSQL-tabel MovieProgram:

ID (int)
DTG (shortDateTime)
MovieID (int)
TheaterID (int)

1
22-03-2007 13:00
24
6

2
22-03-2007 14:30
13 (playtime = 02:00 hrs)
4

3
22-03-2007 15:25
68
3

4
22-03-2007 17:00
19
4

5
22-03-2007 20:00
84
3

I wish to schedule a ProgramItem (retrieved movie playtime = 01:30) on
22-03-2007 15:00 in theater 4

How can I find out that:

1: theater 4 is available at that time (in this example it is not)

2: and there is enough time to project the movie before the next planned
movie in the same theater starts (see ID 2 & 4)

I have al ready figure this out:

Dim intTimeslot As integer

Dim prgItem As ProgramItem

With prgItem

.Dtg = "22-03-2007 15:00"

.MovieId = 54

.TheaterID = 4

End With

'Here comes the code for testing if there is enough time to project the
movie, some help 'will be appreciated!

If intTimeslot = 1 then

'Movie can be planned as suggested

ScheduleMovie(p rgItem) ' save object prgItem in table MovieProgram

ElseIf intTimeslot = 2 then

'Movie can be planned but with modified Starttime (DTG)

prgItem.Dtg = '22-03-2007 hh:mm'

scheduleMovie(p rgItem)

Else

MsgBox("Show Error: theater is occupied")

End If

Thanks in advance,

Benny

Feb 22 '07 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
2328
by: Tony Proctor | last post by:
Hi everyone We're experiencing some serious anomalies with the scheduling of ASP threads. I'd be interested to hear if anyone knows what algorithm is used (e.g. simple round-robin, or something more sophisticated), and what situations might perturb it. Even a hint as to what would be considered normal scheduling might help. The root of our problem is that we observed a normally well-behaved web application suddenly limit itself to a...
2
619
by: Trevor.D.Matthews | last post by:
I need to develop a scheduling app and am having trouble with the database design. I can easily design a table hold appointments with start and finish times, but I always have an issue when it comes time to searching for free time. The search examples: Find the first available appointment in September
7
3651
by: Neil Greenough | last post by:
I am looking for a scheduling template or will maybe have a go at creating the database myself. Basically, the database will include a table listing certain volunteers, their volunteer number (employee number) and the group they are attached to (department.) All volunteers are split up into 8 groups and each group is led by a supervisor. Now what I would like is for each volunteer to be able to access the database on the Thursday of...
3
2892
by: Muscha | last post by:
Hi, In our application we need to have a high performance scheduling framework. We want to be able to say for item 21 do an update on such and such time. We will have around 1 million items of this kind with different scheduling time, so not all will be updated per hour. Some will be per hour some will be once every 2 weeks. Does anyone has any suggestion how to tackle this problem? Oh and one of the requirement is that we are not...
3
578
by: Alphonse Giambrone | last post by:
Can anyone point me toward a good example of an asp.net scheduling app? Preferrably in vb.net. TIA -- Alphonse Giambrone Email: a-giam at customdatasolutions dot us
1
1807
by: Majed | last post by:
hi I'm planing to make scheduling app and need your advice on the best way to do that,and how to save the tasks to be executed and retrive their data at the right time. your input will be highly appreciated Majed
0
1324
by: Lemune | last post by:
Hello. I need some help on building my sms services application (using modem). My application is to do some scheduling task based on daily, weekly and monthly. On the daily the choice are everyday, weekdays, or every what ever value of the days. On the daily the choice are every what ever value of the week on the selected days. On the monthly the choice are on what date, on what day of what week, and on selected month. My scheduling task...
4
2848
by: Dinsdale | last post by:
I'm looking at adding scheduling features to an application and I wanted to ask the community about any experience with scheduling components, either open source like from code project or from a vendor. I'd like to be able to create schedules and lock resources for things like collision detection (two events trying to use the same resource). I've seen some GANTT charting components but I don't think that's what I'm looking for. I'd...
2
26818
Ritchie
by: Ritchie | last post by:
Please can anyone help me with d programs in C for CPU scheduling: WAP to show FCFS scheduling algorithm. WAP to show SJF scheduling algorithm. WAP to show Priority scheduling algorithm. WAP to show Round-Robin scheduling algorithm. disk scheduling:
0
9647
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9491
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9959
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8988
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7510
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6744
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5532
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3668
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2894
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.