예제 #1
0
        protected IEnumerable <UserType> GetUsersProperty(string userType = null)
        {
            IEnumerable <Users> users        = _context.Users;
            List <UserType>     userTypeList = new List <UserType>();

            if (userType.ToUpper().Equals(MANAGER_STR))
            {
                var tmgrList = (users.Where(u => !string.IsNullOrEmpty(u.Position)));
                foreach (var item in tmgrList)
                {
                    var mgr = new UserType(item, userType);
                    userTypeList.Add(mgr);
                    UserType.Clients(users, mgr);
                }
            }
            else if (userType.ToUpper().Equals(CLIENT_STR))
            {
                var tClient = users.Where(u => u.Level.HasValue);
                foreach (var item in tClient)
                {
                    var client = new UserType(item, userType);
                    userTypeList.Add(client);
                    UserType.ManagerList(users, client);
                }
            }
            return(userTypeList);
        }