public int TimeToNextCareDay() { var diff = Int32.MaxValue; foreach (var d in MainSession.WashingDays) { var c = new ScheduleController(d.Scheduled); var t = c.Time2NextCareDay(DateTime.Now); if (t < diff) { diff = t; } } return(diff); }
public CommingDays NextDay() { var diff = new CommingDays(); foreach (var d in MainSession.WashingDays) { var c = new ScheduleController(d.Scheduled); var t = c.Time2NextCareDay(ScheduleController.GetToday()); if (t <= diff.Time2Wait) { diff.Time2Wait = t; diff.Days = new List <WashingDayDefinition> { d }; } else if (t == diff.Time2Wait) { diff.Time2Wait = t; diff.Days.Add(d); } } return(diff); }