public async Task <Object> All(string key = null, string value = null) { CentroEntity Centro; List <CentroEntity> Centros = new List <CentroEntity>(); if (String.IsNullOrEmpty(key) && String.IsNullOrEmpty(value)) { seleccionarAllCentroFullResponse Response = await this.Service.seleccionarAllCentroFullAsync(); foreach (centro c in Response.@return) { Centro = new CentroEntity(); Centro.Id_Centro = (int)c.idCentro; Centro.Nombre_Centro = c.nombreCentro; Centro.Nombre_Ciudad = c.nombreCiudad; Centro.Nombre_Region = c.nombreRegion; Centro.Nombre_Pais = c.nombrePais; Centro.Nombre_Usuario = c.nombreUsuario; Centro.Foto = await this.FotoService.Find("2", (int)c.idCentro); Centros.Add(Centro); } return(Centros); //return Centros.FirstOrDefault(c => c.Id_Centro == 1); } else { findCentroPorResponse Response = await this.Service.findCentroPorAsync(key, value); Debug.WriteLine(Response.@return); return(Response.@return); } }
private async Task <CentroEntity> Find_Centro(int id) { CentroEntity response = null; try { response = await CentroService.Find(id); } catch (Exception) { Alert.CreateAlert("Ocurrió un error al intentar conectar. Compruebe su conexión e intente más tarde.", "Sistema CEM - Error de conexión"); } return(response); }
public async Task <CentroEntity> Find(int id) { CentroEntity Centro = new CentroEntity(); findCentroResponse Response = await this.Service.findCentroAsync(id); Centro.Id_Centro = (int)[email protected]; Centro.Nombre_Centro = [email protected]; Centro.Nombre_Ciudad = [email protected]; Centro.Nombre_Region = [email protected]; Centro.Nombre_Pais = [email protected]; Centro.Nombre_Usuario = [email protected]; Centro.Foto = await this.FotoService.Find("2", (int)[email protected]); return(Centro); }
/// <summary> /// Populates the page with content passed during navigation. Any saved state is also /// provided when recreating a page from a prior session. /// </summary> /// <param name="sender"> /// The source of the event; typically <see cref="NavigationHelper"/> /// </param> /// <param name="e">Event data that provides both the navigation parameter passed to /// <see cref="Frame.Navigate(Type, object)"/> when this page was initially requested and /// a dictionary of state preserved by this page during an earlier /// session. The state will be null the first time a page is visited.</param> private async void NavigationHelper_LoadState(object sender, LoadStateEventArgs e) { CentroEntity item = await this.Find_Centro((int)e.NavigationParameter); if (item != null) { item.Participaciones = await this.Find_Participaciones(item.Id_Centro.ToString()); } else { Alert.CreateAlert("Ocurrió un error al obtener la información del Centro, intente más tarde."); } ProgressRing Loading = (ProgressRing)FindChildControl <ProgressRing>(this, "Progress"); Loading.Visibility = Visibility.Collapsed; this.DefaultViewModel["Item"] = item; }