Exemplo n.º 1
0
        public List <Accountcycle> query(int lastmonth, int aftermonth)
        {
            AuthClass  authClass  = new AuthClass();
            HttpClient httpClient = AppConfig.GetInstance().crateHttpClient();

            String url = AppConfig.GetInstance().BaseUrl + "/accountcycle?lastmonth=" + lastmonth + "&aftermonth=" + aftermonth;
            HttpResponseMessage response = httpClient.GetAsync(url).Result;
            String result = response.Content.ReadAsStringAsync().Result;

            httpClient.Dispose();

            if (response.StatusCode != System.Net.HttpStatusCode.OK)
            {
                throw new Exception("查询客户信息错误." + response.RequestMessage.ToString());
            }

            List <Accountcycle> accountcycleList = new List <Accountcycle>();

            JArray ja = JArray.Parse(result);

            foreach (var item in ja)
            {
                Accountcycle accountcycle = new Accountcycle(item.Value <JObject>());
                accountcycleList.Add(accountcycle);
            }

            return(accountcycleList);
        }
Exemplo n.º 2
0
        private void button2_Click(object sender, EventArgs e)
        {
            List <Accountcycle> accountcycleList = CommonManager.selectAccountcycle();

            if (accountcycleList != null && accountcycleList.Count > 0)
            {
                this.accountcycle = accountcycleList[0];
                this.accountcyclesnTextBox.Text = this.accountcycle.Name;
            }
        }
Exemplo n.º 3
0
        private void initAccountcycle()
        {
            AccountcycleFactory af = new AccountcycleFactory();
            List <Accountcycle> accountcycleList = af.query(-1, -1);

            if (accountcycleList != null && accountcycleList.Count > 0)
            {
                this.accountcycle = accountcycleList[0];
                this.accountcyclesnTextBox.Text = this.accountcycle.Name;
            }
        }