示例#1
0
 private void reset()
 {
     collLivre = new Collection <Livre>();
     collLivre = M_Livre.getLivre();
     BoutonModifier.Enabled = true;
     BoutonValider.Enabled  = false;
     BoutonAjouter.Enabled  = true;
     BoutonAnnuler.Enabled  = false;
     AffecterValeurs(collLivre[NumLivreCourante - 1]);
 }
示例#2
0
        private void GestionLivre_Load(object sender, EventArgs e)
        {
            try
            {
                collLivre        = new Collection <Livre>();
                collLivre        = M_Livre.getLivre();
                NumLivreCourante = 1;


                AffecterValeurs(collLivre[NumLivreCourante - 1]);
            }
            catch (Exception ex)
            {
                MessageBox.Show("Erreur : " + ex.Message);
            }
        }
示例#3
0
        private void BoutonValider_Click(object sender, EventArgs e)
        {
            if (TokenMandA == 1)
            {
                try
                {
                    Livre unlivre = new Livre(int.Parse(labNoLivre.Text), BoxISBN.Text, BoxNomLivre.Text, new Auteur(int.Parse(collLivre[NumLivreCourante - 1].UnAuteur1.NumAuteur1.ToString()), BoxNonAuteur.Text), int.Parse(BoxQuantiteStock.Text), BoxDateSortie.Text, BoxTarif.Text, BoxResume.Text, BoxLangue.Text, collLivre[NumLivreCourante - 1].Couverture.ToString(), new Edition(int.Parse(collLivre[NumLivreCourante - 1].UneEdition.NumEdition1.ToString()), BoxEdition.Text), new Genre(int.Parse(collLivre[NumLivreCourante - 1].UnGenre1.NumGenre1.ToString()), BoxGenre.Text));
                    M_Livre.ModifLivre(unlivre);
                    reset();
                }

                catch (Exception ex)
                {
                    MessageBox.Show("Erreur : " + ex.Message);
                }
            }
            else
            {
                reset();
            }
        }