public List <IOpstiDomenskiObjekat> ExecuteReader(string upit, IOpstiDomenskiObjekat odo)
        {
            komanda.CommandText = upit;
            komanda.CommandType = System.Data.CommandType.Text;
            OleDbDataReader citac = komanda.ExecuteReader();
            List <IOpstiDomenskiObjekat> lista = odo.VratiListu(citac);

            citac.Close();
            return(lista);
        }
        public List <IOpstiDomenskiObjekat> SelectAll(IOpstiDomenskiObjekat odo)
        {
            komanda.CommandText = $"Select * from {odo.VratiImeTabele()}";
            komanda.CommandType = System.Data.CommandType.Text;
            OleDbDataReader citac = komanda.ExecuteReader();
            List <IOpstiDomenskiObjekat> lista = odo.VratiListu(citac);

            citac.Close();
            return(lista);
        }
Esempio n. 3
0
        public List <IOpstiDomenskiObjekat> VratiSve(IOpstiDomenskiObjekat odo)
        {
            List <IOpstiDomenskiObjekat> lista;

            komanda.CommandText = $"SELECT * FROM {odo.VratiImeTabele()}";
            komanda.CommandType = CommandType.Text;
            OleDbDataReader citac = komanda.ExecuteReader();

            lista = odo.VratiListu(citac);
            citac.Close();
            return(lista);
        }
Esempio n. 4
0
        public List <IOpstiDomenskiObjekat> VratiSveObjektePoUslovu(IOpstiDomenskiObjekat odo)
        {
            try
            {
                string upit = "SELECT * FROM " + odo.VratiImeTabele() + " WHERE " + odo.VratiUslovZaObjekat();
                komanda = new OleDbCommand(upit, konekcija, transakcija);
                OleDbDataReader citac = komanda.ExecuteReader();

                return(odo.VratiListu(citac));
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }