public Collection <IPisnickaGateway> Read(SqlDataReader reader) { Collection <IPisnickaGateway> Pisnicky = new Collection <IPisnickaGateway>(); while (reader.Read()) { IPisnickaGateway p = new PisnickaGateway(); IZanrGateway z = new ZanrGateway(); IAlbumGateway a = new AlbumGateway(); IInterpretGateway i = new InterpretGateway(); p.Nazev = reader.GetString(0); p.Delka = reader.GetString(1); p.Hodnoceni = reader.GetFloat(2); i.UmeleckeJmeno = reader.GetString(3); a.Nazev = reader.GetString(4); z.Nazev = reader.GetString(5); p.Id = reader.GetInt32(6); p.Zanr = z; p.Album = a; p.Interpret = i; Pisnicky.Add(p); } return(Pisnicky); }
private Collection <IInterpretGateway> Read(SqlDataReader reader) { Collection <IInterpretGateway> Interpreti = new Collection <IInterpretGateway>(); while (reader.Read()) { IInterpretGateway Interpret = new InterpretGateway(); Interpret.Id = reader.GetInt32(0); Interpret.UmeleckeJmeno = reader.GetString(1); Interpreti.Add(Interpret); } return(Interpreti); }
private Collection <IInterpretGateway> Read2(SqlDataReader reader2) { Collection <IInterpretGateway> Interpreti = new Collection <IInterpretGateway>(); while (reader2.Read()) { IInterpretGateway interpret = new InterpretGateway { UmeleckeJmeno = reader2.GetString(0), Jmeno = reader2.GetString(1), Zeme = reader2.GetString(2), DatumNarozeni = reader2.GetDateTime(3) }; Interpreti.Add(interpret); } return(Interpreti); }
public Collection <IPisnickaGateway> ReadFiltrAlbum(SqlDataReader reader) { Collection <IPisnickaGateway> Pisnicky = new Collection <IPisnickaGateway>(); while (reader.Read()) { IPisnickaGateway p = new PisnickaGateway(); IAlbumGateway a = new AlbumGateway(); IInterpretGateway i = new InterpretGateway(); p.Id = reader.GetInt32(0); p.Nazev = reader.GetString(1); p.Delka = reader.GetString(2); i.UmeleckeJmeno = reader.GetString(3); a.Nazev = reader.GetString(4); a.Id = reader.GetInt32(5); p.Album = a; p.Interpret = i; Pisnicky.Add(p); } return(Pisnicky); }