private void btnAzurirajSmer_Click(object sender, EventArgs e) { if (Provera.proveraSmera(txtboxIDSmera.Text, txtboxNazivSmera.Text, txtboxIDSkole2.Text)) { // 1 int idSmera = int.Parse(txtboxIDSmera.Text); string nazivSmera = txtboxNazivSmera.Text; int idSkole = int.Parse(txtboxIDSkole2.Text); // 2 bool success = databaseHelper.UpdateDataInSmer(idSmera, nazivSmera, idSkole); if (success == true) { MessageBox.Show("Smer je uspešno ažuriran."); DataTable dt = databaseHelper.SelectDataFromSmer(); dataGridViewSmer.DataSource = dt; Clear(); } else { MessageBox.Show("Greška prilikom ažuriranja smera! Pokušaj opet."); } } }
private void btnObrisiSmer_Click(object sender, EventArgs e) { if (Provera.proveraSmera(txtboxIDSmera.Text, "pr", "123")) { // 1 int idSmera = int.Parse(txtboxIDSmera.Text); // 2 bool success = databaseHelper.DeleteDataInSmer(idSmera); if (success == true) { MessageBox.Show("Smer je uspešno obrisan."); DataTable dt = databaseHelper.SelectDataFromSmer(); dataGridViewSmer.DataSource = dt; Clear(); } else { MessageBox.Show("Greška prilikom brisanja smera! Pokušaj opet."); } } }