Example #1
0
        public virtual INotificationInfo GetNotificationInfo()
        {
            var    notificationTypeName = TryGeNotificationTypeName();
            string loaderName           = GetSchemaName(UserConnection.ClientUnitSchemaManager, Entity.LoaderId);
            string schemaName           = GetSchemaName(UserConnection.EntitySchemaManager, Entity.SysEntitySchemaId);
            INotificationSettingsRepository notificationSettingsRepository = ClassFactory.Get <NotificationSettingsRepository>(
                new ConstructorArgument("userConnection", UserConnection));
            Guid notificationTypeId = Entity.NotificationTypeId;
            Guid imageId            = notificationSettingsRepository.GetNotificationImage(Entity.SysEntitySchemaId, notificationTypeId);
            Guid sysAdminUnitId     = NotificationUtilities.GetSysAdminUnitId(UserConnection, Entity.ContactId);
            var  title = Entity.PopupTitle.IsNullOrWhiteSpace() ? Entity.Description : Entity.PopupTitle;

            return(new NotificationInfo {
                Title = title,
                Body = Entity.SubjectCaption,
                ImageId = imageId,
                EntityId = Entity.SubjectId,
                EntitySchemaName = schemaName,
                MessageId = Entity.Id,
                LoaderName = loaderName,
                SysAdminUnit = sysAdminUnitId,
                GroupName = notificationTypeName,
                RemindTime = Entity.RemindTime
            });
        }
Example #2
0
        public virtual INotificationInfo GetNotificationInfo()
        {
            INotificationSettingsRepository notificationSettingsRepository = ClassFactory.Get <NotificationSettingsRepository>(
                new ConstructorArgument("userConnection", UserConnection));
            Guid   imageId           = notificationSettingsRepository.GetNotificationImage(Entity.Schema.UId, null);
            var    referenceEntity   = GetFetchedReferenceEntity();
            var    body              = string.Empty;
            var    referenceEntityId = Guid.Empty;
            string schemaName;

            if (referenceEntity != null)
            {
                body = GetPopupBody(referenceEntity);
                referenceEntityId = referenceEntity.PrimaryColumnValue;
                schemaName        = referenceEntity.SchemaName;
            }
            else
            {
                schemaName = Entity.SchemaName;
            }
            return(new NotificationInfo {
                Body = body,
                MessageId = Entity.Id,
                EntityId = referenceEntityId,
                Title = PopupTitleTemplate,
                ImageId = imageId,
                EntitySchemaName = schemaName,
                SysAdminUnit = Entity.VisaOwnerId,
                RemindTime = DateTime.UtcNow,
                GroupName = "Visa"
            });
        }
Example #3
0
 protected virtual Guid GetSysImage(Guid entitySchemaUId)
 {
     return(_notificationSettingsRepository.GetNotificationImage(entitySchemaUId,
                                                                 RemindingConsts.NotificationTypeRemindingId));
 }