Пример #1
0
        private async Task ImprimirImagen()
        {
            sesionService = new SesionService();
            if (await sesionService.CheckSesionDbAsync() == true)
            {
                List <Sesion> listaSesiones = await sesionService.GetSesionDbAsync();

                if (listaSesiones.Count > 0)
                {
                    Sesion sesion = listaSesiones[0];
                    nombreUsuario.Text = sesion.firstName + " " + sesion.lastName;
                    if (sesion.photo != null)
                    {
                        if (sesion.photo.Contains("https:"))
                        {
                            imagenPerfil.Source = ImageSource.FromUri(new Uri(sesion.photo));
                        }
                        else
                        {
                            imagenPerfil.Source = ImageSource.FromUri(new Uri("http://www.palmapplicationsv.com/techoapp/public/" + sesion.photo));
                        }
                    }
                    else
                    {
                        imagenPerfil.Source = ImageSource.FromFile("photo.png");
                    }
                }
            }
            else
            {
                nombreUsuario.Text  = "";
                imagenPerfil.Source = ImageSource.FromFile("photo.png");
            }
        }
Пример #2
0
        private async Task InitializeDataAsync()
        {
            var listaTemp = new List <Evento>();

            if (await VerificarSesion() == true)
            {
                usuariosEventosService = new UsuariosEventosService();
                List <Sesion> sesion = new List <Sesion>();
                sesion = await sesionService.GetSesionDbAsync();

                int idUsuario = await GetIdUsuario();

                listaTemp = await usuariosEventosService.GetEventsByAssistanceAsync(idUsuario);

                foreach (var evento in listaTemp)
                {
                    if (evento.registrado == 1)
                    {
                        evento.textoBoton = "Ver";
                    }
                    else
                    {
                        evento.textoBoton = "Participar";
                    }
                }
            }
            else
            {
                var eventosServices = new EventosService();
                listaTemp = await eventosServices.GetEventosAsync();

                foreach (var evento in listaTemp)
                {
                    evento.textoBoton = "Participar";
                }
            }
            ListaEventos = listaTemp;
            //select from usuario
        }