本文整理汇总了C#中Company.Destory方法的典型用法代码示例。如果您正苦于以下问题:C# Company.Destory方法的具体用法?C# Company.Destory怎么用?C# Company.Destory使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Company
的用法示例。
在下文中一共展示了Company.Destory方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: TestCompanyCRUD
public void TestCompanyCRUD()
{
List<Company> list = Company.Query("code = 'testcode'");
foreach (Company c in list)
{
c.Destory();
}
list = Company.Query();
long count = list.Count;
Company com = new Company();
com.Code = "testcode";
com.Name = "testname";
com.Doc = "沪";
com.Input = "X";
com.Output = "X";
com.ParentID = Company.Query("input <> 'X' and output <> 'X'")[0].ID;
for (int i = 0; i < 10; i++)
{
CompanyDetail d = new CompanyDetail();
d.BankID = Bank.Query()[0].ID;
d.Account = i.ToString();
d.Balance = i;
d.Credit = i;
com.DetailList.Add(d);
}
Assert.IsTrue(com.Save());
Assert.IsTrue(com.ID > 0);
Company q = Company.CreateByID(com.ID);
Assert.IsTrue(q.ID == com.ID);
Assert.IsTrue(q.DetailList.Count == 10);
q.DetailList.RemoveAt(0);
q.Save();
list = q.Find("code = 'testcode'");
Assert.IsTrue(list.Count == 1);
Assert.IsTrue(list[0].DetailList.Count == 9);
list = Company.Query();
Assert.IsTrue(list.Count == count + 1);
com.Destory();
list = Company.Query();
Assert.IsTrue(list.Count == count);
}