Ejemplo n.º 1
0
 private void button11_Click(object sender, EventArgs e)
 {
     if (dgvVinogradSorte.SelectedRows.Count > 0)
     {
         vinogradSorte     odabraniVinS         = dgvVinogradSorte.SelectedRows[0].DataBoundItem as vinogradSorte;
         NoviVinogradSorte frmNoviVinogradSorte = new NoviVinogradSorte(odabraniVinS);
         frmNoviVinogradSorte.ShowDialog();
         OsvjeziVinogradSorte();
     }
 }
Ejemplo n.º 2
0
 private void button10_Click(object sender, EventArgs e)
 {
     if (dgvVinogradSorte.SelectedRows.Count > 0)
     {
         foreach (DataGridViewRow row in dgvVinogradSorte.SelectedRows)
         {
             vinogradSorte odabraniVinS = row.DataBoundItem as vinogradSorte;
             odabraniVinS.Obrisi();
         }
     }
     OsvjeziVinogradSorte();
 }
        private void spremi_Click(object sender, EventArgs e)
        {
            if (vinogradS == null)
            {
                vinogradS = new vinogradSorte();
            }
            vinogradS.idVinograd  = int.Parse(txtIdVinograd.Text);
            vinogradS.idSorte     = int.Parse(txtIdSorte.Text);
            vinogradS.brCokota    = int.Parse(txtBrCokota.Text);
            vinogradS.smjestaj    = txtSmjestaj.Text;
            vinogradS.datumSadnje = txtDatumSadnje.Text;

            vinogradS.Spremi();
            this.Close();
        }
Ejemplo n.º 4
0
        public static List <vinogradSorte> DohvatiVinogradSorte()
        {
            List <vinogradSorte> lista = new List <vinogradSorte>();

            string       sqlUpit = "SELECT * FROM vinograd_ima_sorte";
            DbDataReader dr      = DB.Instance.DohvatiDataReader(sqlUpit);

            while (dr.Read())
            {
                vinogradSorte vinogradSorte = new vinogradSorte(dr);
                lista.Add(vinogradSorte);
            }
            dr.Close();
            return(lista);
        }
 public NoviVinogradSorte(vinogradSorte odabraniVinS)
 {
     InitializeComponent();
     vinogradS = odabraniVinS;
 }