1
的消息,我得到:格式复制消息
清单包含LCD加油机不足物品,库存 包含足够的物品塔饮水机
的消息我会想到:
库存包含不足的项目用于LCD分配器,塔 分配器
List<string> errors = new List<string>();
for (int index = 0; index < this.gridagree.Rows.Count; index++)
{
int productId = Convert.ToInt32(gridagree.Rows[index].Cells[3].Text);
string productname = gridagree.Rows[index].Cells[4].Text;
int quantityRequested = Convert.ToInt32(gridagree.Rows[index].Cells[5].Text);
int availableQuantity = Convert.ToInt32(s.getprodqun(productId));
if (quantityRequested > availableQuantity)
{
errors.Add(string.Format("Inventory contains insufficient items for {0} ", productname));
}
}