zoukankan      html  css  js  c++  java
  • 从人员选择器中取值

    /// <summary>
            /// 从人员选择器中取值
            /// </summary>
            /// <param name="peopleEditor"></param>
            /// <returns></returns>
            public static List<SPPrincipal> GetSPPrincipalsFromPeopleEditor(PeopleEditor peopleEditor)
            {
                List<SPPrincipal> rtn = new List<SPPrincipal>();
                SPWeb web = SPContext.Current.Web;
                SPUserCollection users = web.SiteUsers;
                SPGroupCollection groups = web.SiteGroups;
                foreach (PickerEntity pe in peopleEditor.ResolvedEntities)
                {
                    string principalType = pe.EntityData["PrincipalType"].ToString();
                    if (principalType == "User" || principalType == "SecurityGroup")
                    {
                        string loginName = pe.Key;
                        foreach (SPUser u in users)
                        {
                            if (u.LoginName == loginName)
                            {
                                rtn.Add(u);
                                break;
                            }
                        }
                    }
                    string groupName = pe.Key;
                    foreach (SPGroup g in groups)
                    {
                        if (g.Name == groupName)
                        {
                            rtn.Add(g);
                            break;
                        }
                    }
                }
                return rtn;
            }
  • 相关阅读:
    CentOS7安装Oracle 11gR2 安装
    CentOS7 FTP服务搭建(虚拟用户访问FTP服务)
    .NET中RabbitMQ的使用
    ElasticSearch(站内搜索)
    SignalR 2.1 简单入门项目
    Oracl基础知识(一)
    CentOS6—HAProxy安装与配置
    Redis C#缓存的使用
    CentOS6— Redis安装(转和延续)
    Linux(CentOS)常用操作指令(二)
  • 原文地址:https://www.cnblogs.com/hqbird/p/2044317.html
Copyright © 2011-2022 走看看