Esempio n. 1
0
        private IEnumerable <EventMilestoneInfo> GetOrderedEventMilestones(IEnumerable <EventMilestoneInfo> eventMilestones, ListInputInfo listInputInfo)
        {
            if (listInputInfo.OrderBy != null && listInputInfo.OrderDirection != null)
            {
                switch (listInputInfo.OrderBy)
                {
                case OrderBy.ParentEventDescription:
                    return(GetOrderedEventMilestonesByDirection((OrderDirection)listInputInfo.OrderDirection, eventMilestones, e => e.ParentEventDescription));

                case OrderBy.EventMilestoneDescription:
                    return(GetOrderedEventMilestonesByDirection((OrderDirection)listInputInfo.OrderDirection, eventMilestones, e => e.EventMilestoneDescription));

                case OrderBy.IsMandatory:
                    return(GetOrderedEventMilestonesByDirection((OrderDirection)listInputInfo.OrderDirection, eventMilestones, e => e.IsMandatory));

                case OrderBy.EventForDateReferenceForTarget:
                    return(GetOrderedEventMilestonesByDirection((OrderDirection)listInputInfo.OrderDirection, eventMilestones, e => e.EventForDateReferenceForTarget != null ? e.EventForDateReferenceForTarget.ToString(CultureInfo.InvariantCulture) : string.Empty));

                case OrderBy.TargetNumberOfDays:
                    return(GetOrderedEventMilestonesByDirection((OrderDirection)listInputInfo.OrderDirection, eventMilestones, e => e.TargetNumberOfDays));
                }
            }

            return(eventMilestones);
        }