• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# member.Member类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中umbraco.cms.businesslogic.member.Member的典型用法代码示例。如果您正苦于以下问题:C# Member类的具体用法?C# Member怎么用?C# Member使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



Member类属于umbraco.cms.businesslogic.member命名空间,在下文中一共展示了Member类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: createMember

        protected void createMember(object sender, EventArgs e)
        {
            if (tb_email.Text != "")
                {
                    m = Member.GetMemberFromEmail(tb_email.Text);
                    if (m == null)
                    {
                        MemberType mt = MemberType.GetByAlias(memberType);
                        m = Member.MakeNew(tb_name.Text, mt, new umbraco.BusinessLogic.User(0));
                        m.Email = tb_email.Text;
                        m.Password = tb_password.Text;
                        m.LoginName = tb_email.Text;

                        //Standard values
                        m.getProperty("reputationTotal").Value = 20;
                        m.getProperty("reputationCurrent").Value = 20;
                        m.getProperty("forumPosts").Value = 0;

                        if (!string.IsNullOrEmpty(Group))
                        {
                            MemberGroup mg = MemberGroup.GetByName(Group);
                            if (mg != null)
                                m.AddGroup(mg.Id);
                        }

                        //set a default avatar
                        Api.CommunityController.SetAvatar(m.Id, "gravatar");

                        m.Save();
                        m.XmlGenerate(new System.Xml.XmlDocument());
                        Member.AddMemberToCache(m);
                        Response.Redirect(umbraco.library.NiceUrl(NextPage));
                    }
                }
        }
开发者ID:larrynPL,项目名称:OurUmbraco,代码行数:35,代码来源:SignupSimple.ascx.cs


示例2: MemberGroup_Add_Member_To_Group_And_Delete_Group

        public void MemberGroup_Add_Member_To_Group_And_Delete_Group()
        {
            var mt = MemberType.MakeNew(m_User, "TEST" + Guid.NewGuid().ToString("N"));
            var m = Member.MakeNew("TEST" + Guid.NewGuid().ToString("N"),
                "TEST" + Guid.NewGuid().ToString("N") + "@test.com", mt, m_User);

            var mg = MemberGroup.MakeNew("TEST" + Guid.NewGuid().ToString("N"), m_User);
            Assert.IsInstanceOfType(mg, typeof(MemberGroup));
            Assert.IsTrue(mg.Id > 0);          

            //add the member to the group
            m.AddGroup(mg.Id);

            //ensure they are added
            Assert.AreEqual(1, m.Groups.Count);
            Assert.AreEqual<int>(mg.Id, ((MemberGroup)m.Groups.Cast<DictionaryEntry>().First().Value).Id);

            //delete the group
            mg.delete();

            //make sure the member is no longer associated
            m = new Member(m.Id); //need to re-get the member
            Assert.AreEqual<int>(0, m.Groups.Count);
            
            //now cleanup...

            m.delete();
            Assert.IsFalse(Member.IsNode(m.Id));

            mt.delete();
            Assert.IsFalse(MemberType.IsNode(mt.Id));
        }
开发者ID:CarlSargunar,项目名称:Umbraco-CMS,代码行数:32,代码来源:MemberGroupTest.cs


示例3: SaveProject

        private void SaveProject(Document project, Member user)
        {
            if (!string.IsNullOrWhiteSpace(Request["title"]))
            {
                project.getProperty("title").Value = Request["title"];
            }
            if (!string.IsNullOrWhiteSpace(Request["description"]))
                project.getProperty("description").Value = Request["description"];
            if (!string.IsNullOrWhiteSpace(Request["projectType"]))
                project.getProperty("projectType").Value = Convert.ToInt32(Request["projectType"]);
            if (!string.IsNullOrWhiteSpace(Request["area"]))
                project.getProperty("area").Value = Convert.ToInt32(Request["area"]);
            project.getProperty("allowComments").Value = !string.IsNullOrWhiteSpace(Request["allowComments"]) && Request["allowComments"].ToLower().Equals("on");

            project.getProperty("author").Value = user.Id;

            if (Request.Files.Count > 0 && Request.Files[0].ContentLength > 0)
            {
                var uploadedFile = Request.Files[0];
                var fileName = Path.GetFileName(uploadedFile.FileName);
                var fileSavePath = Server.MapPath("~/media/projects/" + fileName);
                uploadedFile.SaveAs(fileSavePath);

                project.getProperty("image").Value = "/media/projects/" + fileName;
            }

            project.SaveAndPublish(user.User);
            umbraco.library.UpdateDocumentCache(project.Id);
        }
开发者ID:v-five,项目名称:upgradeit,代码行数:29,代码来源:ProjectController.cs


示例4: SetAvatar

        public static string SetAvatar(int mId, string service)
        {
            string retval = "";
            Member m = new Member(mId);

            if (m != null) {
                switch (service) {

                    case "twitter":
                        if (m.getProperty("twitter") != null && m.getProperty("twitter").Value.ToString() != "") {
                            XPathNodeIterator twitData = Twitter.Profile(m.getProperty("twitter").Value.ToString());
                            if (twitData.MoveNext()) {
                                string imgUrl = twitData.Current.SelectSingleNode("//profile_image_url").Value;
                                return saveUrlAsBuddyIcon(imgUrl, m);
                            }
                        }
                        break;
                    case "gravatar":
                        string gUrl = "http://www.gravatar.com/avatar/" + umbraco.library.md5(m.Email) + "?s=48&d=monsterid";
                        return saveUrlAsBuddyIcon(gUrl, m);
                    default:
                        break;
                }
            }

            return retval;
        }
开发者ID:nul800sebastiaan,项目名称:OurUmbraco,代码行数:27,代码来源:Rest.cs


示例5: GetOriginalUrl

        /// <summary>
        ///   Gets the image property.
        /// </summary>
        /// <returns></returns>
        internal static string GetOriginalUrl(int nodeId, ImageResizerPrevalueEditor imagePrevalueEditor)
        {
            Property imageProperty;
            var node = new CMSNode(nodeId);
            if (node.nodeObjectType == Document._objectType)
            {
                imageProperty = new Document(nodeId).getProperty(imagePrevalueEditor.PropertyAlias);
            }
            else if (node.nodeObjectType == Media._objectType)
            {
                imageProperty = new Media(nodeId).getProperty(imagePrevalueEditor.PropertyAlias);
            }
            else
            {
                if (node.nodeObjectType != Member._objectType)
                {
                    throw new Exception("Unsupported Umbraco Node type for Image Resizer (only Document, Media and Members are supported.");
                }
                imageProperty = new Member(nodeId).getProperty(imagePrevalueEditor.PropertyAlias);
            }

            try
            {
                return imageProperty.Value.ToString();
            }
            catch
            {
                return string.Empty;
            }
        }
开发者ID:ZeeshanShafqat,项目名称:Aspose_Imaging_NET,代码行数:34,代码来源:ImageResizerHelper.cs


示例6: bt_submit_Click

        protected void bt_submit_Click(object sender, EventArgs e)
        {
            umbraco.presentation.nodeFactory.Node p = new umbraco.presentation.nodeFactory.Node(int.Parse(Request.QueryString["id"]));

            Member owner = new Member(int.Parse(p.GetProperty("owner").Value));
            Member m = Member.GetCurrentMember();

            MailMessage mm = new MailMessage();
            mm.Subject = "Umbraco community: Request to contribute to project";

            mm.Body =
                string.Format("The Umbraco Community member '{0}'  would like to contribute to your project '{1}'.  You can add the member to the project from your profile on our.umbraco.org.",
                m.Text, p.Name);

            mm.Body = mm.Body + string.Format("\n\r\n\rMessage from {0}: \n\r\n\r", m.Text) + tb_message.Text;

            mm.To.Add(owner.Email);
            mm.From = new MailAddress(m.Email);

            SmtpClient c = new SmtpClient();
            c.Send(mm);

            umbraco.presentation.nodeFactory.Node current = umbraco.presentation.nodeFactory.Node.GetCurrent();

            Response.Redirect(umbraco.library.NiceUrl(current.Children[0].Id));
        }
开发者ID:ClaytonWang,项目名称:OurUmbraco,代码行数:26,代码来源:ProjectCollabRequest.ascx.cs


示例7: LinkBanMemberClick

        protected void LinkBanMemberClick(object sender, EventArgs e)
        {
            if (CurrentMember.MemberIsAdmin && ProfileMember.MemberId != null)
            {
                string usermessage;
                var cMem = new Member((int)ProfileMember.MemberId);

                if(ProfileMember.MemberIsBanned)
                {
                    //Un ban member
                    cMem.getProperty("forumUserIsBanned").Value = "0";
                    usermessage = library.GetDictionaryItem("MemberIsNowNotBanned");
                }
                else
                {
                    // Ban the member
                    cMem.getProperty("forumUserIsBanned").Value = "1";
                    usermessage = library.GetDictionaryItem("MemberIsNowBanned");
                }

                //Save member
                cMem.Save();

                //Generate member Xml Cache
                cMem.XmlGenerate(new System.Xml.XmlDocument());

                // Redirect to show message
                Response.Redirect(string.Concat(CurrentPageAbsoluteUrl, "?m=", usermessage));
            }
        }
开发者ID:wakkomail,项目名称:community-framework,代码行数:30,代码来源:MemberProfile.ascx.cs


示例8: OnNewMember

 new protected virtual void OnNewMember(NewMemberUIEventArgs e, string unencryptedPassword, Member m)
 {
     if (NewMember != null)
     {
         NewMember(m, unencryptedPassword, e);
     }
 }
开发者ID:elrute,项目名称:Triphulcas,代码行数:7,代码来源:memberTasks.cs


示例9: SendNotification

        public override bool SendNotification(System.Xml.XmlNode details, params object[] args)
        {
            try
            {
                SmtpClient c = new SmtpClient(details.SelectSingleNode("//smtp").InnerText);
                c.Credentials = new System.Net.NetworkCredential(details.SelectSingleNode("//username").InnerText, details.SelectSingleNode("//password").InnerText);

                MailAddress from = new MailAddress(
                    details.SelectSingleNode("//from/email").InnerText,
                    details.SelectSingleNode("//from/name").InnerText);

                string subject = details.SelectSingleNode("//subject").InnerText;
                string body = details.SelectSingleNode("//body").InnerText;

                string domain = details.SelectSingleNode("//domain").InnerText;

                int topicId = int.Parse(args[0].ToString());
                int memberId = int.Parse(args[1].ToString());

                uForum.Businesslogic.Topic t = uForum.Businesslogic.Topic.GetTopic(topicId);

                Member m = new Member(memberId);

                body = string.Format(body,
                    t.Title,
                   "https://" + domain + args[2].ToString());

                if (m.getProperty("bugMeNot").Value.ToString() != "1")
                {
                    MailMessage mm = new MailMessage();
                    mm.Subject = subject;
                    mm.Body = body;

                    mm.To.Add(m.Email);
                    mm.From = from;

                    c.Send(mm);
                }

                SqlConnection conn = new SqlConnection(System.Configuration.ConfigurationManager.AppSettings["umbracoDbDSN"]);

                conn.Open();

                string insert =
                       "Insert into notificationMarkAsSolution(topicId, memberID, timestamp) values(@topicId, @memberID, getdate())";

                SqlCommand icomm = new SqlCommand(insert, conn);
                icomm.Parameters.AddWithValue("@topicId", topicId);
                icomm.Parameters.AddWithValue("@memberID", m.Id);
                icomm.ExecuteNonQuery();

                conn.Close();
            }
            catch (Exception e)
            {
                umbraco.BusinessLogic.Log.Add(umbraco.BusinessLogic.LogTypes.Debug, -1, "[Notifications]" + e.Message);
            }
            return true;
        }
开发者ID:ClaytonWang,项目名称:OurUmbraco,代码行数:59,代码来源:MarkAsSolutionReminderSingle.cs


示例10: Member_AfterSave

 private void Member_AfterSave(Member sender, SaveEventArgs e)
 {
     //ensure that only the providers are flagged to listen execute
     var xml = sender.ToXml(new System.Xml.XmlDocument(), false).ToXElement();
     var providers = ExamineManager.Instance.IndexProviderCollection.OfType<BaseUmbracoIndexer>()
         .Where(x => x.EnableDefaultEventHandler);
     ExamineManager.Instance.ReIndexNode(xml, IndexTypes.Member, providers);
 }
开发者ID:Xamarui,项目名称:Examine,代码行数:8,代码来源:UmbracoEventManager.cs


示例11: GetMember

        public static Member GetMember(int id)
        {
            Member m = Member.GetMemberFromCache(id);
            if (m == null)
                m = new Member(id);

            return m;
        }
开发者ID:nul800sebastiaan,项目名称:OurUmbraco,代码行数:8,代码来源:Utills.cs


示例12: Member_AfterDelete

        private void Member_AfterDelete(Member sender, DeleteEventArgs e)
        {
            var nodeId = sender.Id.ToString();

            //ensure that only the providers are flagged to listen execute
            ExamineManager.Instance.DeleteFromIndex(nodeId,
                ExamineManager.Instance.IndexProviderCollection.OfType<BaseUmbracoIndexer>()
                    .Where(x => x.EnableDefaultEventHandler));
        }
开发者ID:Xamarui,项目名称:Examine,代码行数:9,代码来源:UmbracoEventManager.cs


示例13: SendMailFromPageToMember

        public static void SendMailFromPageToMember(string FromMail, Member member, string Subject, int PageId, string body, Dictionary<string, LinkedResource> imagedictionary)
        {
            MailMessage mail = Helper.BuildMail(member,Subject, body, imagedictionary);

            mail.From = new MailAddress(FromMail.Trim());
            mail.To.Add(new MailAddress(member.Email));

            SendMail(mail);
        }
开发者ID:petereysermans,项目名称:umbraco-mailengine,代码行数:9,代码来源:Library.cs


示例14: readById

        public memberCarrier readById(int memberId, string username, string password)
        {
            Authenticate(username, password);

            umbraco.cms.businesslogic.member.Member foundMember = new umbraco.cms.businesslogic.member.Member(memberId);
            if (foundMember == null)
                return null;

            return CreateMemberCarrier(foundMember);
        }
开发者ID:rehan-sarwar-confiz,项目名称:Umbraco-CMS,代码行数:10,代码来源:memberService.cs


示例15: SendAdminNotification

 private void SendAdminNotification(Member newmember)
 {
     var sb = new StringBuilder();
     sb.AppendFormat(library.GetDictionaryItem("MemberSignUpEmailText"), 
         Settings.Name, 
         newmember.LoginName, 
         newmember.Text, 
         newmember.Email);
     Helpers.SendMail(Settings.EmailNotification, Settings.EmailAdmin, library.GetDictionaryItem("NewMemberSignUp"), sb.ToString());
 }
开发者ID:elrute,项目名称:Triphulcas,代码行数:10,代码来源:Register.ascx.cs


示例16: Member_AfterSave

        void Member_AfterSave(Member sender, umbraco.cms.businesslogic.SaveEventArgs e)
        {

            string groups = "";
            foreach (MemberGroup mg in sender.Groups.Values)
            {
                groups += mg.Text + ",";
            }

            sender.getProperty("groups").Value = groups.Trim().Trim(','); ;
            sender.XmlGenerate(new System.Xml.XmlDocument());
        }
开发者ID:ClaytonWang,项目名称:OurUmbraco,代码行数:12,代码来源:memberSave.cs


示例17: CreateProject

        private Document CreateProject(Member user)
        {
            if (!string.IsNullOrWhiteSpace(Request["title"]))
            {
                var project = Document.MakeNew(Request["title"], DocumentType.GetByAlias("project"), user.User, new Node(1133).Id);
                SaveProject(project, user);

                return project;
            }

            return null;
        }
开发者ID:v-five,项目名称:upgradeit,代码行数:12,代码来源:ProjectController.cs


示例18: ThumbsUpPost

        public static string ThumbsUpPost(string postId)
        {
            if (MembershipHelper.IsAuthenticated())
            {
                var m = Member.GetCurrentMember();
                var forumPost = _mapper.MapForumPost(new Node(Convert.ToInt32(postId)));

                // If this current member id owns the post then ignore
                if (forumPost != null)
                {
                    if (m.Id != forumPost.Owner.MemberId)
                    {
                        // Get the member who wrote the post
                        var postMember = new Member(Convert.ToInt32(forumPost.Owner.MemberId));

                        // Get a user to save both documents with
                        var usr = new User(0);

                        // First update the karma on the post and add this logged in user to
                        // list if people who have voted on post
                        var p = new Document(forumPost.Id);
                        var votedUsers = p.getProperty("forumPostUsersVoted").Value.ToString();
                        var formattedMemberId = string.Format("{0}|", m.Id);

                        // Check to make sure they are not fiddling the system
                        if (forumPost.VotedMembersIds == null || !forumPost.VotedMembersIds.Contains(m.Id))
                        {
                            p.getProperty("forumPostKarma").Value = (forumPost.Karma + 1);
                            p.getProperty("forumPostUsersVoted").Value = formattedMemberId + votedUsers;
                            p.Publish(usr);
                            umbraco.library.UpdateDocumentCache(p.Id);
                            var newPostKarma = (forumPost.Karma + 1);

                            // Now update the members karma based on the forum settings
                            forumPost.Karma = Convert.ToInt32(postMember.getProperty("forumUserKarma").Value.ToString());
                            postMember.getProperty("forumUserKarma").Value = (forumPost.Karma + Helpers.MainForumSettings().KarmaPointsAddedForThumbUps);

                            // Save Member details
                            postMember.Save();

                            //Generate member Xml Cache
                            postMember.XmlGenerate(new System.Xml.XmlDocument());

                            return newPostKarma.ToString();
                        }
                    }
                }
            }

            return "0";
        } 
开发者ID:elrute,项目名称:Triphulcas,代码行数:51,代码来源:nForumBaseExtensions.cs


示例19: UpdateSecretCode

 public static bool UpdateSecretCode(Member member)
 {
     string secretCode = Upac.Core.Security.RandomPassword.Generate(CommonUtil.GetSetting("Membership/SecretCodeLength", 7));
     if (member != null)
     {
         Property property = member.getProperty("SecretCode");
         if (property != null)
         {
             property.Value = secretCode;
             member.Save();
         }
     }
     return false;
 }
开发者ID:1508,项目名称:upac-for-umbraco,代码行数:14,代码来源:Helper.cs


示例20: Member_New

 void Member_New(Member sender, NewEventArgs e)
 {
     //This is a bit of a hack to ensure that the member is approved when created since many people will be using
     // this old api to create members on the front-end and they need to be approved - which is based on whether or not 
     // the Umbraco membership provider is configured.
     var provider = Membership.Provider as UmbracoMembershipProvider;
     if (provider != null)
     {
         var approvedField = provider.ApprovedPropertyTypeAlias;
         var property = sender.getProperty(approvedField);
         if (property != null)
         {
             property.Value = 1;
         }
     }            
 }
开发者ID:phaniarveti,项目名称:Experiments,代码行数:16,代码来源:MembershipEventHandler.cs



注:本文中的umbraco.cms.businesslogic.member.Member类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# template.Template类代码示例发布时间:2022-05-26
下一篇:
C# media.Media类代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap