public static QuestionGroup GetByName(string name) { using (SqlConnection conn = UtilityDb.GetConnectionESS()) { string sql = "SELECT * FROM ASM_QuestionGroups WHERE Name='" + name + "'"; SqlDataReader dr = UtilityDb.GetDataReader(sql, conn); while (dr.Read()) { QuestionGroup group = new QuestionGroup(); group.LoadFromReader(dr); return group; } } return null; }
internal void ShowQuestions(QuestionGroup group, int maxRating, bool showTitle) { if (showTitle) lblTitle.Text = group.DisplayName; lblTitle.Visible = showTitle; MaxRating = maxRating; gvQuestions.DataSource = group.Questions; Questions = group.Questions; HideRatingColumn = true; gvQuestions.DataBind(); if (HideRatingColumn) gvQuestions.Columns[ColumnRatings].Visible = false; }