Example #1
0
        public async void Search()
        {
            if (string.IsNullOrWhiteSpace(SearchKey))
            {
                App.ShowNotification("请输入搜索关键字");
                return;
            }
            //标识搜索状态
            _pageIndex = 1;
            try
            {
                var newlist = await _ailianBTService.SerachResList(SearchKey, _pageIndex ++);

                AilianRes.Clear();
                if (newlist != null && newlist.Count > 0)
                {
                    foreach (var item in newlist)
                    {
                        AilianRes.Add(item);
                    }
                }
            }
            catch (Exceptions.NetworkException networkexception)
            {
                App.ShowNotification(networkexception.Message);
            }
            catch (Exceptions.ResolveException resolveException)
            {
                AilianRes.Clear();
                App.ShowNotification(resolveException.Message);
            }
        }
Example #2
0
        public async Task Refresh()
        {
            _pageIndex = 1;
            IList <AilianResModel> newlist = null;

            try
            {
                newlist = await _ailianBTService.SerachResList(SearchKey, _pageIndex ++);

                if (newlist != null && newlist.Count > 0)
                {
                    AilianRes.Clear();
                    foreach (var item in newlist)
                    {
                        AilianRes.Add(item);
                    }
                }

                AilianRes.Clear();
                if (newlist != null)
                {
                    foreach (var item in newlist)
                    {
                        AilianRes.Add(item);
                    }
                }
            }
            catch (Exceptions.NetworkException networkexception)
            {
                App.ShowNotification(networkexception.Message);
            }
            catch (Exceptions.ResolveException resolveException)
            {
                AilianRes.Clear();
                App.ShowNotification(resolveException.Message);
            }
        }