private void button2_Click(object sender, EventArgs e) { if (dgvBerbe.SelectedRows.Count > 0) { berba odabranaB = dgvBerbe.SelectedRows[0].DataBoundItem as berba; NovaBerba frmNovaBerba = new NovaBerba(odabranaB); frmNovaBerba.ShowDialog(); OsvjeziBerbe(); } }
private void button1_Click(object sender, EventArgs e) { if (dgvBerbe.SelectedRows.Count > 0) { foreach (DataGridViewRow row in dgvBerbe.SelectedRows) { berba odabranaB = row.DataBoundItem as berba; odabranaB.Obrisi(); } } OsvjeziBerbe(); }
private void spremi_Click(object sender, EventArgs e) { if (Berba == null) { Berba = new berba(); } Berba.datum = txtDatum.Text; Berba.kolicina = float.Parse(txtKolicina.Text); Berba.idVinogradSorte = int.Parse(txtVinogradSorte.Text); Berba.Spremi(); this.Close(); }
public static List <berba> DohvatiBerbu() { List <berba> lista = new List <berba>(); string sqlUpit = "SELECT * FROM berba"; DbDataReader dr = DB.Instance.DohvatiDataReader(sqlUpit); while (dr.Read()) { berba berbe = new berba(dr); lista.Add(berbe); } dr.Close(); return(lista); }
public NovaBerba(berba odabranaB) { InitializeComponent(); Berba = odabranaB; }