本文整理汇总了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));
}
示例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!";
}
}
}
示例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();
}
}
}
示例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);
}
}