Beispiel #1
0
        public static void UpdCompetence(Competence_BO compBO)
        {
            using (var db = new MarcassinEntities())
            {
                Competence comp = db.Competence.Find(compBO.Id_Competence);

                var cat = from ca in db.Categorie
                          where ca.Intitule == compBO.Categorie
                          select ca.id_Categorie;
                comp.id_categorie = cat.FirstOrDefault();
                db.SaveChanges();

                if (compBO.Competence_mere != "")
                {
                    var comref = from lc in db.Langue_Competence
                                 where lc.Traduction == compBO.Competence_mere
                                 select lc.id_Competence;

                    comp.id_Competence_ref = comref.FirstOrDefault();
                    comp.est_actif         = false;
                }
                db.SaveChanges();

                Langue_Competence langcomp = db.Langue_Competence.Where(l => l.id_Competence == compBO.Id_Competence).Where(l => l.id_Langue == 1).FirstOrDefault();
                langcomp.Traduction = compBO.Competence;
                db.SaveChanges();
            }
        }
Beispiel #2
0
        public static void UpdTrad(string[] trad)
        {
            using (var db = new MarcassinEntities())
            {
                string intitulefr   = trad[0];
                string intitulelang = trad[1];
                var    req_id_comp  = from lc in db.Langue_Competence
                                      where lc.Traduction == intitulefr
                                      select lc.id_Competence
                ;
                int id_comp = req_id_comp.FirstOrDefault();


                Langue_Competence langcomp = db.Langue_Competence.Where(l => l.id_Competence == id_comp).Where(l => l.Langue.Langue_intitule == intitulelang).FirstOrDefault();
                langcomp.Traduction = trad[2];
                db.SaveChanges();
            }
        }