Beispiel #1
0
        public static Bolnica DohvatiBolnicu(int id)
        {
            Bolnica bolnica = null;
            string  upit    = "SELECT * FROM bolnica WHERE id = '" + id + "' LIMIT 1";

            NpgsqlDataReader dr = Klase.Baza.Instanca.DohvatiDataReader(upit);

            while (dr.Read())
            {
                bolnica = new Bolnica(dr);
            }

            dr.Close();
            return(bolnica);
        }
Beispiel #2
0
        public static List <Bolnica> DohvatiBolnice()
        {
            List <Bolnica> bolnice = new List <Bolnica>();
            string         upit    = "SELECT * FROM bolnica";

            NpgsqlDataReader dr = Baza.Instanca.DohvatiDataReader(upit);

            while (dr.Read())
            {
                Bolnica b = new Bolnica(dr);
                bolnice.Add(b);
            }

            dr.Close();
            return(bolnice);
        }