Esempio n. 1
0
        private async void Search(string searchString, int page, int size, string sort, int sequence, string priceGt, string priceLte)
        {
            IndicatorIsRunning = true;
            RestSharpService _restSharpService = new RestSharpService();
            ProductListRD    productListRD     = await _restSharpService.FuzzySearch(searchString, sequence, page, size, sort, int.Parse(priceGt), int.Parse(priceLte));

            TotalProductNum = productListRD.result.total;
            ProductNum     += productListRD.result.data.Count;

            List <ProductListItem> tempList = new List <ProductListItem>();

            foreach (var item in productListRD.result.data)
            {
                ProductList.Add(item);
            }

            ChangeButtonText();
            IndicatorIsRunning = false;
        }
Esempio n. 2
0
        private async void Search(string searchString)
        {
            try
            {
                if (!Tools.IsNetConnective())
                {
                    CrossToastPopUp.Current.ShowToastError("无网络连接,请检查网络。", ToastLength.Long);
                    return;
                }

                IndicatorIsRunning = true;
                //int page = 1;
                //int size = 20;
                //string sort = "1";
                //int sequence = 1;
                //int priceGt = -1;
                //int priceLte = -1;
                int gt  = string.IsNullOrEmpty(PriceGt) ? -1 : int.Parse(PriceGt);
                int lte = string.IsNullOrEmpty(PriceLte) ? -1 : int.Parse(PriceLte);

                ProductListRD productListRD = await _restSharpService.FuzzySearch(searchString, Sequence, Page, _Size, Sort, gt, lte);

                TotalProductNum = productListRD.result.total;
                ProductNum     += productListRD.result.data.Count;

                foreach (var item in productListRD.result.data)
                {
                    ProductList.Add(item);
                }

                ChangeButtonText();
                IndicatorIsRunning = false;
            }
            catch (Exception)
            {
                throw;
            }
        }