當前位置: 首頁>>代碼示例>>C#>>正文


C# Member.PopulateMemberFromReader方法代碼示例

本文整理匯總了C#中umbraco.cms.businesslogic.member.Member.PopulateMemberFromReader方法的典型用法代碼示例。如果您正苦於以下問題:C# Member.PopulateMemberFromReader方法的具體用法?C# Member.PopulateMemberFromReader怎麽用?C# Member.PopulateMemberFromReader使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在umbraco.cms.businesslogic.member.Member的用法示例。


在下文中一共展示了Member.PopulateMemberFromReader方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: GetMemberByName

        public static Member[] GetMemberByName(string usernameToMatch, bool matchByNameInsteadOfLogin)
        {
            string field = matchByNameInsteadOfLogin ? "umbracoNode.text" : "cmsMember.loginName";

            var tmp = new List<Member>();
            using (IRecordsReader dr = SqlHelper.ExecuteReader(
                                        string.Format(m_SQLOptimizedMany.Trim(),
                                        string.Format("{0} like @letter", field),
                                        "umbracoNode.text"),
                                            SqlHelper.CreateParameter("@nodeObjectType", Member._objectType),
                                            SqlHelper.CreateParameter("@letter", usernameToMatch + "%")))
            {
                while (dr.Read())
                {
                    Member m = new Member(dr.GetInt("id"), true);
                    m.PopulateMemberFromReader(dr);
                    tmp.Add(m);
                }
            }

            return tmp.ToArray();

        }
開發者ID:phaniarveti,項目名稱:Experiments,代碼行數:23,代碼來源:Member.cs

示例2: GetAllAsList

        public static IEnumerable<Member> GetAllAsList()
        {
            var tmp = new List<Member>();
            using (IRecordsReader dr = SqlHelper.ExecuteReader(
                                        string.Format(m_SQLOptimizedMany.Trim(), "1=1", "umbracoNode.text"),
                                            SqlHelper.CreateParameter("@nodeObjectType", Member._objectType)))
            {
                while (dr.Read())
                {
                    Member m = new Member(dr.GetInt("id"), true);
                    m.PopulateMemberFromReader(dr);
                    tmp.Add(m);
                }
            }

            return tmp.ToArray();
        }
開發者ID:phaniarveti,項目名稱:Experiments,代碼行數:17,代碼來源:Member.cs

示例3: getAllOtherMembers

        /// <summary>
        /// Retrieves a list of members thats not start with a-z
        /// </summary>
        /// <returns>array of members</returns>
        public static Member[] getAllOtherMembers()
        {

            var tmp = new List<Member>();
            using (IRecordsReader dr = SqlHelper.ExecuteReader(
                                        string.Format(m_SQLOptimizedMany.Trim(), "LOWER(SUBSTRING(text, 1, 1)) NOT IN ('a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z')", "umbracoNode.text"),
                                            SqlHelper.CreateParameter("@nodeObjectType", Member._objectType)))
            {
                while (dr.Read())
                {
                    Member m = new Member(dr.GetInt("id"), true);
                    m.PopulateMemberFromReader(dr);
                    tmp.Add(m);
                }
            }

            return tmp.ToArray();
        }
開發者ID:phaniarveti,項目名稱:Experiments,代碼行數:22,代碼來源:Member.cs

示例4: GetMembersFromEmail

        /// <summary>
        /// Retrieve Members given an email
        /// 
        /// Used when authentifying a Member
        /// </summary>
        /// <param name="email">The email of the member(s)</param>
        /// <returns>The members with the specified email</returns>
        public static Member[] GetMembersFromEmail(string email)
        {
            if (string.IsNullOrEmpty(email))
                return null;

            var tmp = new List<Member>();
            using (var dr = SqlHelper.ExecuteReader(string.Format(_sQLOptimizedMany.Trim(),
                                        "Email = @email",
                                        "umbracoNode.text"),
                                            SqlHelper.CreateParameter("@nodeObjectType", Member._objectType),
                                            SqlHelper.CreateParameter("@email", email.ToLower())))
            {
                while (dr.Read())
                {
                    var m = new Member(dr.GetInt("id"), true);
                    m.PopulateMemberFromReader(dr);
                    tmp.Add(m);
                }
            }
            return tmp.ToArray();
        }
開發者ID:phaniarveti,項目名稱:Experiments,代碼行數:28,代碼來源:Member.cs


注:本文中的umbraco.cms.businesslogic.member.Member.PopulateMemberFromReader方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。