private void btnObrisi_Click(object sender, EventArgs e) { bool uspjeh = false; if (dgvPoslovi.SelectedCells.Count > 0) { if (MessageBox.Show("Are you sure you want to delete the selected job? ", "Warning", MessageBoxButtons.YesNo) == DialogResult.Yes) { int indeksOznacenog = dgvPoslovi.SelectedCells[0].RowIndex; DataGridViewRow oznaceniRed = dgvPoslovi.Rows[indeksOznacenog]; int ID = int.Parse(oznaceniRed.Cells["IDPosla"].Value.ToString()); uspjeh = Upiti.ObrisiPosao(ID); } } if (uspjeh) { OsvjeziPrikaz(); } }