internal async void GetData() { ThisDependent = await ServiceCalls.GetDependent(Id); People = await ServiceCalls.GetPeople(); if (Operation == CrudOperation.Add) { ThisDependent.PolicyHolderId = PolicyHolderId; } personBindingSource.DataSource = People; dependentBindingSource.DataSource = ThisDependent; }
private async Task AddNewPersonToList(object personForm) { if (personForm == null || personForm.GetType() != typeof(PeopleForm) || ((PeopleForm)personForm).NewPerson == null) { return; } People = await ServiceCalls.GetPeople(); var newPerson = ((PeopleForm)personForm).NewPerson; //People.Add(newPerson); ThisPolicyHolder.PersonId = newPerson.Id; personBindingSource.DataSource = null; personBindingSource.DataSource = People; }
internal async void GetData() { ThisPolicyHolder = await ServiceCalls.GetPolicyHolder(Id); People = await ServiceCalls.GetPeople(); Policies = await ServiceCalls.GetPolicies(); Dependents = ThisPolicyHolder.Dependents; personBindingSource.DataSource = People; policyBindingSource.DataSource = Policies; policyHolderBindingSource.DataSource = ThisPolicyHolder; dependentBindingSource.DataSource = Dependents; }