예제 #1
0
        private void ajoutRelation_Click(object sender, EventArgs e)
        {
            var titre = txtTitreR.Text;
            var nom   = txtAuteur.Text;

            // insert into table (relation)
            MongoCrud db = new MongoCrud("GestionBibliotheque");

            db.Insert("Relation", new Relation {
                titre = titre, nom = nom
            });
            MessageBox.Show("Relation ajoutée avec sucées !");
        }
예제 #2
0
        private void ajoutLivre_Click(object sender, EventArgs e)
        {
            var    titre      = txtTitre.Text;
            var    prix       = txtPrix.Text;
            double prixDouble = Convert.ToDouble(prix);
            var    numero     = txtNumLivre.Text;
            int    num        = int.Parse(numero);

            // insert into table(livres) collection
            MongoCrud db = new MongoCrud("GestionBibliotheque");

            db.Insert("livres", new Livre {
                titre = titre, prix = prixDouble, numero = num
            });
            MessageBox.Show("Livre ajouté avec sucées !");
        }
예제 #3
0
        private void ajoutAuteur_Click(object sender, EventArgs e)
        {
            var nom      = txtName.Text;
            var prenom   = txtPrenom.Text;
            var domicile = txtDomicile.Text;
            var numero   = (txtNum.Text);
            int num      = int.Parse(numero);

            // insert into table(auteurs) collection
            MongoCrud db = new MongoCrud("GestionBibliotheque");

            db.Insert("auteurs", new Auteur {
                nom = nom, prenom = prenom, domicile = domicile, numero = num
            });
            MessageBox.Show("Auteur ajouté avec sucées !");
        }