01.
foreach
(GridViewRow r
in
dgvOrder.Rows)
02.
{
03.
TextBox myTextBox = (TextBox)r.FindControl(
"txtQuantity"
);
04.
if
(IsNaturalNumber(myTextBox.Text))
05.
{
06.
qty =
int
.Parse(myTextBox.Text);
07.
price =
double
.Parse(r.Cells[4].Text);
08.
09.
total = price * qty;
10.
orderPrice += total;
11.
12.
r.Cells[7].Text = total.ToString(
"#,##0.00"
);
13.
lblAlert.Visible =
false
;
14.
}
15.
else
16.
{
17.
lblAlert.Visible =
true
;
18.
return
;
19.
}
20.
}