예제 #1
0
        public void firstOutput()
        {
            List <Data.Pokemon> pkmns = API_Pokemon.Get_All_Pokemon();

            foreach (Data.Pokemon pkmn in pkmns)
            {
                PokemonRow row = new PokemonRow(pkmn);
                this.pkmns.Children.Add(row);
            }
        }
예제 #2
0
        public void InitDropDownsTyp()
        {
            ICollection <Data.Typ> types = API_Pokemon.Get_All_Types();

            dd_Typen2.Items.Add(new KeyValuePair <int, string>(0, "--none--"));
            foreach (Data.Typ type in types)
            {
                dd_Typen1.Items.Add(new KeyValuePair <int, string>((int)type.ID_Typ, type.Type));
                dd_Typen2.Items.Add(new KeyValuePair <int, string>((int)type.ID_Typ, type.Type));
            }
            dd_Typen1.SelectedIndex = 0;
            dd_Typen2.SelectedIndex = 0;
        }
예제 #3
0
        private void Save(object sender, RoutedEventArgs e)
        {
            long   pkdx_nr = long.Parse(txt_PokedexNr_Int.Text);
            string name    = txt_Name_String.Text;

            long generation = long.Parse(dd_Generation.SelectedValue.ToString());

            long angriff              = long.Parse(txt_Angriff_Int.Text);
            long verteidigung         = long.Parse(txt_Verteidigung_Int.Text);
            long spezial_angriff      = long.Parse(txt_SpezialAngriff_Int.Text);
            long spezial_verteidigung = long.Parse(txt_SpezialVerteidigung_Int.Text);
            long kp         = long.Parse(txt_KP_Int.Text);
            long initiative = long.Parse(txt_Initiative_Int.Text);

            string pokedex_eintrag = txt_Pokedex.Text;

            List <Int64> typen = new List <long>();

            long typ_1 = long.Parse(dd_Typen1.SelectedValue.ToString());
            long typ_2 = long.Parse(dd_Typen2.SelectedValue.ToString());

            typen.Add(typ_1);
            if (typ_2 != 0)
            {
                typen.Add(typ_2);
            }

            API_Pokemon.Create_Pokemon(pkdx_nr, name, generation, angriff, verteidigung, spezial_angriff, spezial_verteidigung, kp, initiative, pokedex_eintrag, typen);

            txt_Name_String.Text             = "";
            txt_PokedexNr_Int.Text           = "";
            dd_Generation.SelectedIndex      = 0;
            txt_Angriff_Int.Text             = "";
            txt_Verteidigung_Int.Text        = "";
            txt_SpezialAngriff_Int.Text      = "";
            txt_SpezialVerteidigung_Int.Text = "";
            txt_KP_Int.Text         = "";
            txt_Initiative_Int.Text = "";
            txt_Pokedex.Text        = "";
            dd_Typen1.SelectedIndex = 0;
            dd_Typen2.SelectedIndex = 0;
        }
예제 #4
0
 private void Delete(object sender, RoutedEventArgs e)
 {
     API_Pokemon.Delete_Pokemon(id);
     Infos.Children.RemoveRange(0, Infos.Children.Count);
 }