SalesOrderEntry rey = new SalesOrderEntry(id, cash);
total = Convert.ToInt32(lblCustomersCash.Text) - Convert.ToInt32(lblSubtotal.Text);
if (total > cash)
{
DGVTOTAL.DataSource = ProductREPO.GETORDERTOTALLIST();
for (int i = 0; i < DGVORDER.Rows.Count; ++i)
{
SalesOrderEntry see = new SalesOrderEntry(id, cash);
//CASH = 649 and im selecting an item that is equivalent to 30
sum2 = Convert.ToInt32(DGVORDER.Rows[i].Cells["OrderedProductPrice"].Value);
dgvGetID.DataSource = SalesORDERREPO.weredone(id);
decimal newcash = int.Parse(dgvGetID.Rows[0].Cells["Cash"].Value.ToString());
MessageBox.Show("NEW BALANCE CASH: " + newcash);
}
}
else
{
MessageBox.Show("Hey your Cash is not ENOUGH to Buy this ITEM");
}
我想显示其新的现金余额.. 扣除其小计.. 但我有这个错误:
<Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index>