本文整理汇总了C#中DataBase.ItemStatusInsert方法的典型用法代码示例。如果您正苦于以下问题:C# DataBase.ItemStatusInsert方法的具体用法?C# DataBase.ItemStatusInsert怎么用?C# DataBase.ItemStatusInsert使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DataBase
的用法示例。
在下文中一共展示了DataBase.ItemStatusInsert方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: OrderGetAll
public void OrderGetAll()
{
DataBase dataBase = new DataBase();
string itemTypeName = Guid.NewGuid().ToString();
ItemType itemType = new ItemType {Name = itemTypeName,};
dataBase.ItemTypeInsert(itemType);
ItemType itemTypeGet = dataBase.ItemTypeGet(itemTypeName);
Assert.IsNotNull(itemTypeGet);
string itemName = Guid.NewGuid().ToString();
Item item = new Item
{
Name = itemName,
ItemTypeId = itemTypeGet.Id,
};
dataBase.ItemInsert(item);
Item itemGet = dataBase.ItemGet(itemName);
Assert.IsNotNull(itemGet);
string itemStatusName = Guid.NewGuid().ToString();
ItemStatus itemStatus = new ItemStatus {Name = itemStatusName};
dataBase.ItemStatusInsert(itemStatus);
ItemStatus itemStatusGet = dataBase.ItemStatusGet(itemStatusName);
Assert.IsNotNull(itemStatusGet);
string personInfoName = Guid.NewGuid().ToString();
string personInfoSurName = Guid.NewGuid().ToString();
PersonInfo personInfo = new PersonInfo {Name = personInfoName, SurName = personInfoSurName,};
dataBase.PersonInfoInsert(personInfo);
PersonInfo personInfoGet = dataBase.PersonInfoGet(personInfoName, personInfoSurName);
Assert.IsNotNull(personInfoGet);
Order order = new Order
{
ItemId = itemGet.Id,
Count = 1,
ItemStatusId = itemStatusGet.Id,
LegalEntity = true,
PersonInfoId = personInfoGet.Id,
Postage = 0M.DecimalToString(),
Price = 1M.DecimalToString(),
BankId = -1,
};
int rowsInserted = dataBase.OrderInsert(order);
Assert.AreEqual(1, rowsInserted);
List<Order> orders = dataBase.OrderGetAll();
Assert.IsNotNull(orders);
Order find = orders.Find(o => o.ItemId == itemGet.Id);
Assert.IsNotNull(find);
}
示例2: UpdateItemStatus
public void UpdateItemStatus()
{
DataBase dataBase = new DataBase();
string name = Guid.NewGuid().ToString();
ItemStatus itemStatus = new ItemStatus
{
Name = name,
Description = Guid.NewGuid().ToString(),
};
int rowsInserted = dataBase.ItemStatusInsert(itemStatus);
Assert.AreEqual(1, rowsInserted);
List<ItemStatus> list = dataBase.ItemStatusGetAll();
Assert.IsNotNull(list);
ItemStatus find = list.Find(i => i.Name == name);
Assert.IsNotNull(find);
string newName = Guid.NewGuid().ToString();
find.Name = newName;
int rowsUpdated = dataBase.ItemStatusUpdate(find);
Assert.AreEqual(1, rowsUpdated);
ItemStatus updatedItemStatus = dataBase.ItemStatusGet(find.Id);
Assert.AreEqual(newName, updatedItemStatus.Name);
Assert.AreEqual(itemStatus.Description, updatedItemStatus.Description);
}
示例3: InsertItemStatus
public void InsertItemStatus()
{
DataBase dataBase = new DataBase();
string itemStatusName = Guid.NewGuid().ToString();
ItemStatus itemStatus = new ItemStatus {Name = itemStatusName, Description = "Description",};
int rowsInserted = dataBase.ItemStatusInsert(itemStatus);
Assert.AreEqual(1, rowsInserted, "Item status not inserted!");
}