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