예제 #1
0
        public static PartakerInvExistsResult CheckPending(IPartakerInvManager partakerInvManager, Guid partakerInvId)
        {
            if (partakerInvManager == null) throw new ArgumentNullException(nameof(partakerInvManager)); 

            var pendingInvs = partakerInvManager.FindPartakerInv(partakerInvId); 

            if (pendingInvs == null)
            {
                return new PartakerInvExistsResult(false,"不存在对应的任务邀请.",null);
            }
            return new PartakerInvExistsResult(true, null, pendingInvs);
        }
예제 #2
0
        public static PartakerInvExistsResult CheckPending(IPartakerInvManager partakerInvManager, TaskEntity task, StaffEntity staff)
        {
            if (partakerInvManager == null) throw new ArgumentNullException(nameof(partakerInvManager));
            if (task == null) throw new ArgumentNullException(nameof(task));
            if (staff == null) throw new ArgumentNullException(nameof(staff));

            var pendingInvs = partakerInvManager.FetchPendingPartakerInvs(task.Id, staff.Id); 
            var existed = pendingInvs.FirstOrDefault();

            if (existed == null)
            {
                return new PartakerInvExistsResult(false,"不存在对应的任务邀请.",null);
            }
            return new PartakerInvExistsResult(true, null, existed);
        }
예제 #3
0
        public PartakerInvController(ISessionProvider<AefSession> sessionProvider,
            ITaskManager taskManager,
            IStaffManager staffManager,
            IPartakerInvManager partakerInvManager,
            INotificationManager notificationManager, 
            IConfiguration config,
            IIMService imService)
            : base(sessionProvider)
        {
            if (taskManager == null) throw new ArgumentNullException(nameof(taskManager));
            if (staffManager == null) throw new ArgumentNullException(nameof(staffManager));
            if (partakerInvManager == null) throw new ArgumentNullException(nameof(partakerInvManager));
            if (notificationManager == null) throw new ArgumentException(nameof(notificationManager));
            if (config == null) throw new ArgumentException(nameof(config));
            if (imService == null) throw new ArgumentException(nameof(imService));

            m_TaskManager = taskManager;
            m_StaffManager = staffManager;
            m_PartakerInvManager = partakerInvManager;
            m_Configuration = config;
            m_NotificationManager = notificationManager;
            m_IIMService = imService;
        }