Пример #1
0
        private void btnObrisi_Click(object sender, EventArgs e)
        {
            bool uspjeh = false;

            if (dgvPoslodavci.SelectedCells.Count > 0)
            {
                if (MessageBox.Show("Are you sure you want to delete the selected employer?", "Warning", MessageBoxButtons.YesNo) == DialogResult.Yes)
                {
                    int indeksOznacenog = dgvPoslodavci.SelectedCells[0].RowIndex;

                    DataGridViewRow oznaceniRed = dgvPoslodavci.Rows[indeksOznacenog];

                    int ID = int.Parse(oznaceniRed.Cells["IDPoslodavca"].Value.ToString());

                    uspjeh = Upiti.ObrisiPoslodavca(ID);
                }
                if (uspjeh)
                {
                    OsvjeziPrikaz();
                }
            }
        }