protected override Collection <Material> Read(SqlDataReader reader) { Collection <Material> materialy = new Collection <Material>(); PredmetTable predmetTable = new PredmetTable(); UzivatelTable uzivatelTable = new UzivatelTable(); while (reader.Read()) { int i = -1; Material material = new Material(); material.MId = reader.GetInt32(++i); material.Typ = reader.GetString(++i); material.Dokument = reader.GetString(++i); material.Datum = reader.GetDateTime(++i); material.Okruh = reader.GetString(++i); material.Overeny = reader.GetInt32(++i); material.Predmet = predmetTable.SelectByID(reader.GetInt32(++i)); material.Uzivatel = uzivatelTable.SelectByID(reader.GetInt32(++i)); materialy.Add(material); } return(materialy); }
protected override Collection <Hodnoceni> Read(SqlDataReader reader) { Collection <Hodnoceni> hodnoceni = new Collection <Hodnoceni>(); UzivatelTable uzivatelTable = new UzivatelTable(); PredmetTable predmetTable = new PredmetTable(); while (reader.Read()) { int i = -1; Hodnoceni h = new Hodnoceni(); h.Ohodnoceni = reader.GetInt32(++i); h.Popis = reader.GetString(++i); h.Datum = reader.GetDateTime(++i); h.Predmet = predmetTable.SelectByID(reader.GetInt32(++i)); h.Uzivatel = uzivatelTable.SelectByID(reader.GetInt32(++i)); hodnoceni.Add(h); } return(hodnoceni); }