Ejemplo n.º 1
0
        async void updateStudio(StudioView studioView)
        {
            try {
                var studioJson = await Requests.Get(ConstantSettings.GetStudioId + $"{studioView.Id}/");

                Studio studio = JsonConvert.DeserializeObject <Studio>(studioJson);

                labelStudioName.Content         = studio.Name;
                textBlockStudioDescription.Text = studio.Description;

                imageStudioAvatar.Source = DataHandler.GetPictureBitmap(studio.Avatar);

                var gamesJson = await Requests.Get(ConstantSettings.GetStudioGames + $"{studioView.Id}/");

                List <Game> games = JsonConvert.DeserializeObject <List <Game> >(gamesJson);

                List <GameView> gamesView = await EntityConverter.ToGamesView(games);

                dataGridStudioGames.ItemsSource = gamesView;
            }
            catch (Exception)
            {
                return;
            }
        }
Ejemplo n.º 2
0
        async void updateEntities()
        {
            string gamesJson = await Requests.Get(ConstantSettings.GetGames);

            string studiosJson = await Requests.Get(ConstantSettings.GetStudios);

            string genresJson = await Requests.Get(ConstantSettings.GetGenres);

            string usersJson = await Requests.Get(ConstantSettings.GetUsers);

            List <Game>   games   = JsonConvert.DeserializeObject <List <Game> >(gamesJson);
            List <Studio> studios = JsonConvert.DeserializeObject <List <Studio> >(studiosJson);
            List <Genre>  genres  = JsonConvert.DeserializeObject <List <Genre> >(genresJson);
            List <User>   users   = JsonConvert.DeserializeObject <List <User> >(usersJson);


            List <GameView> gamesView = await EntityConverter.ToGamesView(games);

            List <StudioView> studiosView = EntityConverter.ToStudiosView(studios);
            List <GenreView>  genresView  = EntityConverter.TeGenresView(genres);
            List <UserView>   usersView   = EntityConverter.ToUsersView(users);


            dataGridGames.ItemsSource   = gamesView;
            dataGridStudios.ItemsSource = studiosView;
            dataGridGenres.ItemsSource  = genresView;
            dataGridUsers.ItemsSource   = usersView;
        }
Ejemplo n.º 3
0
        async void showUser(User user)
        {
            if (user.Avatar != "")
            {
                imageUserAvatar.Source = DataHandler.GetPictureBitmap(user.Avatar);
            }

            if (!string.IsNullOrEmpty(user.Telegram))
            {
                imageTelegram.Source     = DataHandler.GetPictureBitmap(ConstantSettings.TelegramPicture);
                labelUserTeleram.Content = user.Telegram;
            }
            else
            {
                imageTelegram.Source     = null;
                labelUserTeleram.Content = null;
            }

            if (!string.IsNullOrEmpty(user.Steam))
            {
                imageSteam.Source = DataHandler.GetPictureBitmap(ConstantSettings.SteamPicture);
            }
            else
            {
                imageSteam.Source = null;
            }

            labelUserName.Content  = user.Name;
            labelUserEmail.Content = user.Email;

            var games = await getUserGamesAsync(user.Id);

            dataGridSelectedUserGames.ItemsSource = await EntityConverter.ToGamesView(games);
        }
Ejemplo n.º 4
0
        async void updateAccount()
        {
            if (ApplicationConsts.User.Avatar != "")
            {
                BitmapImage bitmap = DataHandler.GetPictureBitmap(ApplicationConsts.User.Avatar);
                userAvatar.Source = bitmap;
            }

            labelName.Content  = ApplicationConsts.User.Name;
            labelEmail.Content = ApplicationConsts.User.Email;

            List <Game> games = await getUserGamesAsync(ApplicationConsts.User.Id);

            List <GameView> gamesView = await EntityConverter.ToGamesView(games);

            dataGridUserGames.ItemsSource = gamesView;
        }