示例#1
0
        public ActionResult searchUserIndex(UniversalSearch universalSearch)
        {
            ViewBag.Administrative = true;
            ViewHome model = new ViewHome();

            model.Actions = db.Actions.ToList();

            if (universalSearch.actionId != null && universalSearch.actionId != 0)
            {
                model.Users = db.Users.Where(u => u.Permissions.FirstOrDefault(p => p.ActionId == universalSearch.actionId).ActionId == universalSearch.actionId).ToList();
            }

            model.UniversalSearch = universalSearch;

            return(View(model));
        }
示例#2
0
        private async void Commands_Search(object sender, ExecutedRoutedEventArgs e)
        {
            if (!string.IsNullOrWhiteSpace(this.SearchQuery))
            {
                DisableControls();
                SearchCancelled = false;
                string sq = this.SearchQuery;

                var res = await Task.Run(() => UniversalSearch.Search(sq));

                // this kind of cancellation does not make much sense
                if (SearchCancelled)
                {
                    return;
                }

                this.Items = res;
                EnableControls();
            }
        }