private void button1_Click(object sender, EventArgs e)
{
foreach (DataGridViewRow row in dataGridView1.Rows)
{
if (row.Cells[0].Value != null && row.Cells[0].Value.ToString() == textBox1.Text)
{
var ticketsCell = row.Cells[2];
var count = int.Parse(ticketsCell.Value.ToString());
if (count == 0) MessageBox.Show("Нет билетов!");
else ticketsCell.Value = count - 1;
}
}
}