コード例 #1
0
ファイル: frmTransferir.cs プロジェクト: Athenaz/Michelle
 private void btnTransferir_Click(object sender, EventArgs e)
 {
     archTrans = new Archivo();
     archTrans.setUser(listUsarios.SelectedItem.ToString());
     archTrans.agregarRegistro(pokemonE.toString());
     this.Close();
 }
コード例 #2
0
ファイル: frmTransferir.cs プロジェクト: Athenaz/Michelle
 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();
 }
コード例 #3
0
        private void actualizarLista()
        {
            Archivo nuevoArchivo = new Archivo();

            nuevoArchivo.setUser(user);
            this.listaPokemon = nuevoArchivo.listar();
            ImageList imageList = new ImageList();

            for (int i = 0; i < listaPokemon.Count; i++)
            {
                imageList.Images.Add(Image.FromFile(listaPokemon.ElementAt(i).getImagen()));
                this.listView1.View      = View.LargeIcon;
                imageList.ImageSize      = new Size(130, 150);
                listView1.LargeImageList = imageList;
                ListViewItem item = new ListViewItem();
                item.ImageIndex = i;
                item.Text       = listaPokemon.ElementAt(i).getNombre();

                listView1.Items.Add(item);
            }
        }
コード例 #4
0
ファイル: frmPokemon.cs プロジェクト: Athenaz/Michelle
 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;
     }
 }