Exemplo n.º 1
0
 /// <summary>
 /// Allow 3 months to show up as "Quarterly", otherwise return the base implementation of a month description.
 /// </summary>
 public override string Format(MonthlySchedule s)
 {
     if (s.Frequency == 3)
         return String.Format(String.Concat("Quarterly", (Start.HasValue ? " on day {0}" : "")), Start.Value.Day);
     return base.Format(s);
 }
Exemplo n.º 2
0
        private ISchedule Generate(SqlDataReader reader)
        {
            ISchedule result;

            if (!IsDBNull(reader, "sd.Id"))
                result = new DailySchedule();
            else if (!IsDBNull(reader, "sw.Id"))
            {
                var week = new WeeklySchedule();
                week.Monday = GetBoolean(reader, "Monday");
                week.Tuesday = GetBoolean(reader, "Tuesday");
                week.Wednesday = GetBoolean(reader, "Wednesday");
                week.Thursday = GetBoolean(reader, "Thursday");
                week.Friday = GetBoolean(reader, "Friday");
                week.Saturday = GetBoolean(reader, "Saturday");
                week.Sunday = GetBoolean(reader, "Sunday");
                result = week;
            }
            else if (!IsDBNull(reader, "sm.Id"))
                result = new MonthlySchedule();
            else if (!IsDBNull(reader, "smd.Id"))
                result = new MonthlyDaySchedule();
            else if (!IsDBNull(reader, "sy.Id"))
                result = new YearlySchedule();
            else
                return null;

            result.Frequency = GetInt32(reader, "Frequency");
            return result;
        }