Example #1
0
        public static TarifPr MapTarifPresse(XpoTarifPr TarifPr)
        {
            var TarifPrinstance = new TarifPr()
            {
                id = TarifPr.Oid,
                Mois = TarifPr.Mois,
                annee = TarifPr.Annee,
                autre = TarifPr.Autre,
                nom = TarifPr.Nom
            };
            TarifPrinstance.supportPrs = new List<SupportPresse>();
            foreach (var sup in TarifPr.SupportPresses)
            {
                TarifPrinstance.supportPrs.Add(MapSupportPresse(sup));
            }

            TarifPrinstance.LignesTarifPrs = new List<LignesTarifPr>();
            foreach (var lig in TarifPr.LigneTarifPrs)
            {
                TarifPrinstance.LignesTarifPrs.Add(MapLigneTarifPr(lig));
            }
            return TarifPrinstance;
        }
Example #2
0
        public static object MapTarifPr(TarifPr entity, UnitOfWork uow)
        {
            var tarifPr = new XpoTarifPr(uow)
            {
                Nom = entity.nom,
                Annee = entity.annee,
                Autre = entity.autre,
                Mois = entity.Mois,
                Oid = entity.id,

            };

            foreach (var Sup in entity.supportPrs)
            {
                var supTemp=uow.GetObjectByKey<XpoSupportPresse>(entity.id);
                if(supTemp!=null)
                    tarifPr.SupportPresses.Add(supTemp);
            }

            foreach (var lig in entity.LignesTarifPrs)
            {
                var templig = MapLigneTarifPresse(lig,uow);
                if(templig!=null)
                    tarifPr.LigneTarifPrs.Add(templig);
            }

            return tarifPr;
        }