示例#1
0
        private void button1_Click(object sender, EventArgs e)
        {
            string    id          = textBox1.Text;
            string    nom         = textBox2.Text;
            string    description = textBox3.Text;
            MongoCRUD db          = new MongoCRUD("ElectroWood");

            db.InsertRecord("Materiels", new Materiels {
                Id = id, Nom = nom, Description = description
            });
            ReadAllDocuments();
        }
示例#2
0
        private void button1_Click(object sender, EventArgs e)
        {
            string    nom     = textBox2.Text;
            string    cinprof = comboBox1.Text;
            string    filiere = textBox3.Text;
            string    groupe  = textBox10.Text;
            MongoCRUD db      = new MongoCRUD("ElectroWood");

            db.InsertRecord("ProjetPro", new Projet {
                Nom = nom, Filiere = filiere, CIN_prof = cinprof, Groupe = groupe
            });
            ReadAllDocuments1();
        }
示例#3
0
        private void button2_Click(object sender, EventArgs e)
        {
            string datedeb    = textBox1.Text;
            string datefin    = textBox2.Text;
            string cinprof    = comboBox1.Text;
            string groupe     = textBox3.Text;
            string projetpro  = textBox4.Text;
            string projetpers = textBox5.Text;
            string existdate  = collection1.AsQueryable().Any(d => d.Date_debut == datedeb).ToString();

            if (existdate == "True")
            {
                MessageBox.Show("L'atelier est déjà réservé à cette date ");

                return;
            }
            else
            {
                string existnom = collection.AsQueryable().Any(p => p.Nom == projetpro).ToString();
                if (existnom == "True" || textBox5.Text != "")
                {
                    if (existnom == "True")
                    {
                        MongoCRUD db = new MongoCRUD("ElectroWood");
                        db.InsertRecord("Reservation", new Reservation {
                            Date_debut = datedeb, Date_fin = datefin, CIN_prof = cinprof, Groupe = groupe, Projet = projetpro
                        });
                        MessageBox.Show("Votre reservation est effectuee");
                        return;
                    }
                    if (textBox5.Text != "")
                    {
                        MongoCRUD db = new MongoCRUD("ElectroWood");
                        db.InsertRecord("Reservation", new Reservation {
                            Date_debut = datedeb, Date_fin = datefin, CIN_prof = cinprof, Groupe = groupe, Projet = projetpers
                        });

                        db.InsertRecord("ProjetPers", new ProjetPers {
                            Nom = projetpers, CIN_prof = cinprof, Groupe = groupe
                        });
                        MessageBox.Show("Votre reservation est effectuee");
                        return;
                    }
                }
                else
                {
                    MessageBox.Show("Ce projet professionnel n'existe pas");
                    return;
                }
            }
        }
示例#4
0
        private void button4_Click(object sender, EventArgs e)
        {
            string    cin     = textBox4.Text;
            string    nom     = textBox5.Text;
            string    prenom  = textBox6.Text;
            string    filiere = textBox7.Text;
            string    email   = textBox9.Text;
            MongoCRUD db      = new MongoCRUD("ElectroWood");

            db.InsertRecord("Profs", new profs {
                CIN = cin, Nom = nom, Prenom = prenom, Filiere = filiere, Email = email
            });
            ReadAllDocuments2();
        }