public async void CallSearchData() { LstEvidClients.Clear(); EvidenciasModel SearchEvidences = new EvidenciasModel(); SearchServices searchService = new SearchServices(); try { if (TypeDocSelected == null && TypeDocSelected.id < 0) { await Application.Current.MainPage.DisplayAlert("", "Seleccione un tipo de documento", "Ok"); isProcessing = false; return; } if (string.IsNullOrEmpty(Identification)) { await Application.Current.MainPage.DisplayAlert("", "Ingrese la identificación del cliente", "Ok"); isProcessing = false; return; } SearchEvidences.typeDoc = TypeDocSelected.id; SearchEvidences.identifClient = this.Identification; Evidences = await searchService.SearchData(SearchEvidences); this.NameClient = Evidences.nameClient; if (Evidences.idTercero > 0) { LstEvidClients.Add(new EvidenciasModel { nameClient = Evidences.nameClient, identifClient = Evidences.identifClient, idTercero = Evidences.idTercero, sigla = TypeDocSelected.nameAux, holder = true }); } else { MainViewModel.GetInstance().AddClient = new AddClientViewModel(); MainViewModel.GetInstance().AddClient.IdTypeDoc = TypeDocSelected.id; MainViewModel.GetInstance().AddClient.Identification = this.Identification; MainViewModel.GetInstance().AddClient.DataNewClient = true; await Application.Current.MainPage.Navigation.PushModalAsync(new AddClientPage()); } withData = true; isProcessing = false; } catch (Exception ex) { await Application.Current.MainPage.DisplayAlert("TakePicture SearchData", ex.Message, "Ok"); } }
public async void CallSearchData() { EvidenciasModel SearchEvidences = new EvidenciasModel(); SearchServices searchService = new SearchServices(); try { if (TypeDocSelected == null && TypeDocSelected.id < 0) { await Application.Current.MainPage.DisplayAlert("", "Seleccione un tipo de documento", "Ok"); isProcessing = false; return; } if (string.IsNullOrEmpty(Identification)) { await Application.Current.MainPage.DisplayAlert("", "Ingrese la identificación del cliente", "Ok"); isProcessing = false; return; } SearchEvidences.typeDoc = TypeDocSelected.id; SearchEvidences.identifClient = this.Identification; Evidences = await searchService.SearchData(SearchEvidences); this.NameClient = Evidences.nameClient; this.IdIdentifica = Evidences.idTercero; if (Evidences.idTercero == 0) { this.DataNewClient = true; this.withData = false; } else { withData = true; isProcessing = false; } } catch (Exception ex) { await Application.Current.MainPage.DisplayAlert("TakePicture SearchData", ex.Message, "Ok"); } }