示例#1
0
        public void ReaderClean(Models.StagingTools model)
        {
            Context.Refresh(RefreshMode.KeepCurrentValues);

            if (model.S2Incoming || model.Track)
            {
                var s2Id  = Data.ExternalSystems.S2In.Id;
                var extId = Data.Reader.Location1Reader1ExternalId;
                Factory.DeleteWithKeys <Reader>(Context, EntityType.Reader, extId, s2Id);

                extId = Data.Reader.Location1Reader2ExternalId;
                Factory.DeleteWithKeys <Reader>(Context, EntityType.Reader, extId, s2Id);


                extId = Data.Reader.Location2Reader1ExternalId;
                Factory.DeleteWithKeys <Reader>(Context, EntityType.Reader, extId, s2Id);

                extId = Data.Reader.Location2Reader2ExternalId;
                Factory.DeleteWithKeys <Reader>(Context, EntityType.Reader, extId, s2Id);

                extId = Data.Reader.Location2Reader3ExternalId;
                Factory.DeleteWithKeys <Reader>(Context, EntityType.Reader, extId, s2Id);

                extId = Data.Reader.Location2Reader4ExternalId;
                Factory.DeleteWithKeys <Reader>(Context, EntityType.Reader, extId, s2Id);
            }

            Context.SubmitChanges();
        }
示例#2
0
        public void PersonClean(Models.StagingTools model)
        {
            Context.Refresh(RefreshMode.KeepCurrentValues);

            if (model.S2Incoming || model.Track)
            {
                var s2Id = Data.ExternalSystems.S2In.Id;

                if (model.CleanAllPeople)
                {
                    var entityType = Enum.GetName(typeof(EntityType), EntityType.Person);

                    Context.ExternalApplicationKeys.DeleteAllOnSubmit(Context.ExternalApplicationKeys.Where(x => x.EntityType == entityType && x.SystemId == s2Id));

                    Context.Persons.DeleteAllOnSubmit(Context.Persons);
                }
                else
                {
                    var extId = Data.People.R1Person1ExternalId;
                    Factory.DeleteWithKeys <Person>(Context, EntityType.Person, extId, s2Id);

                    extId = Data.People.R1Person2ExternalId;
                    Factory.DeleteWithKeys <Person>(Context, EntityType.Person, extId, s2Id);
                }
            }

            Context.SubmitChanges();
        }
示例#3
0
        public void LocationClean(Models.StagingTools model)
        {
            Context.Refresh(RefreshMode.KeepCurrentValues);

            if (model.S2Incoming || model.Track)
            {
                var sysId = Data.ExternalSystems.TrackOut.Id;
                var extId = Data.Locations.Location1ExternalId;
                Factory.DeleteWithKeys <Location>(Context, EntityType.Location, extId, sysId);

                extId = Data.Locations.Location2ExternalId;
                Factory.DeleteWithKeys <Location>(Context, EntityType.Location, extId, sysId);
            }

            Context.SubmitChanges();
        }
示例#4
0
        public void PortalClean(Models.StagingTools model)
        {
            Context.Refresh(RefreshMode.KeepCurrentValues);

            if (model.S2Incoming || model.Track)
            {
                var s2Id  = Data.ExternalSystems.S2In.Id;
                var extId = Data.Portal.Location1Portal1ExternalId;
                Factory.DeleteWithKeys <Portal>(Context, EntityType.Portal, extId, s2Id);

                extId = Data.Portal.Location2Portal1ExternalId;
                Factory.DeleteWithKeys <Portal>(Context, EntityType.Portal, extId, s2Id);

                extId = Data.Portal.Location2Portal2ExternalId;
                Factory.DeleteWithKeys <Portal>(Context, EntityType.Portal, extId, s2Id);
            }

            Context.SubmitChanges();
        }