Example #1
0
                public override bool Equals(object obj)
                {
                    StudyEventAggregateDatesHelperKey o = obj as StudyEventAggregateDatesHelperKey;

                    if (o == null)
                    {
                        return(false);
                    }
                    IEnumerable <Location> tloc = this.EventLocations.Select(el => el.Location);
                    IEnumerable <Location> oloc = o.EventLocations.Select(el => el.Location);

                    return(this.StudyEventsTimeTableKindCode == o.StudyEventsTimeTableKindCode &&
                           TimeSpan.Equals(this.Start, o.Start) &&
                           TimeSpan.Equals(this.End, o.End) &&
                           string.Equals(this.Subject, o.Subject) &&
                           string.Equals(this.Cohort, o.Cohort) &&
                           bool.Equals(this.ShowCohort, o.ShowCohort) &&
                           tloc.Count() == oloc.Count() && !tloc.Except(oloc).Any() &&
                           this.ContingentUnits.Count() == o.ContingentUnits.Count() && !this.ContingentUnits.Except(o.ContingentUnits).Any());
                }
Example #2
0
        public static StudyEventAggregatedItemViewModel Build(
            StudyEventAggregateDatesHelperKey aggregateKey,
            IEnumerable <DateTime> dates,
            EducatorMasterPerson forEducator)
        {
            LanguageCode language = CultureHelper.CurrentLanguage;

            return(new StudyEventAggregatedItemViewModel
            {
                ContingentUnits = aggregateKey
                                  .ContingentUnits
                                  .Select(cu => ContingentUnitItemViewModel.Build(cu)),
                ForEducator = (forEducator != null),
                EducatorId = forEducator?.Id,
                Start = aggregateKey.Start,
                End = aggregateKey.End,
                Subject = aggregateKey.Subject,
                Cohort = aggregateKey.Cohort,
                ShowCohort = aggregateKey.ShowCohort,
                EventLocations = aggregateKey.EventLocations.Select(el => new StudyEventLocationItemViewModel(el)),
                DateTime = DateTimeAggregatedViewModel.Build(dates, aggregateKey.Start, aggregateKey.End),
                EducatorsDisplayText = aggregateKey.EducatorsDisplayText
            });
        }
Example #3
0
 public StudyEventAggregateDatesHelper(StudyEventAggregateContingentsHelper g)
 {
     Key  = new StudyEventAggregateDatesHelperKey(g);
     Date = g.Key.Start.Date;
 }