예제 #1
0
 public PartialViewResult GetAutocompleteResults(string query)
 {
     dynamic data = AutocompleteAlgorithms.ParseQuery(query);
     List<AutocompleteInfo> tests = new TestsRepository().GetAutocompleteItems(data.space, data.test);
     List<AutocompleteInfo> spaces = new SpacesRepository().GetAutocompleteItems(data.space, data.test);
     return PartialView(spaces.Union(tests).ToList());
 }
예제 #2
0
파일: ViewHelper.cs 프로젝트: zaq007/KPaTS
 public static List<SelectListItem> GetSpacesList()
 {
     SpacesRepository repository = new SpacesRepository();
     var list = repository.GetSpaces().Select(x => new SelectListItem()
     {
         Text = x.Shortcut,
         Value = x.Id.ToString(),
         Selected = false
     }).ToList();
     list.Insert(0, new SelectListItem()
     {
         Text = "Спэйс",
         Value = "0",
         Selected = true
     });
     return list;
 }