private void api_processpersoncount(object sender, UploadDataCompletedEventArgs e) { if (!e.Cancelled && e.Error == null) { mainForm.PersonListReset(false); string json = Encoding.Default.GetString(e.Result); mainForm.Debug("response", json); ResponsePersons.PersonResponse Result = JsonConvert.DeserializeObject <ResponsePersons.PersonResponse>(json); personQuery.size = Result.count; personQuery.linkingStrategy = "portalLinkingStrategy"; postData = JsonConvert.SerializeObject(personQuery, Newtonsoft.Json.Formatting.None, new JsonSerializerSettings { NullValueHandling = NullValueHandling.Ignore, DefaultValueHandling = DefaultValueHandling.Ignore }); String RequestURL = PersonsRequestURL; DoWebRequest(RequestURL, "api_processpersons", "Post", "Persons", "json"); } else { mainForm.ShowMessage(e.Error.ToString()); mainForm.Debug("response", e.Error.ToString()); } }
private void api_processpersons(object sender, UploadDataCompletedEventArgs e) { if (!e.Cancelled && e.Error == null) { string json = Encoding.Default.GetString(e.Result); mainForm.Debug("response", json); ResponsePersons.PersonResponse Result = JsonConvert.DeserializeObject <ResponsePersons.PersonResponse>(json); personQuery.size = Result.count; foreach (ResponsePersons.Item Person in Result.items) { mainForm.AddPersonList(Person.name.firstName + " " + Person.name.lastName, Person.uuid); } mainForm.PersonListReset(true); } else { mainForm.ShowMessage(e.Error.ToString()); mainForm.Debug("response", e.Error.ToString()); } mainForm.ProgressBar(false); }