private void Button_DodajMarku_Click(object sender, RoutedEventArgs e) { frmMarka prozor = new frmMarka(); prozor.ShowDialog(); Button_Click_Marke(sender, e); }
private void btnIzmeniMarku_Click(object sender, RoutedEventArgs e) { try { azuriraj = true; frmMarka prozor = new frmMarka(); konekcija.Open(); DataRowView red = (DataRowView)CentralniGrid.SelectedItems[0]; selektovan = red; string upit = "Select * from tblMarka where MarkaID=" + red["ID"]; SqlCommand komanda = new SqlCommand(upit, konekcija); SqlDataReader citac = komanda.ExecuteReader(); while (citac.Read()) { prozor.txtNazivMarke.Text = citac["Marka"].ToString(); } prozor.ShowDialog(); } catch (ArgumentOutOfRangeException) { MessageBox.Show("Potrebno je selektovati odgovarajuci red!"); } finally { if (konekcija != null) { konekcija.Close(); } Button_Click_Marke(sender, e); azuriraj = false; } }
public void frmMarkaListe() { frmMarka frm = new frmMarka(); MainPage.Kontrol = true; frm.ShowDialog(); }
public void MarkaGiris() { frmMarka frm = new frmMarka(); frm.ShowDialog(); }