private void button8_Click(object sender, EventArgs e) { if (dgvSorte.SelectedRows.Count > 0) { sorte odabranaS = dgvSorte.SelectedRows[0].DataBoundItem as sorte; NovaSorta frmNovaSorta = new NovaSorta(odabranaS); frmNovaSorta.ShowDialog(); OsvjeziSorte(); } }
private void spremi_Click(object sender, EventArgs e) { if (popis == null) { popis = new sorte(); } popis.naziv = txtNazivS.Text; popis.Spremi(); this.Close(); }
private void button7_Click(object sender, EventArgs e) { if (dgvSorte.SelectedRows.Count > 0) { foreach (DataGridViewRow row in dgvSorte.SelectedRows) { sorte odabranaS = row.DataBoundItem as sorte; odabranaS.Obrisi(); } } OsvjeziSorte(); }
public static List <sorte> DohvatiSorte() { List <sorte> lista = new List <sorte>(); string sqlUpit = "SELECT * FROM sorte"; DbDataReader dr = DB.Instance.DohvatiDataReader(sqlUpit); while (dr.Read()) { sorte popis = new sorte(dr); lista.Add(popis); } dr.Close(); return(lista); }
public NovaSorta(sorte odabranaS) { InitializeComponent(); popis = odabranaS; }