public IOpstiDomenskiObjekat VratiPrvog(IOpstiDomenskiObjekat odo) { IOpstiDomenskiObjekat objekat; komanda.CommandText = $"SELECT * FROM {odo.VratiImeTabele()} WHERE {odo.VratiKljucIUslov()}"; komanda.CommandType = CommandType.Text; OleDbDataReader citac = komanda.ExecuteReader(); objekat = odo.VratiObjekat(citac); citac.Close(); return(objekat); }
public IOpstiDomenskiObjekat VratiObjekatPoUslovu(IOpstiDomenskiObjekat odo) { try { string upit = "SELECT * FROM " + odo.VratiImeTabele() + " WHERE " + odo.VratiUslovZaObjekat(); komanda = new OleDbCommand(upit, konekcija, transakcija); OleDbDataReader citac = komanda.ExecuteReader(); return(odo.VratiObjekat(citac)); } catch (Exception ex) { throw ex; } }