public static ProfSummary load(string nickname) { var connectionString = ConfigurationManager.ConnectionStrings["dbConnString"].ConnectionString; var connection = new SqlConnection(connectionString); connection.Open(); var query = @" select AkademischerTitel, Nachname from Professoren join Benutzer on Professoren.Nickname = Benutzer.Nickname where Professoren.Nickname = @nickname"; var command = new SqlCommand(query, connection); command.Parameters.AddWithValue("@nickname", nickname); var reader = command.ExecuteReader(); reader.Read(); var result = new ProfSummary { name = reader["Nachname"].ToString(), titel = Praktikum_MVC.PrakHelpers.profTitelHelper(reader["AkademischerTitel"].ToString()), dokumente = Dokument.getDokumentByUser(nickname), foren = Forum.getForenByUser(nickname), module = Modul.getByUser(nickname) }; return(result); }
public static ProfSummary load(string nickname) { var connectionString = ConfigurationManager.ConnectionStrings["dbConnString"].ConnectionString; var connection = new SqlConnection(connectionString); connection.Open(); var query = @" select AkademischerTitel, Nachname from Professoren join Benutzer on Professoren.Nickname = Benutzer.Nickname where Professoren.Nickname = @nickname"; var command = new SqlCommand(query, connection); command.Parameters.AddWithValue("@nickname", nickname); var reader = command.ExecuteReader(); reader.Read(); var result = new ProfSummary { name = reader["Nachname"].ToString(), titel = Praktikum_MVC.PrakHelpers.profTitelHelper(reader["AkademischerTitel"].ToString()), dokumente = Dokument.getDokumentByUser(nickname), foren = Forum.getForenByUser(nickname), module = Modul.getByUser(nickname) }; return result; }