コード例 #1
0
        public IList <EditionEntity> GetEditionsToNotify(NotificationType notificationType)
        {
            IList <EditionEntity> editions;

            if (WebConfigHelper.IsLocal || WebConfigHelper.IsTest)
            {
                editions = EditionServices.GetEditionsByEvent(248);
            }
            else
            {
                var deviationInDays = WebConfigHelper.EditionNotificationDeviationInDays;
                if (notificationType.GetAttribute <NotificationAttribute>().CheckDaysType == NotificationAttribute.CheckDaysTypes.Passed)
                {
                    deviationInDays *= -1;
                }
                var checkDays = _emailNotificationHelper.GetCheckDays(notificationType).Select(x => x - deviationInDays).ToList();

                var minFinancialYear = WebConfigHelper.MinFinancialYear;
                var statuses         = Utility.Constants.DefaultValidEditionStatusesForCed;
                var eventTypes       = notificationType.GetAttribute <NotificationAttribute>().EventTypes.Select(x => x.GetDescription()).ToArray();
                var eventActivities  = Utility.Constants.ValidEventActivitiesToNotify;

                editions = EditionServices.GetEditionsByNotificationType(checkDays, null, notificationType, minFinancialYear, statuses, eventTypes, eventActivities);
            }

            return(editions);
        }
コード例 #2
0
        private IList <EditionEntity> GetSiblingEditionsByApprovedEdition(EditionEntity approvedEdition)
        {
            var editions = EditionServices.GetEditionsByEvent(approvedEdition.EventId);

            return(editions);
        }