Example #1
0
 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();
     }
 }
Example #2
0
 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();
 }
Example #3
0
        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();
        }
Example #4
0
        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);
        }
Example #5
0
 public NovaBerba(berba odabranaB)
 {
     InitializeComponent();
     Berba = odabranaB;
 }