//5.5 public static Collection <Geodet> Select_geodet(Database pDb = null) { Database db; if (pDb == null) { db = new Database(); db.Connect(); } else { db = pDb; } SqlCommand command = db.CreateCommand(SQL_GEODET); SqlDataReader reader = db.Select(command); Collection <Geodet> Geodeti = ShowGeodet.Read_geo(reader); reader.Close(); if (pDb == null) { db.Close(); } return(Geodeti); }
public static Zakazka Read_one(SqlDataReader reader) { Zakazka zakazka = new Zakazka(); while (reader.Read()) { int i = -1; zakazka.Idzak = reader.GetInt32(++i); zakazka.Datum = reader.GetDateTime(++i); zakazka.Objednavatel_idobj = ShowObjednavatel.Detail_objednavatele(reader.GetInt32(++i)); zakazka.Lokalita_idlok = ShowLokalita.Select(reader.GetInt32(++i)); zakazka.Typ_zakazky_idtyp = ShowTypZakazek.Detail_typu_zakazky(reader.GetInt32(++i)); zakazka.Cena = reader.GetInt32(++i); zakazka.Casova_narocnost = reader.GetInt32(++i); zakazka.Geodet_idgeo = ShowGeodet.Detail_geodeta(reader.GetInt32(++i)); zakazka.Stav = reader.GetString(++i); } return(zakazka); }