Esempio n. 1
0
        private void BtnPkmValid_Click(object sender, EventArgs e)
        {
//            String desc = OutilsPkdx.FormeDescription(rtbDescText.Text);
            if (OutilsPkdx.VerifFormatPkm(mtbNumPkm.Text, TbxNomImg.Text, rtbDescText.Text) == true)
            {
                Generation gen = OutilsPkdx.ConvertGen(cbxGenPkm.SelectedValue.ToString(), DBConst.lstSelectGen);

                Images img = OutilsPkdx.ConvertImg(cbxUrlImg.SelectedValue.ToString(), DBConst.lstSelectImg);

                Pokemon p = OutilsPkdx.CreatPokemon(mtbNumPkm.Text.ToString(), TbxNomImg.Text.ToString(), rtbDescText.Text,
                                                    img, OutilsPkdx.GetValRadButton(rdbLegendaireTrue), gen, DBConst.lstSelectPkm);

                OutilsPkdx.InsertionAvoirType(rdb1AV, p.GetNumPokedexMondialPkm(), int.Parse(cbxType1.SelectedValue.ToString()),
                                              int.Parse(cbxType2.SelectedValue.ToString()), DBConst.lstSelectType);

                // On recupere les Pokemon dans la liste pour
                DBConst.lstSelectPkm = OutilsPkdx.RecupPokemon();

                // Remplissage de la ListBox
                RemplissLstBoxPkm(LbxPkm, DBConst.lstSelectPkm);


                MessageBox.Show("Insertion Images réussie", "Validation", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            else
            {
                MessageBox.Show("format Images invalide ou année déjà présente", "erreur", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }

            MessageBox.Show("validation Images", "validation", MessageBoxButtons.OK, MessageBoxIcon.Information);
        }