コード例 #1
0
        private void ListPlayers(object sender, RoutedEventArgs e)
        {
            PlayersWindow playersWindow = new PlayersWindow(Teamgrid.SelectedItem as Team, token);

            playersWindow.Show();
            this.Close();
        }
コード例 #2
0
        private void AddPlayer(object sender, RoutedEventArgs e)
        {
            Player player = new Player()
            {
                PlayerName  = PlayerName.Text,
                TeamID      = team.TeamID,
                WeakFoot    = Convert.ToInt32(PlayerWeakFoot.Value),
                Rating      = Convert.ToInt32(PlayerRating.Value),
                Nationality = PlayerNationality.Text
            };


            RestService restService = new RestService("https://mlszproject.azurewebsites.net/", "/Player", token);

            restService.Post <Player>(player);

            PlayersWindow playersWindow = new PlayersWindow(team, token);

            playersWindow.Show();
            this.Close();
        }
コード例 #3
0
        private void EditPlayer(object sender, RoutedEventArgs e)
        {
            Player modplayer = new Player()
            {
                IgazolasSzama = player.IgazolasSzama,
                PlayerName    = PlayerName.Text,
                Rating        = Convert.ToInt32(PlayerRating.Value),
                Nationality   = PlayerNationality.Text,
                WeakFoot      = Convert.ToInt32(PlayerWeakFoot.Value),
                TeamID        = PlayerTeamID.Content.ToString()
            };

            RestService restservice = new RestService("https://mlszproject.azurewebsites.net/", "/Player", token);

            restservice.Put <string, Player>(player.IgazolasSzama, modplayer);



            PlayersWindow playersWindow = new PlayersWindow(team, token);

            playersWindow.Show();
            this.Close();
        }