示例#1
0
 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();
     }
 }
示例#2
0
        private void spremi_Click(object sender, EventArgs e)
        {
            if (popis == null)
            {
                popis = new sorte();
            }
            popis.naziv = txtNazivS.Text;

            popis.Spremi();
            this.Close();
        }
示例#3
0
 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();
 }
示例#4
0
        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);
        }
示例#5
0
 public NovaSorta(sorte odabranaS)
 {
     InitializeComponent();
     popis = odabranaS;
 }