Exemplo 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);
        }
Exemplo n.º 2
0
        private void BtnAjoutType_Click(object sender, EventArgs e)
        {
            int compteur;

            if (rdb1AV.Checked == true)
            {
                compteur = 1;
            }
            else
            {
                compteur = 2;
            }
            string numPkm = LbxPkm.SelectedItem.ToString().Substring(0, 3);

//            MessageBox.Show("Le Type est : " + cbxType1.SelectedValue.ToString(), "Information", MessageBoxButtons.OK, MessageBoxIcon.Information);

            if (OutilsPkdx.VerifInsertionSup2AvoirType(numPkm, compteur) == true)
            {
                OutilsPkdx.InsertionAvoirType(rdb1AV, numPkm, int.Parse(cbxType1.SelectedValue.ToString()), int.Parse(cbxType2.SelectedValue.ToString()), DBConst.lstSelectType);
            }
            else
            {
                MessageBox.Show("Impossible de rentrer plus de 2 types", "erreur", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }