Event/Class Calendar

Last post 09-06-2006 5:45 PM by Caddre. 3 replies.

Sort Posts:

  • Event/Class Calendar

    09-04-2006, 11:11 PM
    • Member
      517 point Member
    • mickyjtwin
    • Member since 12-29-2005, 9:37 PM
    • Geelong VIC
    • Posts 178

    I am trying to design a database for a event/class calendar. I'm just trying to get my head around my requirements and the tables necessary.

    Basically, I want a calendar of events, which is fine, however an event can be of a specific type, e.g. a Class, or just a simple "Labor Day" event.

    My class table so far is as follows:
    classID (PK)
    title
    description
    cost
    classSize
    teacher
    statusID

    Should I keep a separate events and classes, whereby the class is the above table but adds the following fields...
    startDate
    endDate
    startTime
    endTime

    My event table would be...
    eventID
    title
    isAllDay
    startDate
    endDate
    startTime
    endTime

    I thought that because the class table and event table both have dates and times, I could normalize, but seems to not work.

    Would I then create a SP then executes both SP's to get Classes and Events? (Minimalize calls to DB?)
    Then, in page I would do the following...
    Dim ds As DataSet = Nothing
    Sub LoadData()
       ds = _Events.GetAllEventsClasses()
    End Sub

    Protected Sub Calendar1_DayRender(ByVal sender.........)
       Dim dr As DataRow
       Dim i As Integer = 0
       Do While i < ds.Tables(0).Rows.Count
         dr = ds.Tables(0).Rows(i)
         If e.Day.Date = dr("startDate") Then
           Dim temp As StringBuilder = New StringBuilder()
           temp.Append(dr("title")
         End If
         i += 1
       Loop
       dr = Nothing
       i = 0
       Do While i < ds.Tables(1).Rows.Count
         dr = ds.Tables(1).Rows(i)
         If e.Day.Date = dr("startDate") Then
           temp.Append("<br>")
           temp.Append(dr("classtitle"))
           temp.Append(dr("startTime"))
           temp.Append(dr("endTime"))
           e.Cell.Control.Add(New LiteralControl(temp.ToString())
         End If
         i += 1
       Loop
    End Sub

    Am I on the right track with this?
     

  • Re: Event/Class Calendar

    09-05-2006, 10:34 AM
    • All-Star
      26,551 point All-Star
    • Caddre
    • Member since 06-23-2003, 9:53 AM
    • Indy
    • Posts 5,308

    The three links below covers all you need to complete the application, events are at the low end of Time Interval it can get complicated getting your database right is the most important that is covered by the SQL Server link and Microsoft in Time Tracker.  And try to keep the scheduling in .NET you have more classes to work with in the Calendar class and TimeSpan.  Post again if you still have questions.  Hope this helps.

     http://www.codeproject.com/aspnet/MellDataCalendar.asp

    http://www.asp.net/downloads/starterkits/default.aspx?tabid=62#timetracker

    http://www.karaszi.com/SQLServer/info_datetime.asp

    Kind regards,
    Gift Peddie
  • Re: Event/Class Calendar

    09-06-2006, 5:08 PM
    • Member
      517 point Member
    • mickyjtwin
    • Member since 12-29-2005, 9:37 PM
    • Geelong VIC
    • Posts 178

    While the links proved very helpful,k I am trying to get my head around the design of my database to begin with...

    This application will somewhat revolve around people attending classes. A class will have a title, description, number of spots available, a cost, teacher, start and finish time. This class can also occur on different days, so today the class with be "Making an Event Calendar - 9:00am - 12:00pm" and 3 days from today, that class will operate again. THen, there will also be general events, that would be similar to say "Labor Day", which don't have any classes, and might just have a title and description, with the option of having a start finish time, or an all day event.

    So, this is my current thinking...

    Table - MYClassEvent
    classEventID(PK)
    classID
    startDate
    endDate
    startTime
    endTime
    cost
    classSize
    teacher
    statusID

    Table - MYClass
    classID(PK, Relationship to classID in MYClassEvent)
    classTitle
    classDescription

    Then, I would have a completely separate table for general events...
    Table - Events
    eventID
    title
    description
    isAllDay
    startTime
    endTime
    startDate
    endDate

    As in my first post, I would then have to query both tables, and run then against the current day iterating through each day on the calendar, and each table in the database.

    Thanks for any help
    Mick

  • Re: Event/Class Calendar

    09-06-2006, 5:45 PM
    • All-Star
      26,551 point All-Star
    • Caddre
    • Member since 06-23-2003, 9:53 AM
    • Indy
    • Posts 5,308

    Sorry I thought I gave you that try the link below and check under letter S for some schools and student related DDL(data definition langauge), you need to click on the physical design for details.  That takes me to the reason I told you to use .NET classes because time interval can get complicated but .NET covers all in the Calendar class and System.TimeSpan the later is the 24hour clock.  And I am sorry I don't do money you although you should look into the Visual Basic Financial class that deals with money.  So go to the link below clone some tables design them in Management Studio and look up time interval in the TimeTracker 1.1 white paper at the top of this site and you are almost there, Microsoft covered it with long case statement, just as ANSI SQL covers it albeit mile long.  If you need relationship there is a many to many for courses and student through enroll and teacher and courses through teach.

    As in my first post, I would then have to query both tables, and run then against the current day iterating through each day on the calendar, and each table in the database.

    If you put all that in the database it will affect your application performance.  Hope this helps.

    http://www.databaseanswers.org/data_models/

    Kind regards,
    Gift Peddie
Page 1 of 1 (4 items)