Exemple #1
0
 public ActionResult QuickSearchParser(SearchInput input)
 {
     input.NameUrl = input.Name;
     // Set to null to make it not appear in URL
     input.Name = null;
     return RedirectToActionPermanent("Result", "Search", input);
 }
Exemple #2
0
        public static EntityCollection SearchThongTinHoSo(SearchInput input)
        {
            EntityCollection entityCollection = new EntityCollection(new ThongTinHoSoEntityFactory());

            using (DataAccessAdapterBase dataAccessAdapterBase = new DataAccessAdapter(ManageBase.ConnectionString))
            {
                RelationPredicateBucket relationPredicateBucket = new RelationPredicateBucket();
                relationPredicateBucket.PredicateExpression.Add(ThongTinHoSoFields.XaId == GlobalVariable.XaId);
                relationPredicateBucket.PredicateExpression.Add(ThongTinHoSoFields.HoSoMoiNhat == true);
                bool flag = !string.IsNullOrEmpty(input.SoThua);
                if (flag)
                {
                    relationPredicateBucket.PredicateExpression.Add(new FieldFullTextSearchPredicate(ThongTinHoSoFields.SoThuTuThua, null, FullTextSearchOperator.Contains, input.SoThua));
                }
                bool flag2 = !string.IsNullOrEmpty(input.SoTo);
                if (flag2)
                {
                    relationPredicateBucket.PredicateExpression.Add(new FieldFullTextSearchPredicate(ThongTinHoSoFields.SoHieuToBanDo, null, FullTextSearchOperator.Contains, input.SoTo));
                }
                bool flag3 = !string.IsNullOrEmpty(input.SoBienNhan);
                if (flag3)
                {
                    relationPredicateBucket.PredicateExpression.Add(new FieldFullTextSearchPredicate(ThongTinHoSoFields.SoBienNhan, null, FullTextSearchOperator.Contains, ManageBase.GetStringFullTextSearch(input.SoBienNhan, false)));
                }
                bool flag4 = !string.IsNullOrEmpty(input.SoBanVe);
                if (flag4)
                {
                    relationPredicateBucket.PredicateExpression.Add(new FieldFullTextSearchPredicate(ThongTinHoSoFields.SoBanVe, null, FullTextSearchOperator.Contains, ManageBase.GetStringFullTextSearch(input.SoBanVe, false)));
                }
                bool flag5 = !string.IsNullOrEmpty(input.SoSerial);
                if (flag5)
                {
                    relationPredicateBucket.PredicateExpression.Add(new FieldFullTextSearchPredicate(ThongTinHoSoFields.SoHieuGiayChungNhan, null, FullTextSearchOperator.Contains, ManageBase.GetStringFullTextSearch(input.SoSerial, false)));
                }
                bool laNguoiNopHoSo = input.LaNguoiNopHoSo;
                if (laNguoiNopHoSo)
                {
                    bool flag6 = !string.IsNullOrEmpty(input.HoTen);
                    if (flag6)
                    {
                        relationPredicateBucket.PredicateExpression.Add(new FieldFullTextSearchPredicate(ThongTinHoSoFields.NguoiNopHoSo, null, FullTextSearchOperator.Contains, ManageBase.GetStringFullTextSearch(input.HoTen, false)));
                    }
                    bool flag7 = !string.IsNullOrEmpty(input.SoGiayTo);
                    if (flag7)
                    {
                        relationPredicateBucket.PredicateExpression.Add(new FieldFullTextSearchPredicate(ThongTinHoSoFields.SoGiayToNguoiNop, null, FullTextSearchOperator.Contains, ManageBase.GetStringFullTextSearch(input.SoGiayTo, false)));
                    }
                }
                else
                {
                    bool flag8 = !string.IsNullOrEmpty(input.HoTen);
                    if (flag8)
                    {
                        relationPredicateBucket.PredicateExpression.Add(new FieldFullTextSearchPredicate(ThongTinHoSoFields.HoTen, null, FullTextSearchOperator.Contains, ManageBase.GetStringFullTextSearch(input.HoTen, false)));
                    }
                    bool flag9 = !string.IsNullOrEmpty(input.SoGiayTo);
                    if (flag9)
                    {
                        relationPredicateBucket.PredicateExpression.Add(new FieldFullTextSearchPredicate(ThongTinHoSoFields.SoGiayTo, null, FullTextSearchOperator.Contains, ManageBase.GetStringFullTextSearch(input.SoGiayTo, false)));
                    }
                }
                dataAccessAdapterBase.FetchEntityCollection(entityCollection, relationPredicateBucket);
            }
            return(entityCollection);
        }
Exemple #3
0
 public IActionResult OnPost()
 {
     return(RedirectToPage(typeof(IndexModel).Page(), SearchInput.RouteDictionary()));
 }
 public void ClickOnSearchInput()
 {
     SearchInput.Click();
 }
Exemple #5
0
 public void SearchInputFocus(FocusState state)
 {
     SearchInput.Focus(state);
 }
Exemple #6
0
 public TestsModel(UserManager <ApplicationUser> userManager, TestRepository testRepository)
 {
     this.InputSearch    = new SearchInput();
     this.userManager    = userManager;
     this.testRepository = testRepository;
 }
Exemple #7
0
 public MainPage InputSearch(Search search)
 {
     SearchInput.Clear();
     SearchInput.SendKeys(search.SearchText);
     return(new MainPage(driver));
 }
 public void SearchByText(string text)
 {
     SearchInput.Click();
     SearchInput.SendKeys(text);
     SearchInput.SendKeys(Keys.Enter);
 }
 public void SearchGoogle(string searchCriteria)
 {
     SearchInput.SendKeys(searchCriteria);
     Logo.Click();
     SeleniumResult.Click();
 }
 public Task <SearchOutput> GetSuggestionsAsync(SearchInput input)
 {
     return(UserRepoSearch.GetSuggestionsAsync(StateManager, input));
 }
Exemple #11
0
    private async Task <IEnumerable <SearchResultItem> > SearchCore(string searchText)
    {
        var source = await _bkRepo.GetAllAsync();

        var tags = await _tagRepo.GetAllAsync();

        if (string.IsNullOrWhiteSpace(searchText))
        {
            var latest = source
                         .Where(x => x.LastClickTime > 0 && x.ClickedCount > 0)
                         .OrderByDescending(x => x.LastClickTime)
                         .ThenByDescending(x => x.ClickedCount)
                         .Select(x => x.Id)
                         .Take(LatestCount)
                         .ToList();
            return(source
                   .Select(x =>
            {
                var r = new SearchResultItem(x)
                {
                    LastClickTime = x.LastClickTime
                };
                r.AddScore(ScoreReason.Const, 10);
                if (latest.FirstOrDefault(a => a == r.Bk.Id) != null)
                {
                    r.AddScore(ScoreReason.Latest, 10 - latest.FindIndex(a => a == r.Bk.Id));
                }
                return r;
            }));
        }

        var input = SearchInput.Parse(searchText);

        _logger.LogInformation(
            "Search text parse result, SourceText: {SearchInput} Keywords: {Keywords}, Tags: {Tags}",
            input.SourceText,
            input.Keywords,
            input.Tags);

        var tagDict   = tags.ToDictionary(x => x.Tag);
        var matchTags = tagDict
                        .Where(tag =>
                               input.Tags.Contains(tag.Key) ||
                               input.Keywords.Any(keyword => StringContains(tag.Key, keyword)))
                        .Select(x => x.Key)
                        .ToHashSet();

        var matchTagAlias = tagDict
                            .Where(tag => input.Keywords.Any(keyword =>
                                                             tag.Value.TagAlias.Values.Any(tagAlias => StringContains(tagAlias.Alias, keyword))))
                            .Select(x => x.Key)
                            .ToHashSet();

        var re = source
                 .Select(MatchBk)
                 .Where(x => x.Matched);

        return(re);

        SearchResultItem MatchBk(Bk item)
        {
            var result = new SearchResultItem(item)
            {
                ClickCount    = item.ClickedCount,
                LastClickTime = item.LastClickTime
            };

            result.AddScore(ScoreReason.Title, input.Keywords.Any(x => StringContains(item.Title, x)));

            result.AddScore(ScoreReason.TitleAlias, item.TitleAlias?.Values != null &&
                            item.TitleAlias.Values.Any(al =>
                                                       input.Keywords.Any(x =>
                                                                          StringContains(al.Alias, x))));

            result.AddScore(ScoreReason.Url, input.Keywords.Any(x => StringContains(item.Url, x)));
            if (item.Tags?.Any() == true)
            {
                result.AddScore(ScoreReason.Tags, item.Tags.Any(matchTags.Contains));
                result.AddScore(ScoreReason.TagAlias, item.Tags.Any(matchTagAlias.Contains));
            }

            if (result.Score > 0)
            {
                result.AddScore(ScoreReason.ClickCount, item.ClickedCount);
            }

            return(result);
        }
 public Task <AutoCompleteOutput> AutoCompleteAsync(SearchInput input)
 {
     return(UserRepoSearch.AutoCompleteAsync(StateManager, input));
 }
Exemple #13
0
 private void SearchInput_GotFocus(object sender, RoutedEventArgs e)
 {
     SearchInput.Select(0, SearchInput.Text.Length);
     SearchInput.Focus();
 }
Exemple #14
0
 public List <SearchOutput> UserSearch(SearchInput input, string c) =>
 //逻辑暂空,这里主要看生成的输入输出
 null;
 private static async Task <Result <SearchOutput> > SearchOverAPI(
     SearchInput input, IGitHubClient gitHubClient)
 {
     return(await gitHubClient.SearchRepositoriesAsync(
                input.AuthToken, input.Query));
 }
 public void FillSearchForm(string message)
 {
     SearchInput.Type(message);
     SearchInput.Submit();
 }
Exemple #17
0
 public OpenSheetView()
 {
     InitializeComponent();
     SearchInput.Focus();
 }
Exemple #18
0
        public async Task <JsonResult> Search(SearchInput input)
        {
            var paged = await _headAppService.Search <HeadDto>(input, new HeadSpecification(input.Keyword));

            return(Json(new { code = 0, count = paged.TotalCount, data = paged.Items }));
        }
Exemple #19
0
        public ActionResult Result(SearchInput input)
        {
            var vm = new SearchResultViewModel { Input = input };
            // Criteria object to pass to repository
            var criteria = new SearchCriteria();

            input.Name = input.NameUrl;
            criteria.TitleSearch = input.NameUrl.ToSearchFriendly();

            // Get sort key
            criteria.OrderBy = GetSortKey(input.Sort);

            if (input.CategoryName == "news")
            {
                // Get paging info
                criteria.PageInfo = new PageInfo(AppConfigs.NewsPageSize, input.Page ?? 1);

                // Search
                var feedback = _newsRepository.SearchNews(criteria);

                if (feedback.Success)
                {
                    vm.News = feedback.News;
                    vm.Total = feedback.TotalNews;
                    vm.HasMore = vm.Total > criteria.PageInfo.PageSize * criteria.PageInfo.PageNo;
                    vm.NotFound = vm.News.Count == 0;
                    vm.OrderBy = criteria.OrderBy;

                    return View(vm);
                }
                SetMessage(feedback.Message, MessageType.Error);
            }
            else if (input.CategoryName == "tips")
            {
                // Get paging info
                criteria.PageInfo = new PageInfo(AppConfigs.TipPageSize, input.Page ?? 1);

                // Search
                var feedback = _tipRepository.SearchTips(criteria);

                if (feedback.Success)
                {
                    vm.Tips = feedback.Tips;
                    vm.Total = feedback.TotalTips;
                    vm.HasMore = vm.Total > criteria.PageInfo.PageSize * criteria.PageInfo.PageNo;
                    vm.NotFound = vm.Tips.Count == 0;
                    vm.OrderBy = criteria.OrderBy;

                    return View(vm);
                }
                SetMessage(feedback.Message, MessageType.Error);
            }
            else if (input.CategoryName == "recipes")
            {
                // Get paging info
                criteria.PageInfo = new PageInfo(AppConfigs.RecipePageSize, input.Page ?? 1);

                // Search
                var feedback = _recipeRepository.SearchRecipes(criteria);

                if (feedback.Success)
                {
                    vm.Recipes = feedback.Recipes;
                    vm.Total = feedback.TotalRecipes;
                    vm.HasMore = vm.Total > criteria.PageInfo.PageSize * criteria.PageInfo.PageNo;
                    vm.NotFound = vm.Recipes.Count == 0;
                    vm.OrderBy = criteria.OrderBy;

                    return View(vm);
                }
                SetMessage(feedback.Message, MessageType.Error);
            }
            else if (input.CategoryName == "all")
            {
                // Get paging info
                criteria.PageInfo = new PageInfo(AppConfigs.AllPageSize, input.Page ?? 1);

                // Search
                var feedback = _allContentRepository.SearchAllContent(criteria);

                if (feedback.Success)
                {
                    vm.All = feedback.All;
                    vm.Total = feedback.Total;
                    vm.HasMore = vm.Total > criteria.PageInfo.PageSize * criteria.PageInfo.PageNo;
                    vm.NotFound = vm.All.Count == 0;
                    vm.OrderBy = criteria.OrderBy;

                    return View(vm);
                }
                SetMessage(feedback.Message, MessageType.Error);
            }

            return RedirectToAction("Index");
        }
Exemple #20
0
 public void EnableSearch(string text)
 {
     SearchInput.SendKeys(text);
     SearchButton.Click();
 }
        public ActionResult List(SearchInput searchInput)
        {
            var products = _productFacade.GetProducts(searchInput.Query, 1, 20);

            return(View(products));
        }
 private void SetupShadows()
 {
     SearchInput.AddShadow(2);
 }
        public frmSales()
        {
            this.Text      = "Sales - New Service";
            this.Size      = new Vector2(875, 630);
            this.MinHeight = 630;
            this.MinWidth  = 875;

            btnClose          = new SimpleButton();
            btnClose.Text     = "Close";
            btnClose.Size     = new Vector2(73, 21);
            btnClose.Location = new Vector2("(100% - 89px)", "(100% - 31px)");

            ButtonPanel = new Control();
            ButtonPanel.Style.backgroundColor = "white";
            ButtonPanel.Bounds = new Vector4(0, 0, "100%", 31);

            btnPrint = new SimpleButton()
            {
                Text = "Print", Enabled = false
            };
            btnPrint.ClassList.remove("control");
            btnPrint.ClassList.add("myob-btn");


            btnSendTo = new SimpleButton()
            {
                Text = "Send To", Enabled = false
            };
            btnSendTo.ClassList.remove("control");
            btnSendTo.ClassList.add("myob-btn");

            btnJournal = new SimpleButton()
            {
                Text = "Journal"
            };
            btnJournal.ClassList.remove("control");
            btnJournal.ClassList.add("myob-btn");

            btnRegister = new SimpleButton()
            {
                Text = "Register"
            };
            btnRegister.ClassList.remove("control");
            btnRegister.ClassList.add("myob-btn");

            ButtonPanel.AppendChildren(btnPrint, btnSendTo, btnJournal, btnRegister);

            StartPosition = FormStartPosition.Center;
            //112, 20
            comboSalesLookup = new EnumSearchInput(typeof(SalesType))
            {
                Bounds = new Vector4(92, 44, 112, 20)
            };
            comboSalesLookup.SetValue((long)SalesType.Invoice, nameof(SalesType.Invoice));
            this.Body.AppendChild(Label("Sales Type:", 28, 47));

            // 822, 474
            DataPanel = new Control()
            {
                Bounds = new Vector4(16, 73, "(100% - 32px)", "(100% - 119px)")
            };
            DataPanel.ClassList.add("form-base");
            DataPanel.Style.borderRadius    = "3px";
            DataPanel.Style.backgroundColor = "white";
            DataPanel.Style.borderColor     = "rgb(192, 192, 192)";

            InnerDataPanel = new Control();
            InnerDataPanel.Style.background   = "linear-gradient(to bottom, #edf7ff 0%,#cee7fc 51%,#b8dbf9 100%)";
            InnerDataPanel.Style.borderRadius = "3px";
            InnerDataPanel.Bounds             = new Vector4(3, 3, "(100% - 8px)", "(100% - 8px)");
            InnerDataPanel.Style.border       = "solid 1px rgb(192, 192, 192)";

            comboSalesLookup.OnTextChanged = (ti) => {
                if ((ti.Text + "").Trim().ToLower() == nameof(SalesType.Quote).ToLower())
                {
                    InnerDataPanel.Style.background = "linear-gradient(to bottom, #fedee1 0%,#faccd1 52%,#f6b7bf 100%)";
                }
                else
                {
                    InnerDataPanel.Style.background = "linear-gradient(to bottom, #edf7ff 0%,#cee7fc 51%,#b8dbf9 100%)";
                }
            };

            comboCustomerLookup          = new SearchInput();
            comboCustomerLookup.Location = new Vector2(167, 9);
            comboCustomerLookup.Size     = new Vector2(250, 21);

            InternalPanel = new Control();
            InternalPanel.Style.borderRadius    = "1px";
            InternalPanel.Style.border          = "solid 1px rgb(192, 192, 192)";
            InternalPanel.Style.backgroundColor = "white";
            InternalPanel.Bounds = new Vector4(19, 37, "(100% - 40px)", "(100% - 190px)");


            RefPanel = new Control();
            RefPanel.Style.borderRadius    = "1px";
            RefPanel.Style.border          = "solid 1px rgb(192, 192, 192)";
            RefPanel.Style.backgroundColor = "rgb(249, 242, 245)";
            RefPanel.Bounds = new Vector4(19, "(100% - 135px)", "(100% - 40px)", 96);

            InnerDataPanel.AppendChildren(comboCustomerLookup, InternalPanel, RefPanel);

            DataPanel.AppendChild(InnerDataPanel);

            this.AppendChildren(ButtonPanel, comboSalesLookup, DataPanel, btnClose);
        }
Exemple #24
0
 public UserSearchVM()
 {
     Input = new SearchInput();
 }
 public void ClearSearchInput()
 {
     SearchInput.Clear();
 }
Exemple #26
0
        public async Task <JsonResult> Search(SearchInput input)
        {
            var paged = await _roleAppService.Search(input);

            return(Json(new { code = 0, count = paged.TotalCount, data = paged.Items }));
        }
 public void SendKeysToSearchInput(string data)
 {
     SearchInput.SendKeys(data);
 }
Exemple #28
0
 public bool ShouldBeWaitingOnFirstStop
     (SearchInput search, StopConnection firstConnection)
 {
     return(search.StartFullDate != firstConnection.StartDateTime);
 }
        private void FilterDataGrid()
        {
            ICollectionView DeviceTypesView = CollectionViewSource.GetDefaultView(Devices);

            if (SelectedDeviceTypeName == null || SelectedDeviceTypeName == "Alle device-types")
            {
                var searchFilter = new Predicate <object>(item => ((Device)item).Name.ToLower().Contains(SearchInput.ToLower()));
                DeviceTypesView.Filter = searchFilter;
            }
            else
            {
                var searchFilter = new Predicate <object>(item => ((Device)item).Name.ToLower().Contains(SearchInput.ToLower()) && ((Device)item).DeviceTypeName == SelectedDeviceTypeName);
                DeviceTypesView.Filter = searchFilter;
            }
        }
        public JsonResult Search(SearchInput si)
        {
            // e.g. api/instructions/search?Addr1=test%20street&PCode=SW1

            try
            {
                var instructions = _instructionsRepository.GetAll();

                if (!string.IsNullOrWhiteSpace(si.Title))
                    instructions = instructions.Where(i => i.InstructionTitle.ToLower().Contains(si.Title.ToLower()));

                if (!string.IsNullOrWhiteSpace(si.Addr1))
                    instructions = instructions.Where(i => i.Address1.ToLower().Contains(si.Addr1.ToLower()));

                if (!string.IsNullOrWhiteSpace(si.Addr2))
                    instructions = instructions.Where(i => i.Address2.ToLower().Contains(si.Addr2.ToLower()));

                if (!string.IsNullOrWhiteSpace(si.Addr3))
                    instructions = instructions.Where(i => i.Address3.ToLower().Contains(si.Addr3.ToLower()));

                if (!string.IsNullOrWhiteSpace(si.Town))
                    instructions = instructions.Where(i => i.Town.ToLower().Contains(si.Town.ToLower()));

                if (!string.IsNullOrWhiteSpace(si.County))
                    instructions = instructions.Where(i => i.County.ToLower().Contains(si.County.ToLower()));

                if (!string.IsNullOrWhiteSpace(si.PCode))
                    instructions = instructions.Where(i => i.Postcode.ToLower().Contains(si.PCode.ToLower()));

                return Json(Mapper.Map<IEnumerable<InstructionViewModel>>(instructions));
            }
            catch(Exception ex)
            {
                Response.StatusCode = (int)HttpStatusCode.BadRequest;
                return Json(new { Message = $"An error occurred - {ex.Message}" });
            }
        }
Exemple #31
0
        public static BaseInput ParseInput(string[] args)
        {
            // Use NDesk to parse out args.
            options = new OptionSet()
            {
                { "l", "List Processes", x => list = true },
                { "v", "Verbose On", x => { MemTool.Core.Verbose.OutputStream = System.Console.Out; verbose = true; } },
                { "sm", "Search Memory", x => searchmem = true },
                { "rm", "Read Memory", x => readmem = true },
                { "wm", "Write Memory", x => writemem = true },

                { "addr=", "Address to Read/Write", x => address = x },
                { "len=", "Length to Read", x => length = x },
                { "pid=", "Process ID", x => procid = x },
                { "enc=", "Encoding. (uni, def)", x => enc = x },

                { "string", "Use a String for Write/Search", x => usestring = true },
                { "int", "Use an Int for Write/Search", x => useint = true },
                { "byte", "Use a Byte for Write/Search", x => usebyte = true },
                { "d=", "Data to Write/Search", x => usedata = x },

                { "h", "Show Help", x => showhelp = true }
            };
            options.Parse(args);

            // Build our input.
            var encoding = System.Text.Encoding.Default;

            if (enc == "uni")
            {
                encoding = System.Text.Encoding.Unicode;
            }
            byte[] data;
            if (useint)
            {
                data = IntToBytes(int.Parse(usedata));
            }
            else if (usebyte)
            {
                data = ConvertHexStringToByteArray(usedata);
            }
            else
            {
                data = encoding.GetBytes(usedata);
            }

            // Type of input.
            BaseInput input = null;

            if (list)
            {
                input = new ListInput()
                {
                    ProcessNameSearch = usedata
                }
            }
            ;
            else if (searchmem)
            {
                input = new SearchInput()
                {
                    Data      = data,
                    Encoding  = encoding,
                    Verbose   = verbose,
                    ProcessId = procid
                }
            }
            ;
            else if (readmem)
            {
                input = new ReadInput()
                {
                    Address   = address,
                    Encoding  = encoding,
                    Length    = length,
                    ProcessId = procid
                }
            }
            ;
            else if (writemem)
            {
                input = new WriteInput()
                {
                    Address   = address,
                    Data      = data,
                    ProcessId = procid
                }
            }
            ;

            if (input == null || !input.Validate())
            {
                input = new HelpInput();
            }

            return(input);
        }
 public void Search(string term)
 {
     SearchInput.SendKeys(term);
     SearchInput.SendKeys(Keys.Enter);
 }
Exemple #33
0
 /// <summary>
 /// Executes an async search in the db, and mails the results.
 /// A boolean responce of the request validity is imidiatly returned
 /// </summary>
 /// <param name="searchParams">The search criteria, apikey and recipient email</param>
 /// <returns></returns>
 public bool Search(SearchInput searchParams)
 {
     //var searchProxy = new SearchImplementation();
     //return proxy.Search(searchParams);
     return false;
 }
 public void PutKeywordToSearchInput(string keyword)
 {
     SearchInput.SendKeys(keyword);
 }