internal static List <Modul> getModulByUser(string nickname) { var result = new List <Modul>(); var entry = new SqlEntry(); var reader = entry.getReader(query + nickname + query2); while (reader.Read()) { var modul = new Modul { description = reader["Bezeichnung"].ToString() }; result.Add(modul); } return(result); }
public static List <Dokument> getDokumentByUser(string nickname) { var result = new List <Dokument>(); var entry = new SqlEntry(); var reader = entry.getReader(query + nickname + "'"); while (reader.Read()) { var dokument = new Dokument { Bereitstellung = (DateTime)reader["Bereitstellungsdatum"], Titel = reader["Titel"].ToString() }; result.Add(dokument); } return(result); }
public static List <ForumBeitrag> getBeitragByUser(string nickname) { var result = new List <ForumBeitrag>(); var entry = new SqlEntry(); var reader = entry.getReader(query + nickname + query2); while (reader.Read()) { var forumBeitrag = new ForumBeitrag { description = reader["Bezeichnung"].ToString(), message = reader["Mitteilung"].ToString(), changedAt = (DateTime)reader["Änderungsdatum"] }; result.Add(forumBeitrag); } return(result); }
public static ProfSummary Load(string nickname) { var entry = new SqlEntry(); var reader = entry.getReader(queryString + nickname + "'"); reader.Read(); var name = reader["AkademischerTitel"].ToString() + " " + reader["Nachname"].ToString(); var result = new ProfSummary { Nickname = nickname, ProfName = name, Beiträge = ForumBeitrag.getBeitragByUser(nickname), Dokumente = Dokument.getDokumentByUser(nickname), Module = Modul.getModulByUser(nickname) //... }; return(result); }
public List <Benutzer> getBenutzer() { try { //Connect to DataBase var entry = new SqlEntry(); var reader = entry.getReader(getAllUsersQueryString); var benutzerListe = new List <Benutzer>(); //Read results and store it as a list of Moduls while (reader.Read()) { var email = reader["Nickname"].ToString(); benutzerListe.Add(new Benutzer(reader["Nickname"].ToString(), reader["Vorname"].ToString(), reader["Nachname"].ToString(), reader["Passwort"].ToString(), reader["Email"].ToString())); } return(benutzerListe); } catch (SqlException e) { throw; } }
public List <Modul> getModul() { try { //Connect to DataBase var entry = new SqlEntry(); var reader = entry.getReader(queryString); var moduleListe = new List <Modul>(); //Read results and store it as a list of Moduls while (reader.Read()) { var guarantor = reader["Nickname"].ToString(); var profName = reader["AkademischerTitel"].ToString() + " " + reader["Nachname"]; moduleListe.Add(new Modul((int)reader["FachNummer"], reader["Bezeichnung"].ToString(), guarantor, profName)); } return(moduleListe); } catch (SqlException e) { throw; } }