public static void AddNotificationsGroup(List <MyZoneNotification> notifications, IEnumerable <Group> groups, string content) { foreach (var group in groups) { var notification = new MyZoneNotification() { Type = MyZoneNotificationType.Group, Content = string.Format(content, group.Name, group.StartDate.Day, group.StartDate.Month) }; notifications.Add(notification); } }
public static void AddNotificationsBirthday(List <MyZoneNotification> notifications, IEnumerable <Student> students, string content) { foreach (var student in students) { var newAge = DateTime.Now.Year - student.BirthDate.Year; var notification = new MyZoneNotification() { Type = MyZoneNotificationType.Birthday, Content = string.Format(content, student.FullName, student.Group.Name, newAge, student.BirthDate.Day, student.BirthDate.Month) }; notifications.Add(notification); } }