private async void ValidateResponseDocuments(ResponseDocuments response) { Documents.Clear(); if (response.Success) { Documents.Add(response.Documents.Where(x => x.Code == DocumentType).FirstOrDefault()); DocumentSelected = response.Documents.Where(x => x.Code == DocumentType).FirstOrDefault(); return; } await dialogService.ShowMessage(response.Title, response.Message); await navigationService.Back(); }
public async Task LoadDocuments() { dialogService.ShowProgress(); ResponseDocuments response = await apiService.GetDocuments(new RequestDocument()); dialogService.HideProgress(); Documents.Clear(); if (response.Success && response.Documents != null) { foreach (Document item in response.Documents) { Documents.Add(item); } return; } await dialogService.ShowMessage(response.Message, response.Title); }
public async Task LoadPersonalData() { ErrorEmail = ErrorCellPhone = string.Empty; dialogService.ShowProgress(); RequestAffiliate request = new RequestAffiliate(); ResponseAffiliate response = await apiService.GetAffiliate(request); if (await ValidateResponseAffiliate(response)) { RequestDocument requestDocument = new RequestDocument(); ResponseDocuments responseDocuments = await apiService.GetDocuments(requestDocument); ValidateResponseDocuments(responseDocuments); dialogService.HideProgress(); } else { dialogService.HideProgress(); await navigationService.Back(); } }