private List <RemindSystemModel> OnceRemind(RemindBackupModel remind) { DateTime oneWeekTime = WeekNumClass.OneWeek(); List <RemindSystemModel> remindList = new List <RemindSystemModel>(); foreach (var item in remind.DateItems) { string[] weekNum = item.Week.Split(','); for (int i = 0; i < weekNum.Length; i++) { int num = int.Parse(weekNum[i]); SelCourseModel selCourse = new SelCourseModel(int.Parse(item.Day), int.Parse(item.Class)); DateTime remindTime = oneWeekTime.AddDays((num - 1) * 7).Add(selCourse.NowTime()); if (remindTime < DateTime.Now) { continue; } else { RemindSystemModel remindSystem = new RemindSystemModel() { Content = remind.Content, Title = remind.Title, RemindTime = remindTime }; remindList.Add(remindSystem); } } } return(remindList); }
private static void GetSelClassTime(string content, string title, List <RemindSystemModel> remindSystemList, int week) { DateTime oneWeekTime = WeekNumClass.OneWeek(); foreach (var item in App.SelCoursList) { DateTime remindTime = oneWeekTime.Add(item.NowTime()).AddDays(week * 7); if (remindTime < DateTime.Now) { continue; } else { RemindSystemModel remindSystem = new RemindSystemModel() { Content = content, Title = title, RemindTime = remindTime }; remindSystemList.Add(remindSystem); } } }