예제 #1
0
        public static IList <Event> CreateRange(Dumpstore dumpstore, DateTime startDate, DateTime endDate, Interval interval, int maxPersons, DateTime publishUp, Theme theme = null)
        {
            var duration = (endDate - startDate).Duration();

            var numberOfEvents = Convert.ToInt32(Math.Floor(duration.TotalMinutes / interval.Minutes));

            var events = new List <Event>();

            for (int i = 0; i < numberOfEvents; i++)
            {
                events.Add(Event.Create(dumpstore, startDate.AddMinutes(i * interval.Minutes), startDate.AddMinutes((i + 1) * interval.Minutes), maxPersons, publishUp, theme));
            }

            return(events);
        }
예제 #2
0
        public static Event Create(Dumpstore dumpstore,
                                   DateTime startTime,
                                   DateTime endTime,
                                   int maximumNumberOfVisitors,
                                   DateTime publishUp,
                                   Theme theme = null
                                   )
        {
            var newEvent = new Event(Guid.NewGuid());

            newEvent.TimeRange = new DateTimeRange(startTime, endTime);
            newEvent.MaximumNumberOfVisitors = maximumNumberOfVisitors;
            newEvent.Dumpstore = dumpstore;
            newEvent.Theme     = theme;
            newEvent.PublishUp = publishUp;

            return(newEvent);
        }
예제 #3
0
        public static Dumpstore Create(string address,
                                       string postcode,
                                       string city,
                                       string geolocation)
        {
            Guard.ForNullOrEmpty(address, "address");
            Guard.ForNullOrEmpty(postcode, "postcode");
            Guard.ForNullOrEmpty(city, "city");

            var dumpstore = new Dumpstore(Guid.NewGuid());

            dumpstore.Address     = address;
            dumpstore.Postcode    = postcode;
            dumpstore.City        = city;
            dumpstore.Geolocation = geolocation;

            return(dumpstore);
        }