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


C# BusinessObjectCollection.MarkForDelete方法代码示例

本文整理汇总了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);
        }
开发者ID:kevinbosman,项目名称:habanero,代码行数:20,代码来源:TestBusinessObjectCollection_AddedBOs.cs

示例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);
        }
开发者ID:kevinbosman,项目名称:habanero,代码行数:18,代码来源:TestBusinessObjectCollection_CreateBO.cs

示例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();
        }
开发者ID:kevinbosman,项目名称:habanero,代码行数:20,代码来源:TestBusinessObjectCollection_AddedBOs.cs

示例4: CreateDeletedChild

 protected static ContactPersonTestBO CreateDeletedChild(BusinessObjectCollection<ContactPersonTestBO> cpCol)
 {
     ContactPersonTestBO existingChildMarkedForDelete = CreateExistingChild(cpCol);
     cpCol.MarkForDelete(existingChildMarkedForDelete);
     return existingChildMarkedForDelete;
 }
开发者ID:kevinbosman,项目名称:habanero,代码行数:6,代码来源:TestMultipleRelationshipCancelEdits_Base.cs


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