public void SetBirthdays(Events birthdayEvents) { foreach (var birthdayEvent in birthdayEvents.Items) { var googleEvent = new GoogleEventWrapper(birthdayEvent); foreach (var mcgillDay in _days) { if (mcgillDay.Date.Date >= googleEvent.Start && mcgillDay.Date.Date < googleEvent.End) { mcgillDay.Birthdays.Add(new Birthday(birthdayEvent.Summary)); } } } }
public void SetBinDays(Events binEvents) { foreach (var binEvent in binEvents.Items) { var googleEvent = new GoogleEventWrapper(binEvent); foreach (var mcgillDay in _days) { if (mcgillDay.Date.Date >= googleEvent.Start && mcgillDay.Date.Date < googleEvent.End && binEvent.Summary.ToLower().Contains("green")) { mcgillDay.IsGreenBinWeek = true; } } } }
public void SetHockeyDays(Events hockeyEvents) { foreach (var hockeyEvent in hockeyEvents.Items) { var googleEvent = new GoogleEventWrapper(hockeyEvent); var day = _days.First(x => x.Date.Date >= googleEvent.Start.Date && x.Date.Date <= googleEvent.End.Date); if (hockeyEvent.Summary.ToLower().Contains("oliver")) { day.OliverHockey.Add(new HockeyEvent(googleEvent.Start, googleEvent.End, hockeyEvent.Summary)); } else if (hockeyEvent.Summary.ToLower().Contains("bradley")) { day.BradleyHockey.Add(new HockeyEvent(googleEvent.Start, googleEvent.End, hockeyEvent.Summary)); } else { day.OliverHockey.Add(new HockeyEvent(googleEvent.Start, googleEvent.End, hockeyEvent.Summary)); day.BradleyHockey.Add(new HockeyEvent(googleEvent.Start, googleEvent.End, hockeyEvent.Summary)); } } }