Exemple #1
0
        public ActivityReminderDataModel GetActivityReminderDataModel(IIntranetActivity activity, Enum activityType)
        {
            var model = new ActivityReminderDataModel
            {
                Url              = _linkService.GetLinks(activity.Id).Details,
                Title            = activity.Title,
                NotificationType = activityType,
                ActivityType     = activity.Type,
                IsPinned         = activity.IsPinned,
                IsPinActual      = activity.IsPinActual
            };

            if (activity.Type is IntranetActivityTypeEnum.Events)
            {
                var @event = (Event)activity;
                model.StartDate = @event.StartDate;
            }

            return(model);
        }
        public async Task <ActivityReminderDataModel> GetActivityReminderDataModelAsync(IIntranetActivity activity, Enum notificationType)
        {
            var model = new ActivityReminderDataModel
            {
                Url              = (await _linkService.GetLinksAsync(activity.Id))?.Details,
                Title            = activity.Title,
                NotificationType = notificationType,
                ActivityType     = activity.Type,
                IsPinned         = activity.IsPinned,
                IsPinActual      = activity.IsPinActual
            };

            if (activity.Type is IntranetActivityTypeEnum.Events)
            {
                var @event = (Event)activity;
                model.StartDate = @event.StartDate;
            }

            return(model);
        }