Example #1
0
 public frmTransferir(String user, String pokemon)
 {
     InitializeComponent();
     this.pokemon = pokemon;
     this.user    = user;
     achivo       = new Archivo();
     pokemonE     = new Pokemon();
     achivo.setUser(user);
     pokemonE      = achivo.buscar(pokemon);
     poke          = pokemonE.toString();
     textBox1.Text = pokemonE.getNombre();
     this.picPokemon.ImageLocation = pokemonE.getImagen();
 }
Example #2
0
 public frmPokemon(int accion, String user, String pokemon) // 1-->Abre el frmPokemon para crear un nuevo, 2-->modificar, 3-->ver detalles
 {
     InitializeComponent();
     archivo.setUser(user);
     pokemonModificar = archivo.buscar(pokemon);
     usuario.setUser(user);
     if (accion == 1)
     {
         lblEvolucion1.Visible       = false;
         lblEvolucion2.Visible       = false;
         btnCerrar.Visible           = false;
         label19.Visible             = false;
         btnModificarPokemon.Visible = false;
         llenarCombo(pokemonModificar);
     }
     else if (accion == 2)
     {
         btnCerrar.Visible             = false;
         btnGuardarPokemon.Visible     = false;
         rbtnEvolucionNoExiste.Visible = false;
         rbtnPokeNoRegistrado.Visible  = false;
         llenarCampos();
         llenarCombo(pokemonModificar);
     }
     else if (accion == 3)
     {
         this.txtAltura.Enabled          = false;
         this.txtApodo.Enabled           = false;
         this.txtAtaque.Enabled          = false;
         this.txtCategoria.Enabled       = false;
         this.txtAtaqueEspecial.Enabled  = false;
         this.txtDebilidades.Enabled     = false;
         this.txtDefensa.Enabled         = false;
         this.txtDefensaEspecial.Enabled = false;
         this.txtDescripcion.Enabled     = false;
         this.txtGenero.Enabled          = false;
         this.txtHabilidades.Enabled     = false;
         this.txtHp.Enabled               = false;
         this.txtNombrePokemon.Enabled    = false;
         this.txtNombrePokemon.Enabled    = false;
         this.txtPeso.Enabled             = false;
         this.txtTipos.Enabled            = false;
         this.txtVelocidad.Enabled        = false;
         this.btnCancelar.Visible         = false;
         this.btnGuardarPokemon.Visible   = false;
         this.btnModificarPokemon.Visible = false;
         this.btnImagen.Visible           = false;
         this.cmbEvolucion1.Visible       = false;
         this.cmbEvolucion2.Visible       = false;
         lblEvolucion1.Visible            = true;
         lblEvolucion2.Visible            = true;
         rbtnEvolucionNoExiste.Visible    = false;
         rbtnPokeNoRegistrado.Visible     = false;
         llenarCampos();
         if (pokemonModificar.getEvolucion().Equals(false))
         {
             this.label19.Visible = true;
         }
         if (!pokemonModificar.getEvolucion1().Equals("no"))
         {
             lblEvolucion1.Visible = true;
             lblEvolucion1.Text    = pokemonModificar.getEvolucion1();
         }
         if (!pokemonModificar.getEvolucion2().Equals("no"))
         {
             lblEvolucion2.Visible = true;
             lblEvolucion2.Text    = pokemonModificar.getEvolucion2();
         }
         int o = 0;
     }
 }