當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。