Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Phase 1: Initial modeling

  • Loading branch information...
commit 93ec65bbb3ec81811ca97cb9865d908551feb434 1 parent c3f1e73
Itamar Syn-Hershko authored November 28, 2011
5  EventsZilla/EventsZilla.csproj
@@ -99,6 +99,11 @@
99 99
       <DependentUpon>Global.asax</DependentUpon>
100 100
     </Compile>
101 101
     <Compile Include="Models\ContentPage.cs" />
  102
+    <Compile Include="Models\Event.cs">
  103
+      <SubType>Code</SubType>
  104
+    </Compile>
  105
+    <Compile Include="Models\Presenter.cs" />
  106
+    <Compile Include="Models\Venue.cs" />
102 107
     <Compile Include="Properties\AssemblyInfo.cs" />
103 108
   </ItemGroup>
104 109
   <ItemGroup>
56  EventsZilla/Models/Event.cs
... ...
@@ -0,0 +1,56 @@
  1
+using System;
  2
+using System.Collections.Generic;
  3
+using System.Linq;
  4
+
  5
+namespace EventsZilla.Models
  6
+{
  7
+	public class Event
  8
+	{
  9
+		public Event()
  10
+		{
  11
+			Schedule = new List<ScheduleSlot>();
  12
+		}
  13
+
  14
+		public int Id { get; set; }
  15
+		public string Title { get; set; }
  16
+		public string Slug { get; set; }
  17
+		public string Description { get; set; } // markdown content
  18
+
  19
+		public string VenueId { get; set; }
  20
+
  21
+		public DateTimeOffset CreatedAt { get; set; }
  22
+
  23
+		public DateTimeOffset RegistrationOpens { get; set; }
  24
+		public DateTimeOffset RegistrationCloses { get; set; }
  25
+		public int AvailableSeats { get; set; }
  26
+
  27
+		public class ScheduleSlot
  28
+		{
  29
+			public List<string> PresenterIds { get; set; } // list of person IDs
  30
+			public string Title { get; set; }
  31
+			public string Brief { get; set; } // markdown
  32
+			public DateTimeOffset StartingAt { get; set; }
  33
+			public DateTimeOffset EndingAt { get; set; }
  34
+			
  35
+		}
  36
+		public List<ScheduleSlot> Schedule { get; set; }
  37
+
  38
+		public DateTimeOffset StartsAt
  39
+		{
  40
+			get
  41
+			{
  42
+				var firstSession = Schedule.OrderBy(x => x.StartingAt).FirstOrDefault();
  43
+				return firstSession == null ? DateTimeOffset.MinValue : firstSession.StartingAt;
  44
+			}
  45
+		}
  46
+
  47
+		public DateTimeOffset EndsAt
  48
+		{
  49
+			get
  50
+			{
  51
+				var lastSession = Schedule.OrderByDescending(x => x.EndingAt).FirstOrDefault();
  52
+				return lastSession == null ? DateTimeOffset.MaxValue : lastSession.EndingAt;
  53
+			}
  54
+		}
  55
+	}
  56
+}
9  EventsZilla/Models/Presenter.cs
... ...
@@ -0,0 +1,9 @@
  1
+namespace EventsZilla.Models
  2
+{
  3
+	public class Presenter
  4
+	{
  5
+		public string Name { get; set; }
  6
+		public string Bio { get; set; }
  7
+		public string ImageUrl { get; set; }
  8
+	}
  9
+}
11  EventsZilla/Models/Venue.cs
... ...
@@ -0,0 +1,11 @@
  1
+namespace EventsZilla.Models
  2
+{
  3
+	public class Venue
  4
+	{
  5
+		public string Name { get; set; }
  6
+		public string Location { get; set; }
  7
+
  8
+		public decimal Longitude { get; set; }
  9
+		public decimal Latitude { get; set; }
  10
+	}
  11
+}

0 notes on commit 93ec65b

Please sign in to comment.
Something went wrong with that request. Please try again.