コード例 #1
0
 public QueueWorkerReassign(IHttpContextAccessor httpContextAccessor,
                            MessageService messageService,
                            StudioNotifyService studioNotifyService,
                            QueueWorkerRemove queueWorkerRemove) : base(httpContextAccessor, messageService, studioNotifyService)
 {
     QueueWorkerRemove = queueWorkerRemove;
 }
コード例 #2
0
        public ReassignProgressItem(
            IServiceProvider serviceProvider,
            HttpContext context,
            QueueWorkerReassign queueWorkerReassign,
            QueueWorkerRemove queueWorkerRemove,
            int tenantId, Guid fromUserId, Guid toUserId, Guid currentUserId, bool deleteProfile)
        {
            ServiceProvider   = serviceProvider;
            QueueWorkerRemove = queueWorkerRemove;
            _httpHeaders      = QueueWorker.GetHttpHeaders(context.Request);

            _tenantId      = tenantId;
            FromUser       = fromUserId;
            ToUser         = toUserId;
            _currentUserId = currentUserId;
            _deleteProfile = deleteProfile;

            //_docService = Web.Files.Classes.Global.FileStorageService;
            //_projectsReassign = new ProjectsReassign();

            Id          = queueWorkerReassign.GetProgressItemId(tenantId, fromUserId);
            Status      = ProgressStatus.Queued;
            Error       = null;
            Percentage  = 0;
            IsCompleted = false;
        }
コード例 #3
0
ファイル: QueueWorker.cs プロジェクト: ztcyun/AppServer
 public QueueWorkerReassign(
     IHttpContextAccessor httpContextAccessor,
     IServiceProvider serviceProvider,
     QueueWorkerRemove queueWorkerRemove,
     ProgressQueueOptionsManager <ReassignProgressItem> optionsQueue) :
     base(httpContextAccessor, serviceProvider, optionsQueue)
 {
     QueueWorkerRemove = queueWorkerRemove;
 }
コード例 #4
0
        public ReassignProgressItem(
            IServiceProvider serviceProvider,
            IHttpContextAccessor httpContextAccessor,
            QueueWorkerRemove queueWorkerRemove)
        {
            ServiceProvider   = serviceProvider;
            QueueWorkerRemove = queueWorkerRemove;
            _httpHeaders      = QueueWorker.GetHttpHeaders(httpContextAccessor.HttpContext.Request);

            //_docService = Web.Files.Classes.Global.FileStorageService;
            //_projectsReassign = new ProjectsReassign();
        }
コード例 #5
0
        public void Init(int tenantId, UserInfo user, Guid currentUserId, bool notify)
        {
            _tenantId      = tenantId;
            User           = user;
            FromUser       = user.ID;
            _currentUserId = currentUserId;
            _notify        = notify;

            Id          = QueueWorkerRemove.GetProgressItemId(tenantId, FromUser);
            Status      = DistributedTaskStatus.Created;
            Exception   = null;
            Percentage  = 0;
            IsCompleted = false;
        }
コード例 #6
0
        private void DeleteUserProfile(Tenant tenant)
        {
            var user     = CoreContext.UserManager.GetUsers(_tenantId, FromUser);
            var userName = user.DisplayUserName(false);

            UserPhotoManager.RemovePhoto(tenant, user.ID);
            CoreContext.UserManager.DeleteUser(tenant, user.ID);
            QueueWorkerRemove.Start(_tenantId, user, _currentUserId, false);

            if (_httpHeaders != null)
            {
                MessageService.Send(_httpHeaders, MessageAction.UserDeleted, MessageTarget.Create(FromUser), new[] { userName });
            }
            else
            {
                MessageService.Send(MessageAction.UserDeleted, MessageTarget.Create(FromUser), userName);
            }
        }
コード例 #7
0
        public RemoveProgressItem(
            IServiceProvider serviceProvider,
            HttpContext context,
            QueueWorkerRemove queueWorkerRemove,
            int tenantId, UserInfo user, Guid currentUserId, bool notify)
        {
            _httpHeaders    = QueueWorker.GetHttpHeaders(context.Request);
            ServiceProvider = serviceProvider;
            _tenantId       = tenantId;
            User            = user;
            FromUser        = user.ID;
            _currentUserId  = currentUserId;
            _notify         = notify;

            //_docService = Web.Files.Classes.Global.FileStorageService;
            //_mailEraser = new MailGarbageEngine();

            Id          = queueWorkerRemove.GetProgressItemId(tenantId, FromUser);
            Status      = ProgressStatus.Queued;
            Error       = null;
            Percentage  = 0;
            IsCompleted = false;
        }
コード例 #8
0
        public RemoveProgressItem(HttpContext context, MessageService messageService, QueueWorkerRemove queueWorkerRemove, StudioNotifyService studioNotifyService, int tenantId, UserInfo user, Guid currentUserId, bool notify)
        {
            _context            = context;
            MessageService      = messageService;
            StudioNotifyService = studioNotifyService;
            _httpHeaders        = QueueWorker.GetHttpHeaders(context.Request);

            _tenantId      = tenantId;
            User           = user;
            FromUser       = user.ID;
            _userName      = UserFormatter.GetUserName(user, DisplayUserNameFormat.Default);
            _currentUserId = currentUserId;
            _notify        = notify;

            //_docService = Web.Files.Classes.Global.FileStorageService;
            //_mailEraser = new MailGarbageEngine();

            Id          = queueWorkerRemove.GetProgressItemId(tenantId, FromUser);
            Status      = ProgressStatus.Queued;
            Error       = null;
            Percentage  = 0;
            IsCompleted = false;
        }