Exemplo n.º 1
0
        private async void InitCustomerListAsync()
        {
            try
            {
                if (!Tools.IsNetConnective())
                {
                    CrossToastPopUp.Current.ShowToastError("无网络连接,请检查网络。", ToastLength.Long);
                    return;
                }

                //RestSharpService _restSharpService = new RestSharpService();
                CustomerListRD customerListRD = await RestSharpService.GetCustomers(GlobalVariables.LoggedUser.phone.ToString());

                if (customerListRD.result.Count > 0)
                {
                    List <UserInfo> temp = new List <UserInfo>();
                    foreach (var item in customerListRD.result)
                    {
                        temp.Add(item);
                    }
                    CustomerList = temp;

                    Visible = false;
                }
                else
                {
                    Visible = true;
                }
            }
            catch (Exception)
            {
                throw;
            }
        }
Exemplo n.º 2
0
        /// <summary>
        /// 获取客户列表
        /// </summary>
        /// <param name="tel"></param>
        /// <returns></returns>
        public async Task <CustomerListRD> GetCustomers(string tel)
        {
            string url = "/member/getClient?phone=" + tel;

            CustomerListRD customerListRD = await RestSharpHelper <CustomerListRD> .GetAsync(url);

            return(customerListRD);
        }
Exemplo n.º 3
0
        /// <summary>
        /// 获取客户列表
        /// </summary>
        /// <param name="tel"></param>
        /// <returns></returns>
        public static async Task <CustomerListRD> GetCustomers(string tel)
        {
            try
            {
                string url = "/member/getClient?phone=" + tel;

                CustomerListRD customerListRD = await RestSharpHelper <CustomerListRD> .GetAsync(url);

                return(customerListRD);
            }
            catch (ApplicationException ex)
            {
                throw ex;
            }
        }