private void button21_Click(object sender, EventArgs e) { if (dataGridView5.SelectedCells.Count > 0) { BillsItem Item = new BillsItem((int)dataGridView5.Rows[dataGridView5.SelectedCells[0].RowIndex].Cells["billIdDataGridViewTextBoxColumn"].Value); Decimal Paid = Decimal.Zero; Decimal.TryParse(textBox5.Text, out Paid); Item.Paid = Paid; Item.PaidDate = dateTimePicker1.Value; if (radioButton6.Checked) { Item.PaidType = "cash"; } if (radioButton7.Checked) { Item.PaidType = "cheque"; } Item.Update(); MessageBox.Show("Платёж сделан", "Ok", MessageBoxButtons.OK, MessageBoxIcon.Information); } }