本文整理汇总了C#中DataBase.OrderGetByLegalEntity方法的典型用法代码示例。如果您正苦于以下问题:C# DataBase.OrderGetByLegalEntity方法的具体用法?C# DataBase.OrderGetByLegalEntity怎么用?C# DataBase.OrderGetByLegalEntity使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DataBase
的用法示例。
在下文中一共展示了DataBase.OrderGetByLegalEntity方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: OrderGetByLegalEntity
public void OrderGetByLegalEntity()
{
DataBase dataBase = new DataBase();
const decimal @decimal = 6.00M;
int rowsInserted = dataBase.OrderInsert(new Order
{
ItemId = 1,
Count = 2,
ItemStatusId = 3,
LegalEntity = true,
PersonInfoId = 4,
Postage = 5M.DecimalToString(),
Price = @decimal.DecimalToString(),
});
Assert.AreEqual(1, rowsInserted);
rowsInserted = dataBase.OrderInsert(new Order
{
ItemId = 10,
Count = 20,
ItemStatusId = 3,
LegalEntity = false,
PersonInfoId = 5,
Postage = 10M.DecimalToString(),
Price = 2.99M.DecimalToString(),
});
Assert.AreEqual(1, rowsInserted);
const decimal price = 7.123M;
rowsInserted = dataBase.OrderInsert(new Order
{
ItemId = 2,
Count = 3,
ItemStatusId = 4,
LegalEntity = false,
PersonInfoId = 5,
Postage = 6M.DecimalToString(),
Price = price.DecimalToString(),
});
Assert.AreEqual(1, rowsInserted);
List<Order> orders = dataBase.OrderGetByLegalEntity();
Assert.IsNotNull(orders);
Assert.AreEqual(true, orders[0].LegalEntity);
List<Order> list = orders.FindAll(o => o.Price == @decimal.DecimalToString());
Assert.IsNotNull(list);
Assert.IsTrue(list.Count > 0);
}