private void EditLeague(object sender, RoutedEventArgs e)
        {
            league.Name   = Name.Text;
            league.Rating = int.Parse(Rating.Text);
            //league.RaceTypes = RaceTypes.SelectedItem;

            RestService restService = new RestService(ApiAddress.Address(), "/League", token);

            restService.Put <string, League>(league.LID, league);
            MainWindow mainWindow = new MainWindow();

            mainWindow.GetLeagueListNames();
            this.Close();
        }
Ejemplo n.º 2
0
        private void EditTeam(object sender, RoutedEventArgs e)
        {
            team.TName   = TName.Text;
            team.Created = int.Parse(Created.Text);
            team.Country = Country.Text;


            RestService restService = new RestService(ApiAddress.Address(), "/Team", token);

            restService.Put <string, Team>(team.TID, team);
            MainWindow mainWindow = new MainWindow();

            mainWindow.GetLeagueListNames();
            this.Close();
        }
Ejemplo n.º 3
0
        private void EditDriver(object sender, RoutedEventArgs e)
        {
            driver.DName      = DName.Text;
            driver.BornYear   = int.Parse(BornYear.Text);
            driver.CountryB   = CountryB.Text;
            driver.RaceNumber = int.Parse(RaceNumber.Text);

            RestService restService = new RestService(ApiAddress.Address(), "/Driver", token);

            restService.Put <string, Driver>(driver.DID, driver);

            MainWindow mainWindow = new MainWindow();

            mainWindow.GetLeagueListNames();
            this.Close();
        }
Ejemplo n.º 4
0
        private void AddTeam(object sender, RoutedEventArgs e)
        {
            Team team = new Team()
            {
                TName   = TName.Text,
                Created = int.Parse(Created.Text),
                Country = Country.Text,
                //Engine = Engine.SelectedItem,
                LID    = league.LID,
                League = league
            };

            RestService restService = new RestService(ApiAddress.Address(), "/Team", token);

            restService.Post <Team>(team);
            MainWindow mainWindow = new MainWindow();

            mainWindow.GetLeagueListNames();
            this.Close();
        }