Ejemplo n.º 1
0
        //static string reminderInfoFormat = @"<Reminders><Reminder AlertTime=""{0}"" TimeBeforeStart=""00:00:00"" /></Reminders>";
        static SportEvent GetRandomRecurrenceSportEvent(int id, DateTime startDate, SportChannel channel, int dayCount)
        {
            SportEvent pattern = new SportEvent();

            pattern.Id = id;
            TimeSpanRange newsTimeRange = channel.NewsTimeRange;

            pattern.StartTime = startDate + newsTimeRange.Start;
            pattern.EndTime   = startDate + newsTimeRange.End;
            pattern.SportId   = 0;
            pattern.ChannelId = channel.Id;
            pattern.Caption   = "Sport News";
            pattern.Location  = "New York City, USA";
            pattern.Type      = (int)AppointmentType.Pattern;
            RecurrenceInfo recInfo = new RecurrenceInfo();

            recInfo.Id             = id;
            recInfo.Start          = pattern.StartTime;
            recInfo.End            = pattern.EndTime.AddDays(dayCount);
            recInfo.WeekDays       = WeekDays.WorkDays;
            recInfo.Range          = RecurrenceRange.EndByDate;
            recInfo.Type           = RecurrenceType.Daily;
            pattern.RecurrenceInfo = String.Format(CultureInfo.InvariantCulture, recurrenceInfoFormat,
                                                   recInfo.Start, recInfo.End, (int)recInfo.WeekDays, recInfo.OccurrenceCount, (int)recInfo.Range, (int)recInfo.Type, recInfo.Id.ToString());
            //pattern.ReminderInfo = String.Format(CultureInfo.InvariantCulture, reminderInfoFormat, pattern.StartTime);
            return(pattern);
        }
Ejemplo n.º 2
0
        static SportEvent GetRandomSportEvent(int id, DateTime start, DateTime end, int channelId)
        {
            var res = new SportEvent();

            res.Id          = id;
            res.StartTime   = start;
            res.EndTime     = end;
            res.SportId     = rnd.Next(1, 10);
            res.ChannelId   = channelId;
            res.Caption     = GetRandomString(GetEvents(res.SportId));
            res.Location    = GetRandomString(GetLocations(res.SportId));
            res.Description = GetRandomString(GetDescriptions(res.SportId));
            res.Type        = 0;
            return(res);
        }