Exemplo n.º 1
0
        private void btnAdd_Click(object sender, EventArgs e)
        {
            clsInventory Pokemon = new clsInventory();

            frmPokemon = new frmPokemon(Pokemon);
            frmPokemon.Show();
        }
Exemplo n.º 2
0
 public frmPokemon(clsInventory prPokemon)
 {
     InitializeComponent();
     Pokemon             = prPokemon;
     cbType.Text         = Pokemon.typename;
     txtDexNo.Text       = Pokemon.pokeDexNo.ToString();
     txtName.Text        = Pokemon.name;
     txtDescription.Text = Pokemon.description;
     txtDustCost.Text    = Pokemon.dustcost.ToString();
     txtQuantity.Text    = Pokemon.quantity.ToString();
     if (Pokemon.gender == "M")
     {
         cbGender.SelectedIndex = 0;
     }
     else if (Pokemon.gender == "F")
     {
         cbGender.SelectedIndex = 1;
     }
     ;
     if (Pokemon.evolvable == "Y")
     {
         cbEvolvable.SelectedIndex = 0;
     }
     else if (Pokemon.evolvable == "N")
     {
         cbEvolvable.SelectedIndex = 1;
     }
     ;
     if (Pokemon.dustcostofnewmove == null)
     {
         txtDustCostNewMove.Text = "N/A";
     }
     else
     {
         txtDustCostNewMove.Text = Pokemon.dustcostofnewmove.ToString();
     }
     if (string.IsNullOrEmpty(Pokemon.nextevolutionname))
     {
         txtNextEvolution.Text = "N/A";
     }
     else
     {
         txtNextEvolution.Text = Pokemon.nextevolutionname;
     }
     if (Pokemon.candycostofevolution == null)
     {
         txtCandyCostEvolution.Text = "N/A";
     }
     else
     {
         txtCandyCostEvolution.Text = Pokemon.candycostofevolution.ToString();
     }
     if (Pokemon.pokeDexNo.ToString() != "0")
     {
         cbType.Enabled      = false;
         txtDexNo.Enabled    = false;
         cbEvolvable.Enabled = false;
     }
 }
Exemplo n.º 3
0
        private async void SetDetails()
        {
            Pokemon = await ServiceClient.GetPokemonAsync(lstPokemon.SelectedItem as string);

            lblType.Text            = Pokemon.typename;
            lblTypeDescription.Text = Types.Description;
            lblName.Text            = Pokemon.name;
            lblDescription.Text     = Pokemon.description;
            lblDustCost.Text        = Pokemon.dustcost.ToString();
            lblDateModified.Text    = Pokemon.datemodified.ToString();
            lblQuantity.Text        = Pokemon.quantity.ToString();
            lblGender.Text          = Pokemon.gender;
            lblEvolvable.Text       = Pokemon.evolvable;
            if (Pokemon.dustcostofnewmove == null)
            {
                lblDustCostMove.Text = "N/A";
            }
            else
            {
                lblDustCostMove.Text = Pokemon.dustcostofnewmove.ToString();
            }
            if (Pokemon.nextevolutionname == "")
            {
                lblNextEvloutionName.Text = "N/A";
            }
            else
            {
                lblNextEvloutionName.Text = Pokemon.nextevolutionname;
            }
            if (Pokemon.candycostofevolution == null)
            {
                lblNextEvolutionCost.Text = "N/A";
            }
            else
            {
                lblNextEvolutionCost.Text = Pokemon.candycostofevolution.ToString();
            }
        }
Exemplo n.º 4
0
 internal static async Task <string> UpdatePokemonAsync(clsInventory pokemon)
 {
     return(await InsertOrUpdateAsync(pokemon, "http://localhost:60064/api/Pokemon/PutPokemon", "PUT"));
 }