Esempio n. 1
0
        private async Task<string> GetCostCentreApplicationId(string costCentreId, HttpClient client)
        {
            var httpParams = new HttpParams();
            httpParams.Add("costCentreId", costCentreId);
            httpParams.Add("applicationDescription", "Android_Application");

            var response = await client.GetAsync(COST_CENTRE_APPLICATION_ID_ENDPOINT + httpParams);
            var content = response.Content;

            var text = await content.ReadAsStringAsync();

            return JsonConvert.DeserializeObject<CostCentreApplicationIdResult>(text).CostCentreApplicationId;
        }
Esempio n. 2
0
        private async Task<string> GetCostCentreId(string username, string password, HttpClient client)
        {
            var httpParams = new HttpParams();
            httpParams.Add("Username", username);
            httpParams.Add("Password", password);
            httpParams.Add("usertype", "DistributorSalesman");

            var response = await client.GetAsync(LOGIN_ENDPOINT + httpParams);
            var content = response.Content;

            var text = await content.ReadAsStringAsync();

            return JsonConvert.DeserializeObject<CostCentreIdResult>(text).CostCentreId;
        }