private void button5_Click(object sender, EventArgs e) { if (dgvVinoPodrum.SelectedRows.Count > 0) { vinoPodrum odabranoVP = dgvVinoPodrum.SelectedRows[0].DataBoundItem as vinoPodrum; NovoVinoPodrum frmNovoVinoPodrum = new NovoVinoPodrum(odabranoVP); frmNovoVinoPodrum.ShowDialog(); OsvjeziPodrum(); } }
private void button4_Click(object sender, EventArgs e) { if (dgvVinoPodrum.SelectedRows.Count > 0) { foreach (DataGridViewRow row in dgvVinoPodrum.SelectedRows) { vinoPodrum odabranoVP = row.DataBoundItem as vinoPodrum; odabranoVP.Obrisi(); } } OsvjeziPodrum(); }
private void spremi_Click(object sender, EventArgs e) { if (podrum == null) { podrum = new vinoPodrum(); } podrum.opis = txtOpis.Text; podrum.kolicina = float.Parse(txtKolicina.Text); podrum.ostalo = float.Parse(txtOstalo.Text); podrum.idBerbe = int.Parse(txtIdBerbe.Text); podrum.Spremi(); this.Close(); }
public static List <vinoPodrum> DohvatiPodrum() { List <vinoPodrum> lista = new List <vinoPodrum>(); string sqlUpit = "SELECT * FROM vinoPodrum"; DbDataReader dr = DB.Instance.DohvatiDataReader(sqlUpit); while (dr.Read()) { vinoPodrum podrum = new vinoPodrum(dr); lista.Add(podrum); } dr.Close(); return(lista); }
public NovoVinoPodrum(vinoPodrum odabranoVP) { InitializeComponent(); podrum = odabranoVP; }