public frmUnosUlice() { InitializeComponent(); ulica = new UlicaBLL(); combo = new PopunaCmBox(); mesto = new MestoBLL(); table = new DataTable(); combo.popuniCmbMesto(cmbMesta); }
private void button1_Click_1(object sender, EventArgs e) { bool provera = false; foreach (var c in this.Controls) { if (c is TextBox && ((TextBox)c).Text == "") { MessageBox.Show("Morate popuniti sva polja"); provera = false; break; } else if (c is ComboBox && ((ComboBox)c).Text == "") { MessageBox.Show("Morate popuniti sva polja"); provera = false; break; } else { provera = true; } } if (provera == true) { ulica.Naziv_Ulice = tbNazivUlice.Text; ulica.ID_Ulice = int.Parse(cmbUlica.SelectedValue.ToString()); groupBox1.Visible = false; ulica.izmeniUlicu(ulica); MessageBox.Show("Uspesno ste izmenili podatke o: " + cmbUlica.Text + "\n u evidenciju", "Informacija", MessageBoxButtons.OK, MessageBoxIcon.Information); combo.popuniCmbUlica(cmbUlica); combo.popuniCmbMesto(cmbMesto); table = (DataTable)cmbUlica.DataSource; groupBox1.Visible = false; foreach (var c in this.Controls) { if (c is TextBox) { ((TextBox)c).Text = String.Empty; } else if (c is ComboBox) { ((ComboBox)c).Text = String.Empty; } } } }
public frmBrisanjeAzuriranjeUlice() { InitializeComponent(); combo = new PopunaCmBox(); ulica = new UlicaBLL(); mesto = new MestoBLL(); table = new DataTable(); combo.popuniCmbUlica(cmbUlica); combo.popuniCmbMesto(cmbMesto); table = (DataTable)cmbUlica.DataSource; }