private void btnConfirm_Click(object sender, EventArgs e) { if (balnce > totalBalnc) { foreach (var item in orders) { items.BuyProduct(rfid, balnce - totalBalnc); } lbCurrentBalance.Text = (balnce - totalBalnc).ToString(); } lbCurrentBalance.Text = (balnce - totalBalnc).ToString(); //if (balnce == 0) //{ // lbCurrentBalance.Text = "not enough money"; // MessageBox.Show("You are not allowed to buy this/these product(s)"); //} dataGridVisitor.Rows.Clear(); }
private void btnConfirm_Click(object sender, EventArgs e) { if (balnce > totalBalnc) { foreach (var item in orders) { items.BuyProduct(rfid, balnce - totalBalnc); } lbCurrentBalance.Text = (balnce - totalBalnc).ToString(); } DataGridViewRow newDataRow = dataGridVisitor.Rows[indexRow]; newDataRow.Cells[2].Value = textBox1.Text; Totalprice(); lbCurrentBalance.Text = (balnce - totalBalnc).ToString(); //if (balnce == 0) //{ // lbCurrentBalance.Text = "not enough money"; // MessageBox.Show("You are not allowed to buy this/these product(s)"); //} // dataGridVisitor.Rows.Clear(); }