Esempio n. 1
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;
        }
Esempio n. 2
0
        public RemoveProgressItem(
            IServiceProvider serviceProvider,
            IHttpContextAccessor httpContextAccessor)
        {
            _httpHeaders    = QueueWorker.GetHttpHeaders(httpContextAccessor.HttpContext.Request);
            ServiceProvider = serviceProvider;


            //_docService = Web.Files.Classes.Global.FileStorageService;
            //_mailEraser = new MailGarbageEngine();
        }
        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();
        }
Esempio n. 4
0
        public RemoveProgressItem(int tenantId, Guid userId, Guid currentUserId)
        {
            _tenantId      = tenantId;
            _userId        = userId;
            _currentUserId = currentUserId;

            _crmDaoFactory = Web.CRM.Classes.Global.DaoFactory;
            _docService    = Web.Files.Classes.Global.FileStorageService;
            _mailEraser    = new MailGarbageEraser();

            Id          = QueueWorker.GetProgressItemId(tenantId, userId, typeof(RemoveProgressItem));
            Status      = ProgressStatus.Queued;
            Error       = null;
            Percentage  = 0;
            IsCompleted = false;
        }
        public RemoveProgressItem(HttpContext context, int tenantId, UserInfo user, Guid currentUserId)
        {
            _context     = context;
            _httpHeaders = QueueWorker.GetHttpHeaders(context.Request);

            _tenantId      = tenantId;
            _userId        = user.ID;
            _userName      = UserFormatter.GetUserName(user, DisplayUserNameFormat.Default);
            _currentUserId = currentUserId;

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

            Id          = QueueWorker.GetProgressItemId(tenantId, _userId, typeof(RemoveProgressItem));
            Status      = ProgressStatus.Queued;
            Error       = null;
            Percentage  = 0;
            IsCompleted = false;
        }
        public ReassignProgressItem(HttpContext context, int tenantId, Guid fromUserId, Guid toUserId, Guid currentUserId)
        {
            _context     = context;
            _httpHeaders = QueueWorker.GetHttpHeaders(context.Request);

            _tenantId      = tenantId;
            _fromUserId    = fromUserId;
            _toUserId      = toUserId;
            _currentUserId = currentUserId;

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

            Id          = QueueWorker.GetProgressItemId(tenantId, fromUserId, typeof(ReassignProgressItem));
            Status      = ProgressStatus.Queued;
            Error       = null;
            Percentage  = 0;
            IsCompleted = false;
        }
Esempio n. 7
0
        private void DeleteUserProfile()
        {
            var user     = CoreContext.UserManager.GetUsers(_fromUserId);
            var userName = user.DisplayUserName(false);

            UserPhotoManager.RemovePhoto(user.ID);
            CoreContext.UserManager.DeleteUser(user.ID);
            QueueWorker.StartRemove(_context, _tenantId, user, _currentUserId, false);

            if (_httpHeaders != null)
            {
                MessageService.Send(_httpHeaders, MessageAction.UserDeleted, MessageTarget.Create(_fromUserId),
                                    new[] { userName });
            }
            else
            {
                MessageService.Send(_context.Request, MessageAction.UserDeleted, MessageTarget.Create(_fromUserId),
                                    userName);
            }
        }
        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;
        }
Esempio n. 9
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;
        }