当前位置: 首页>>代码示例>>C#>>正文


C# Member.delete方法代码示例

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


在下文中一共展示了Member.delete方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: 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

示例2: rptMember_ItemCommand

        protected void rptMember_ItemCommand(object source, RepeaterCommandEventArgs e)
        {
            if (!string.IsNullOrEmpty(e.CommandArgument.ToString()))
            {
                int id = Convert.ToInt32(e.CommandArgument);
                if (e.CommandName == "delete")
                {
                    Member memberToDelete = new Member(id);

                    foreach (MemberGroup memberGroup in memberToDelete.Groups)
                    {
                        memberToDelete.RemoveGroup(memberGroup.Id);
                    }

                    memberToDelete.delete();

                    this.lblResultInfo.Text = "Lid verwijderd uit alle groepen!";
                }
            }
        }
开发者ID:wakkomail,项目名称:community-framework,代码行数:20,代码来源:EditMembers.ascx.cs

示例3: DeleteFromType

 /// <summary>
 /// Deletes all members of the membertype specified
 /// 
 /// Used when a membertype is deleted
 /// 
 /// Use with care
 /// </summary>
 /// <param name="dt">The membertype which are being deleted</param>
 public static void DeleteFromType(MemberType dt)
 {
     var objs = getContentOfContentType(dt);
     foreach (Content c in objs)
     {
         // due to recursive structure document might already been deleted..
         if (IsNode(c.UniqueId))
         {
             Member tmp = new Member(c.UniqueId);
             tmp.delete();
         }
     }
 }
开发者ID:phaniarveti,项目名称:Experiments,代码行数:21,代码来源:Member.cs

示例4: delete

        public void delete(int id, string username, string password)
        {

            Authenticate(username, password);

            // We load the member
            umbraco.cms.businesslogic.member.Member deleteMember;
            try
            {
                deleteMember = new umbraco.cms.businesslogic.member.Member(id);
            }
            catch (Exception ex)
            {
                throw new Exception("Member not found" + ex.Message);
            }

            // We delete him (cruel world)
            try
            {
                deleteMember.delete();
            }
            catch (Exception ex)
            {
                throw new Exception("Member could not be deleted" + ex.Message);
            }
        }
开发者ID:rehan-sarwar-confiz,项目名称:Umbraco-CMS,代码行数:26,代码来源:memberService.cs


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