コード例 #1
0
 private void btnDelete_Click(object sender, EventArgs e)
 {
     if (dtvKorisnici.Rows.Count < 1)
     {
         MessageBox.Show("Izaberite red u tabeli.");
     }
     else
     {
         int id = Convert.ToInt32(dtvKorisnici.CurrentRow.Cells[0].Value);
         using (DBBL data = new DBBL())
         {
             try
             {
                 data.removeKorisnik(data.getKorisnikByID(id));
             }
             catch (Exception err)
             {
                 MessageBox.Show(err.ToString());
             }
             MessageBox.Show("Uspješno ste izbrisali korisnika");
             dtvKorisnici.DataSource = null;
             dtvKorisnici.DataSource = data.getKorisnikByAnyParameter(tboxPretraga.Text);
         }
         KorisniciTableWidth();
     }
 }