int row = datagridview1.rowcount;
int money = 0;
for(int i = 0 ; i < row ; i++)
{
int wage = convert.toint32(datagridview1.rows[i].cells[7].value.tostring());
int amount = convert.toint32(datagridview1.rows[i].cells[5].value.tostring());
int price = convert.toint32(datagridview1.rows[i].cells[4].value.tostring());
int discount = convert.toint32(datagridview1.rows[i].cells[6].value.tostring());
int total = wage+(amount*(price-(price*discount)/100)));
datagridview1.rows[i].cells[8].value = total.tostring();
money = money+total;
}
textbox1.text = money.tostring();