private void GetSubscribers(bool isSearch)
        {
            TokenResultEntity getToken = provide.GetToken();

            if (getToken.Code != 0)
            {
                MessageBox.Show("获取Token失败, 错误信息: " + getToken.ErrMsg);
                return;
            }

            SubscriberEntityResponse getSubscribers = new SubscriberEntityResponse();

            if (isSearch == false)
            {
                getSubscribers = provide.GetAllSubscribers();
            }
            else
            {
                string searchStr = string.Empty;
                searchStr      = textBox1.Text;
                getSubscribers = provide.GetSubscribers(searchStr);
            }
            if (getSubscribers.Code != 0)
            {
                MessageBox.Show("获取认购人信息失败, 错误信息: " + getSubscribers.ErrMsg);
                return;
            }
            else
            {
                List <SubscriberSource> list = new List <SubscriberSource>();
                int i = 0;
                foreach (SubscriberEntityTemp item in getSubscribers.SubscriberList)
                {
                    i++;
                    SubscriberSource obj = new SubscriberSource();
                    obj.No             = i;
                    obj.ID             = item.ID;
                    obj.Name           = item.Name;
                    obj.IdentityNumber = item.IdentityNumber;
                    obj.Telephone      = item.Telephone;
                    obj.Address        = item.Address;
                    obj.ZipCode        = item.ZipCode;
                    obj.MaritalStatus  = item.MaritalStatus;
                    obj.ResidenceArea  = item.ResidenceArea;
                    obj.WorkArea       = item.WorkArea;
                    obj.Operate        = "认购人详情";
                    list.Add(obj);
                }
                dataGridView1.AutoGenerateColumns = true;
                dataGridView1.DataSource          = list;
            }
        }
示例#2
0
        public SubscriberEntityResponse GetAllSubscribers()
        {
            SubscriberEntityResponse result = new SubscriberEntityResponse();

            try
            {
                var request = new GetAllSubscribersReguest
                {
                    PageIndex = 99999,
                    PageSize  = 1
                };

                result = this.Client.InvokeAPI <SubscriberEntityResponse>(request);
            }
            catch (Exception ex)
            {
                result.Code   = 9999;
                result.ErrMsg = ex.Message;
            }

            return(result);
        }
示例#3
0
        public SubscriberEntityResponse GetSubscribers(string searchStr)
        {
            SubscriberEntityResponse result = new SubscriberEntityResponse();

            try
            {
                var request = new GetSubscribersRequest()
                {
                    SearchStr = searchStr,
                    PageIndex = 1,
                    PageSize  = 999999
                };

                result = this.Client.InvokeAPI <SubscriberEntityResponse>(request);
            }
            catch (Exception ex)
            {
                result.Code   = 9999;
                result.ErrMsg = ex.Message;
            }

            return(result);
        }
示例#4
0
        private void GetSubscribers(bool isSearch)
        {
            TokenResultEntity getToken = provide.GetToken();

            if (getToken.Code != 0)
            {
                MessageBox.Show("获取Token失败, 错误信息: " + getToken.ErrMsg);
                return;
            }

            SubscriberEntityResponse getSubscribers = new SubscriberEntityResponse();

            if (isSearch == false)
            {
                getSubscribers = provide.GetAllSubscribers();
            }
            else
            {
                string searchStr = string.Empty;
                getSubscribers = provide.GetSubscribers(searchStr);
            }
            if (getSubscribers.Code != 0)
            {
                MessageBox.Show("获取认购人信息失败, 错误信息: " + getSubscribers.ErrMsg);
                return;
            }
            else
            {
                for (int i = 1; i < getSubscribers.SubscriberList.Count; i++)
                {
                    getSubscribers.SubscriberList[i].No     = i;
                    getSubscribers.SubscriberList[i].Option = "认购人详情";
                }
                dataGridView1.AutoGenerateColumns = true;
                dataGridView1.DataSource          = getSubscribers.SubscriberList;
            }
        }