.net - Efficiently persisting calendar data with Entity Framework? -


i working on school project involves managing driving instructor calendars.

the application stores time periods on instructor available.

public partial class availabilityperiod // kind of pseudo code {   instructor instructor;   datetime start;   datetime end; } 

it stores individual appointments instructor, in similar fashion.

when customer says, example, "i want 2-hour lesson", have fetch availability periods , appointements of instructors in order compute "actual availability" , find having more 2 hours free in his/her schedule.

is there better way ?

my question exact duplicate of time calendar data structure , know it. but, well... we're in 2011 , i'm interested in entity framework-specific info, or @ least doing whith object relational mapping :-)

i wrote similar scheduling application, , ended taking little different approach (though approach work).

in system, schedule broken down 15 minute increments, called blocks, , stored in table. available unless requested time off. these time off requests stored in separate table, again in 15 minute increments.

we had scheduleblock table stored of potential blocks populated based off of business rules, , scheduleexception table stored blocks users not work.

with table structure, easy create ui showed scheduleblock entities (this of potential available time, i.e. business hours), , additionally bind of scheduleexception entities (appointments, pto, sick days, etc) show time users not work (color coded per user). there, user of system select blocks of time wanted schedule particular event, similar way ms outlook works.

when did automatic scheduling, in case, queried users having x number of block available specified date range, sorted number of appointments had, , looped through them looking match. sorted number of appointments person open schedule scheduled first.

hope helps!


Comments

Popular posts from this blog

php - What is the difference between $_SERVER['PATH_INFO'] and $_SERVER['ORIG_PATH_INFO']? -

fortran - Function return type mismatch -

queue - mq_receive: message too long -