/// <summary> /// /// </summary> /// <param name="db"></param> /// <param name="searchterm"></param> /// <param name="quarter"></param> /// <returns></returns> private IList<SearchResult> GetSearchResults(ClassScheduleDb db, string searchterm, string quarter) { SqlParameter[] parms = { new SqlParameter("SearchWord", searchterm), new SqlParameter("YearQuarterID", YearQuarter.ToYearQuarterID(quarter)) }; using (_profiler.Step("Executing search stored procedure")) { return db.ExecuteStoreQuery<SearchResult>("usp_ClassSearch @SearchWord, @YearQuarterID", parms).ToList(); } }
/// <summary> /// /// </summary> /// <param name="db"></param> /// <param name="searchterm"></param> /// <param name="yrq"></param> /// <returns></returns> private SearchResultNoSectionModel GetNoSectionSearchResults(ClassScheduleDb db, string searchterm, YearQuarter yrq) { SqlParameter[] parms = { new SqlParameter("SearchWord", searchterm), new SqlParameter("YearQuarterID", yrq.ID) }; SearchResultNoSectionModel model = new SearchResultNoSectionModel {SearchedYearQuarter = yrq}; using (_profiler.Step("Executing 'other classes' stored procedure")) { model.NoSectionSearchResults = db.ExecuteStoreQuery<SearchResultNoSection>("usp_CourseSearch @SearchWord, @YearQuarterID", parms).ToList(); } return model; }