Beispiel #1
0
        public override void SetMasters(Location obj, Prozhivanie dobj, List <string> attrs, IDataService defDS,
                                        IDataService syncDS, Source source, ref List <DataObject> arrToUpd,
                                        ref Dictionary <string, List <DataObject> > arrConformity)
        {
            var status = dobj.GetStatus();

            if (obj.Territory != null &&
                (status == ObjectStatus.Created || attrs != null && attrs.Contains(Location.ConstTerritory)))
            {
                var val = new Territoriia();
                val.SetExistObjectPrimaryKey(obj.Territory.Guid);
                defDS.LoadObject(val);
                dobj.Territoriia = val;
            }

            if (obj.Street != null &&
                (status == ObjectStatus.Created || attrs != null && attrs.Contains(Location.ConstStreet)))
            {
                var val = new Ulitca();
                val.SetExistObjectPrimaryKey(obj.Street.Guid);
                defDS.LoadObject(val);
                dobj.Ulitca = val;
            }

            if (obj.Structure != null &&
                (status == ObjectStatus.Created || attrs != null && attrs.Contains(Location.ConstStructure)))
            {
                var stroenie = (Stroenie)MapperHelper.GetMaster(typeof(Stroenie), obj.Structure.Guid,
                                                                defDS.Query <Stroenie>(Stroenie.Views.StroenieE), syncDS, source, ref arrToUpd, ref arrConformity);
                dobj.Stroenie = stroenie;
            }
        }
Beispiel #2
0
        public override void SetMasters(Structure obj, Stroenie dobj, List <string> attrs, IDataService defDS, IDataService syncDS, Source source, ref List <DataObject> arrToUpd, ref Dictionary <string, List <DataObject> > arrConformity)
        {
            var status = dobj.GetStatus();

            if (obj.Area != null &&
                (status == ObjectStatus.Created || attrs != null && attrs.Contains(Structure.ConstArea)))
            {
                var val = new Territoriia();
                val.SetExistObjectPrimaryKey(obj.Area.Guid);
                defDS.LoadObject(val);
                dobj.Raion = val;
            }
            if (obj.Street != null &&
                (status == ObjectStatus.Created || attrs != null && attrs.Contains(Structure.ConstStreet)))
            {
                var val = new Ulitca();
                val.SetExistObjectPrimaryKey(obj.Street.Guid);
                defDS.LoadObject(val);
                dobj.Ulitca = val;
            }
        }