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));
}
}