Example #1
0
        /// <summary>
        /// 从矩阵中获得对象。这主要取决于上下文中的参数
        /// </summary>
        /// <returns></returns>
        public OguDataCollection <IOguObject> GetObjectsFromMatrix()
        {
            OguDataCollection <IOguObject> result = new OguDataCollection <IOguObject>();

            SOARoleContext context = SOARoleContext.Current;

            if (context != null && context.QueryParams.Count > 0)
            {
                SOARolePropertyRowCollection matchedRows = this.Rows.Query(context.QueryParams);

                matchedRows = matchedRows.ExtractMatrixRows();
                foreach (SOARolePropertyRowUsers rowUsers in matchedRows.GenerateRowsUsers())
                {
                    foreach (IUser user in rowUsers.Users)
                    {
                        if (result.Contains(user) == false)
                        {
                            result.Add(user);
                        }
                    }
                }
            }

            return(result);
        }
Example #2
0
 private static void FillMatchedUsers(IEnumerable <string> objectIDs, Dictionary <string, IUser> userDicts, OguDataCollection <IUser> target)
 {
     foreach (string id in objectIDs)
     {
         IUser user = null;
         if (userDicts.TryGetValue(id, out user))
         {
             target.Add((IUser)OguUser.CreateWrapperObject(user));
         }
     }
 }
Example #3
0
        /// <summary>
        /// 得到用户的所有兼职信息的TopOU
        /// </summary>
        /// <returns></returns>
        public OguDataCollection <IOrganization> GetCurrentAllTopOUs()
        {
            OguDataCollection <IOrganization> result = new OguDataCollection <IOrganization>();

            foreach (IUser user in DeluxeIdentity.CurrentUser.AllRelativeUserInfo)
            {
                result.Add(user.TopOU);
            }

            return(result);
        }
        private OguDataCollection <IUser> GetEarliestMergedUsers(SOARolePropertyRowUsers rowUsers, int startIndex)
        {
            OguDataCollection <IUser> result = new OguDataCollection <IUser>();

            foreach (IUser user in rowUsers.Users)
            {
                if (ExistsEarliestUser(user, startIndex) == false)
                {
                    result.Add(user);
                }
            }

            return(result);
        }
Example #5
0
        //public void Remove(TTaskAssignee assignee)
        //{
        //    List.Remove(assignee);
        //}

        /// <summary>
        /// 根据类别来筛选出用户
        /// </summary>
        /// <param name="type"></param>
        /// <returns></returns>
        public OguDataCollection <TOguObject> GetAssigneesByType(string type)
        {
            OguDataCollection <TOguObject> result = new OguDataCollection <TOguObject>();

            this.ForEach(assingee =>
            {
                if (string.Compare(assingee.Type, type, true) == 0)
                {
                    result.Add(assingee.Assignee);
                }
            });

            return(result);
        }