Example #1
0
 public void RemoveComponentManager(ManagerBySelf component)
 {
     if (Managers != null && Managers.Any() && component != null)
     {
         Managers.Remove(component);
     }
 }
Example #2
0
 public void RemoveManager(Manager manager)
 {
     if (Managers != null && Managers.Any() && manager != null)
     {
         Managers.Remove(manager);
     }
 }
Example #3
0
        private bool IsOwnerOrManager(Guid userGuid)
        {
            var isOwner   = Owners.Any(owner => owner.OwnerGuid.Equals(userGuid));
            var isManager = Managers.Any(manager => manager.OwnerGuid.Equals(userGuid));

            return(isOwner || isManager);
        }
Example #4
0
        public bool ManagerExists(Func <Manager, bool> predicate)
        {
            var exists = Managers.Any(predicate);

            if (!exists)
            {
                exists = Managers.Local.Any(predicate);
            }
            return(exists);
        }
 protected EntityManagerBase SelectManager(IStatementRunner runner)
 {
     if (Managers?.Any(p => p.Key(runner)) ?? false)
     {
         return(Managers.First(p => p.Key(runner)).Value);
     }
     else
     {
         return(Default);
     }
 }
Example #6
0
        /// <summary>
        /// 检查下属工作
        /// </summary>
        public void CheckWork()
        {
            DoWork();

            if (Employees != null && Employees.Any())
            {
                Employees.ForEach(t =>
                {
                    t.DoWork();
                });
            }

            if (Managers != null && Managers.Any())
            {
                Managers.ForEach(t =>
                {
                    t.CheckWork();
                });
            }
        }
Example #7
0
        public bool ContainEmployee(string name, Position position)
        {
            if (position == Position.Manager)
            {
                var contain = Managers.Any(e => e.Name == name);
                return(contain);
            }

            if (position == Position.Taskmaster)
            {
                var contain = Taskmasters.Any(e => e.Name == name);
                return(contain);
            }

            if (position == Position.Worker)
            {
                var contain = Workers.Any(e => e.Name == name);
                return(contain);
            }

            return(false);
        }
Example #8
0
        private bool IsCreatorOrOwnerOrManager(Guid userGuid)
        {
            var isManager = Managers.Any(m => m.OwnerGuid.Equals(userGuid));

            return(IsCreatorOrOwner(userGuid) || isManager);
        }
Example #9
0
 public bool IsManager(Guid userGuid)
 {
     return(Managers.Any(manager => manager.OwnerGuid.Equals(userGuid)));
 }