本文整理汇总了C#中BusinessObjectCollection.MarkForDelete方法的典型用法代码示例。如果您正苦于以下问题:C# BusinessObjectCollection.MarkForDelete方法的具体用法?C# BusinessObjectCollection.MarkForDelete怎么用?C# BusinessObjectCollection.MarkForDelete使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BusinessObjectCollection
的用法示例。
在下文中一共展示了BusinessObjectCollection.MarkForDelete方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Test_MarkForDelete_Added_MarkForDeleteBO
public void Test_MarkForDelete_Added_MarkForDeleteBO()
{
//---------------Set up test pack-------------------
BusinessObjectCollection<ContactPersonTestBO> cpCol = new BusinessObjectCollection<ContactPersonTestBO>();
ContactPersonTestBO myBO = ContactPersonTestBO.CreateSavedContactPerson("BB");
cpCol.Add(myBO);
myBO.MarkForDelete();
//---------------Assert Precondition----------------
BusinessObjectCollectionTestHelper.AssertOneObjectInMarkForDeleteAndAddedCollection(cpCol);
Assert.IsTrue(myBO.Status.IsDirty);
//---------------Execute Test ----------------------
cpCol.MarkForDelete(myBO);
//---------------Test Result -----------------------
BusinessObjectCollectionTestHelper.AssertOneObjectInMarkForDeleteAndAddedCollection(cpCol);
Assert.IsTrue(myBO.Status.IsDirty);
}
示例2: Test_CreatedBusinessObject_ColMarkForDelete_ShouldBeRemovedFromTheCollection
public void Test_CreatedBusinessObject_ColMarkForDelete_ShouldBeRemovedFromTheCollection()
{
//---------------Set up test pack-------------------
//ContactPersonTestBO.LoadDefaultClassDef();
BusinessObjectCollection<ContactPersonTestBO> cpCol = new BusinessObjectCollection<ContactPersonTestBO>();
ContactPersonTestBO newCP = cpCol.CreateBusinessObject();
newCP.Surname = TestUtil.GetRandomString();
//---------------Assert Precondition----------------
AssertOneObjectInCurrentAndCreatedCollection(cpCol);
//---------------Execute Test ----------------------
cpCol.MarkForDelete(newCP);
//---------------Test Result -----------------------
Assert.AreEqual(0, cpCol.Count);
Assert.IsTrue(newCP.Status.IsDeleted);
}
示例3: TestAddMethod_MarkForDeleteAddedBusinessObject
public void TestAddMethod_MarkForDeleteAddedBusinessObject()
{
//---------------Set up test pack-------------------
BusinessObjectCollection<ContactPersonTestBO> cpCol = new BusinessObjectCollection<ContactPersonTestBO>();
ContactPersonTestBO myBO = ContactPersonTestBO.CreateSavedContactPerson();
cpCol.Add(myBO);
_businessObjectCollectionTestHelper.RegisterForAddedAndRemovedEvents(cpCol);
//---------------Assert Precondition----------------
BusinessObjectCollectionTestHelper.AssertOneObjectInCurrentAndAddedCollection(cpCol);
Assert.IsFalse(myBO.Status.IsDirty);
_businessObjectCollectionTestHelper.AssertAddedAndRemovedEventsNotFired();
//---------------Execute Test ----------------------
cpCol.MarkForDelete(myBO);
//---------------Test Result -----------------------
BusinessObjectCollectionTestHelper.AssertOneObjectInMarkForDeleteAndAddedCollection(cpCol);
Assert.IsTrue(myBO.Status.IsDirty);
_businessObjectCollectionTestHelper.AssertRemovedEventFired();
}
示例4: CreateDeletedChild
protected static ContactPersonTestBO CreateDeletedChild(BusinessObjectCollection<ContactPersonTestBO> cpCol)
{
ContactPersonTestBO existingChildMarkedForDelete = CreateExistingChild(cpCol);
cpCol.MarkForDelete(existingChildMarkedForDelete);
return existingChildMarkedForDelete;
}