Exemplo n.º 1
0
        public static void Persist(Prestation prestation, int poleId, Dictionary <string, bool> territoires)
        {
            prestation.Pole = DAO.Find <Pole>(poleId);
            DAO.Persist(prestation);
            IEnumerable <Territoire> territoireSet = IsJoinedDictionary.ToDbSet <Territoire>(territoires);

            territoireSet.Each(t => PrestationTerritoireDAO.Join(prestation, t));
        }
Exemplo n.º 2
0
        public static Prestation_Territoire Join(Prestation prestation, Territoire territoire)
        {
            var join = new Prestation_Territoire()
            {
                Prestation = prestation, Territoire = territoire
            };

            DAO.Persist(join);
            return(join);
        }
Exemplo n.º 3
0
        public static Prestation_Territoire Join(int prestationId, int territoireId)
        {
            var join = new Prestation_Territoire()
            {
                Prestation = DAO.db.Prestations.Find(prestationId), Territoire = DAO.db.Territoires.Find(territoireId)
            };

            DAO.Persist(join);
            return(join);
        }
Exemplo n.º 4
0
        public static void AddActivite(int prestationId, int territoireId, Activite activite)
        {
            Func <Prestation_Territoire> joinIfNull = () => Join(prestationId, territoireId);

            var pt = Where(prestationId, territoireId, joinIfNull);

            var activites = pt.Activites ?? new List <Activite>();

            activites.Add(activite);
            DAO.Persist(activite);
            DAO.Update(pt);
        }