protected override void OnClick() => ThreadService.RunOnBackground(async() => {
            Log.Debug("running well missing operating status validation");

            var progressDialog = new ProgressDialog("🔍 Finding issues...", 100, false);
            var progressor     = new CancelableProgressorSource(progressDialog).Progressor;
            progressDialog.Show();

            const string tableName        = "UICWell";
            const string relatedTableName = "UICWellOperatingStatus";

            var layer = LayerService.GetLayer(tableName, MapView.Active.Map);

            progressor.Value = 10;

            if (layer == null)
            {
                NotificationService.NotifyOfMissingLayer(tableName);

                progressDialog.Hide();

                return;
            }

            IGPResult result = null;
            var parameters   = Geoprocessing.MakeValueArray(layer);

            Log.Verbose("management.GetCount on {layer}", tableName);

            var cts = new CancellationTokenSource();
            try {
                result = await Geoprocessing.ExecuteToolAsync(
                    "management.GetCount",
                    parameters,
                    null,
                    cts.Token
                    );
            } catch (Exception ex) {
                NotificationService.NotifyOfGpCrash(ex, parameters);

                progressDialog.Hide();

                return;
            }

            if (result.IsFailed || string.IsNullOrEmpty(result?.ReturnValue))
            {
                NotificationService.NotifyOfGpFailure(result, parameters);

                progressDialog.Hide();

                return;
            }

            progressor.Value = 20;

            var total = Convert.ToInt32(result?.Values[0]);
            Log.Verbose("found {records} well records", total);

            var perRecordTick   = 60F / total;
            float startingPoint = 20;

            var idMap       = new Dictionary <string, long>(total);
            var primaryKeys = new HashSet <string>();
            var foreignKeys = new HashSet <string>();

            using (var parentTable = LayerService.GetTableFromLayersOrTables(tableName, MapView.Active.Map))
                using (var relatedTable = LayerService.GetTableFromLayersOrTables(relatedTableName, MapView.Active.Map)) {
                    if (relatedTable == null)
                    {
                        NotificationService.NotifyOfMissingLayer(relatedTableName);

                        progressDialog.Hide();

                        return;
                    }

                    var filter = new QueryFilter {
                        SubFields = "OBJECTID,GUID"
                    };

                    using (var cursor = parentTable.Search(filter, true)) {
                        var guidIndex = cursor.FindField("GUID");

                        while (cursor.MoveNext())
                        {
                            var id   = cursor.Current.GetObjectID();
                            var guid = cursor.Current[guidIndex].ToString();

                            idMap[guid] = id;
                            primaryKeys.Add(guid);

                            startingPoint += perRecordTick;
                            var tick       = Convert.ToUInt32(startingPoint);

                            if (tick - 5 > progressor.Value)
                            {
                                progressor.Value = tick;
                            }
                        }
                    }

                    Log.Verbose("built set of primary keys");

                    filter.SubFields = "WELL_FK";

                    using (var cursor = relatedTable.Search(filter, true)) {
                        var guidIndex = cursor.FindField("WELL_FK");

                        while (cursor.MoveNext())
                        {
                            var guid = cursor.Current[guidIndex].ToString();

                            foreignKeys.Add(guid);
                        }
                    }

                    Log.Verbose("Built set of foreign keys");
                    progressor.Value = 90;
                }

            primaryKeys.ExceptWith(foreignKeys);

            Log.Information("Found {count} issues", primaryKeys.Count);

            if (primaryKeys.Count == 0)
            {
                NotificationService.NotifyOfValidationSuccess();

                progressDialog.Hide();

                return;
            }

            var problems = new List <long>(primaryKeys.Count);
            problems.AddRange(idMap.Where(x => primaryKeys.Contains(x.Key)).Select(x => x.Value));
            Log.Debug("Problem records {items}", problems);

            progressor.Value = 100;

            Log.Verbose("Setting selection");

            MapView.Active.Map.SetSelection(new Dictionary <MapMember, List <long> > {
                { layer, problems }
            });

            progressDialog.Hide();

            NotificationService.NotifyOfValidationFailure(problems.Count);

            Log.Verbose("Zooming to selected");

            await MapView.Active.ZoomToSelectedAsync(TimeSpan.FromSeconds(1.5));

            Log.Debug("Finished Well Operating Status Validation");
        });
 public ThreadServiceTests()
 {
     _sut = new ThreadService(dbcontext.Object);
 }
 public UsersController(UserService userService, IMapper mapper, ThreadService threadService)
 {
     _userService   = userService;
     _mapper        = mapper;
     _threadService = threadService;
 }
        protected override async void OnClick() => await ThreadService.RunOnBackground(async() => {
            Log.Debug("running violation without return to compliance date");

            var progressDialog = new ProgressDialog("🔍 Finding issues...", "Cancel", 100, false);
            progressDialog.Show();

            var layerName = "UICViolation";
            var table     = LayerService.GetStandaloneTable(layerName, MapView.Active.Map);

            if (table == null)
            {
                NotificationService.NotifyOfMissingLayer(layerName);

                progressDialog.Hide();

                return;
            }

            IGPResult result = null;
            var parameters   = Geoprocessing.MakeValueArray(table, "NEW_SELECTION", "ReturnToComplianceDate IS NULL");
            var progSrc      = new CancelableProgressorSource(progressDialog);

            Log.Verbose("management.SelectLayerByAttribute on {layer} with {@params}", layerName, parameters);

            try {
                result = await Geoprocessing.ExecuteToolAsync(
                    "management.SelectLayerByAttribute",
                    parameters,
                    null,
                    new CancelableProgressorSource(progressDialog).Progressor,
                    GPExecuteToolFlags.Default
                    );
            } catch (Exception ex) {
                NotificationService.NotifyOfGpCrash(ex, parameters);

                progressDialog.Hide();

                return;
            }

            if (result.IsFailed || string.IsNullOrEmpty(result?.ReturnValue))
            {
                NotificationService.NotifyOfGpFailure(result, parameters);

                progressDialog.Hide();

                return;
            }

            var problems = Convert.ToInt32(result?.Values[1]);

            Log.Debug("found {problems} problems", problems);

            if (problems == 0)
            {
                NotificationService.NotifyOfValidationSuccess();

                progressDialog.Hide();

                return;
            }

            progressDialog.Hide();

            NotificationService.NotifyOfValidationFailure(problems);


            Log.Debug("finished violation missing return to compliance date");
        });
 protected ThreadController()
 {
     this.Db             = new MatterspaceDbContext();
     this.ProductService = new ProductService(this.Db);
     this.ThreadService  = new ThreadService(this.Db);
 }
 public ChatsController(IHubContext <ChatHub> context, MessageService messageService, ThreadService threadService)
 {
     this.context         = context;
     this._messageService = messageService;
     this._threadService  = threadService;
 }
Exemple #7
0
        internal NativePluginRunner(
            string apiKey,
            TextureLoadHandler textureLoadHandler,
            MaterialRepository materialRepository,
            MapGameObjectScene mapGameObjectScene,
            ConfigParams config,
            IndoorMapScene indoorMapScene,
            IndoorMapsApiInternal indoorMapsApiInternal,
            IndoorMapMaterialService indoorMapMaterialService,
            LabelServiceInternal labelServiceInternal,
            PositionerApiInternal positionerApiInternal,
            CameraApiInternal cameraApiInternal,
            BuildingsApiInternal buildingsApiInternal,
            PrecacheApiInternal precacheApiInternal,
            TransportApiInternal transportApiInternal,
            IndoorMapEntityInformationApiInternal indoorMapEntityInformationApiInternal,
            IntPtr apiHandle
            )
        {
            m_threadService      = new ThreadService();
            m_textureLoadHandler = textureLoadHandler;
            m_materialRepository = materialRepository;
            m_mapGameObjectScene = mapGameObjectScene;
            m_streamingUpdater   = new StreamingUpdater();

            var nativeConfig = config.GetNativeConfig();
            var pathString   = GetStreamingAssetsDir();
            var pathBytes    = GetNullTerminatedUTF8Bytes(pathString);

            var indoorMapsApiHandle            = indoorMapsApiInternal.GetHandle();
            var indoorMapMaterialServiceHandle = indoorMapMaterialService.GetHandle();

            var apiCallbacks = new ApiCallbacks(
                indoorMapsApiHandle,
                indoorMapMaterialServiceHandle,
                indoorMapScene.GetHandle(),
                cameraApiInternal.GetHandle(),
                buildingsApiInternal.GetHandle(),
                m_threadService.GetHandle(),
                textureLoadHandler.GetHandle(),
                mapGameObjectScene.GetHandle(),
                labelServiceInternal.GetHandle(),
                positionerApiInternal.GetHandle(),
                precacheApiInternal.GetHandle(),
                transportApiInternal.GetHandle(),
                indoorMapEntityInformationApiInternal.GetHandle(),
                apiHandle
                );

            Initialize(Screen.width, Screen.height, Screen.dpi,
                       apiKey,
                       pathBytes,
                       ref nativeConfig,
                       ref apiCallbacks,
                       config.CoverageTreeManifestUrl,
                       config.ThemeManifestUrl
                       );

            API = GetAppInterface();
            Debug.Assert(API != IntPtr.Zero);

            m_isRunning = true;
        }
        protected override async void OnClick() => await ThreadService.RunOnBackground(() => {
            Log.Debug("running inspection validation looking for not no deficiency with a missing correction");

            var progressDialog = new ProgressDialog("🔍 Finding issues...", "Cancel", 100, false);
            var progressor     = new CancelableProgressorSource(progressDialog).Progressor;
            progressDialog.Show();

            var idMap       = new Dictionary <string, long>();
            var primaryKeys = new HashSet <string>();
            var foreignKeys = new HashSet <string>();

            var tableName        = "UICInspection";
            var relatedTableName = "UICCorrection";
            using (var table = LayerService.GetTableFromLayersOrTables(tableName, MapView.Active.Map))
                using (var relatedTable = LayerService.GetTableFromLayersOrTables(relatedTableName, MapView.Active.Map)) {
                    progressor.Value = 10;

                    if (table == null)
                    {
                        NotificationService.NotifyOfMissingLayer(tableName);

                        progressDialog.Hide();

                        return;
                    }

                    if (relatedTable == null)
                    {
                        NotificationService.NotifyOfMissingLayer(relatedTableName);

                        progressDialog.Hide();

                        return;
                    }

                    var filter = new QueryFilter {
                        SubFields   = "OBJECTID,GUID",
                        WhereClause = "InspectionDeficiency!='NO'"
                    };

                    Log.Verbose("searching for inspections value other than no deficiency");

                    using (var cursor = table.Search(filter, true)) {
                        var guidIndex = cursor.FindField("GUID");

                        while (cursor.MoveNext())
                        {
                            var id   = cursor.Current.GetObjectID();
                            var guid = cursor.Current[guidIndex].ToString();

                            idMap[guid] = id;
                            primaryKeys.Add(guid);
                        }
                    }

                    progressor.Value = 60;

                    Log.Verbose("built set of primary keys");

                    filter = new QueryFilter {
                        SubFields = "Inspection_FK"
                    };

                    using (var cursor = relatedTable.Search(filter, true)) {
                        var guidIndex = cursor.FindField("Inspection_FK");

                        while (cursor.MoveNext())
                        {
                            var guid = cursor.Current[guidIndex].ToString();

                            foreignKeys.Add(guid);
                        }
                    }

                    Log.Verbose("built set of foreign keys");
                    progressor.Value = 90;

                    primaryKeys.ExceptWith(foreignKeys);

                    Log.Information("found {count} issues", primaryKeys.Count);

                    if (primaryKeys.Count == 0)
                    {
                        NotificationService.NotifyOfValidationSuccess();

                        progressDialog.Hide();

                        return;
                    }

                    var problems = new List <long>(primaryKeys.Count);
                    problems.AddRange(idMap.Where(x => primaryKeys.Contains(x.Key)).Select(x => x.Value));

                    Log.Debug("problem records {items}", problems);

                    progressor.Value = 100;

                    Log.Verbose("Setting selection");

                    MapView.Active.Map.SetSelection(new Dictionary <MapMember, List <long> > {
                        { LayerService.GetStandaloneTable(tableName, MapView.Active.Map), problems }
                    });

                    progressor.Value = 100;

                    progressDialog.Hide();

                    NotificationService.NotifyOfValidationFailure(problems.Count);

                    Log.Debug("finished inspection_correction validation");
                }
        });
 public ThreadsController(ThreadService threadService, UserService userService, MessageService messageService)
 {
     this._threadService  = threadService;
     this._userService    = userService;
     this._messageService = messageService;
 }
 /// <summary>
 /// Lists the thread IDs of the user's inbox.
 /// </summary>
 /// <param name="service">Gmail API service instance</param>
 /// <returns>A <see cref="ThreadList"/> instance</returns>
 public static async Task <ThreadList> ListIdsAsync(this ThreadService service)
 {
     return(await service.ListIdsAsync(labelIds : Label.Inbox));
 }
 /// <summary>
 /// Lists the threads of the user's inbox.
 /// </summary>
 /// <param name="service">Gmail API service instance</param>
 /// <returns>A list of Threads</returns>
 public static async Task <IList <MessageThread> > ListAsync(this ThreadService service)
 {
     return(await ListAsync(service, null, labelIds : Label.Inbox));
 }
 /// <summary>
 /// Get the number of estimated threads in the user's inbox.
 /// </summary>
 /// <param name="service">Gmail API service instance</param>
 /// <returns>The number of threads</returns>
 public static async Task <uint> CountAsync(this ThreadService service)
 {
     return(await CountAsync(service, Label.Inbox));
 }
 /// <summary>
 /// Get the number of estimated threads of the specified label.
 /// </summary>
 /// <param name="service">Gmail API service instance</param>
 /// <param name="labelIds">Only return threads with labels that match all of the specified label IDs</param>
 /// <returns>The number of threads</returns>
 public static async Task <uint> CountAsync(this ThreadService service, params string[] labelIds)
 {
     return((await service.ListIdsAsync(labelIds: labelIds)).ResultSizeEstimate);
 }
 public StatisticController(TopicService topicService, ThreadService threadService, PostService postService)
 {
     _topicService  = topicService;
     _threadService = threadService;
     _postService   = postService;
 }
Exemple #15
0
        protected override async void OnClick() => await ThreadService.RunOnBackground(async() => {
            Log.Debug("Running Authorization Validation");

            var progressDialog = new ProgressDialog("🔍 Finding issues...", "Cancel", 100, false);
            progressDialog.Show();

            const string layerName = "UICWell";
            var layer = LayerService.GetLayer(layerName, MapView.Active.Map);

            if (layer == null)
            {
                NotificationService.NotifyOfMissingLayer(layerName);

                progressDialog.Hide();

                return;
            }

            IGPResult result;
            var parameters = Geoprocessing.MakeValueArray(layer, "NEW_SELECTION", "Authorization_FK IS NULL");
            var progSrc    = new CancelableProgressorSource(progressDialog);

            Log.Verbose("management.SelectLayerByAttribute on {layer} with {@params}", layerName, parameters);

            try {
                result = await Geoprocessing.ExecuteToolAsync(
                    "management.SelectLayerByAttribute",
                    parameters,
                    null,
                    new CancelableProgressorSource(progressDialog).Progressor,
                    GPExecuteToolFlags.Default);
            } catch (Exception ex) {
                NotificationService.NotifyOfGpCrash(ex, parameters);

                progressDialog.Hide();

                return;
            }

            if (result.IsFailed || string.IsNullOrEmpty(result?.ReturnValue))
            {
                NotificationService.NotifyOfGpFailure(result, parameters);

                progressDialog.Hide();

                return;
            }

            var problems = Convert.ToInt32(result?.Values[1]);

            if (problems == 0)
            {
                NotificationService.NotifyOfValidationSuccess();

                progressDialog.Hide();

                return;
            }

            progressDialog.Hide();

            NotificationService.NotifyOfValidationFailure(problems);

            Log.Verbose("Zooming to selected");

            await MapView.Active.ZoomToSelectedAsync(TimeSpan.FromSeconds(1.5));

            Log.Debug("Finished Authorization Validation");
        });
Exemple #16
0
 static Program()
 {
     orderService  = new OrderService();
     threadService = new ThreadService();
 }
Exemple #17
0
        protected override void OnClick() => ThreadService.RunOnBackground(() => {
            Log.Debug("Running Area of Review Validation");

            var progressDialog = new ProgressDialog("🔍 Finding issues...", "Cancel", 100, false);
            var progressor     = new CancelableProgressorSource(progressDialog).Progressor;
            progressDialog.Show();

            var authorizations = new Dictionary <string, List <long> >();
            var noAreaOfReview = new HashSet <long>();

            var tableName = "UICWell";
            using (var table = LayerService.GetTableFromLayersOrTables("UICWell", MapView.Active.Map)) {
                progressor.Value = 10;

                if (table == null)
                {
                    NotificationService.NotifyOfMissingLayer(tableName);

                    progressDialog.Hide();

                    return;
                }

                var filter = new QueryFilter {
                    SubFields   = "OBJECTID,AUTHORIZATION_FK",
                    WhereClause = "Authorization_FK is not null AND AOR_FK is null"
                };

                Log.Verbose("Getting wells with an authorization but no area of review");

                using (var cursor = table.Search(filter)) {
                    while (cursor.MoveNext())
                    {
                        var oid  = Convert.ToInt64(cursor.Current["OBJECTID"]);
                        var guid = Convert.ToString(cursor.Current["AUTHORIZATION_FK"]);

                        if (authorizations.ContainsKey(guid))
                        {
                            authorizations[guid].Add(oid);

                            continue;
                        }

                        authorizations.Add(guid, new List <long> {
                            oid
                        });
                    }
                }
            }

            Log.Verbose("Got authorizations {dict}", authorizations);

            progressor.Value = 40;

            tableName        = "UICAuthorization";
            var table2       = LayerService.GetStandaloneTable(tableName, MapView.Active.Map);
            progressor.Value = 50;

            if (table2 == null)
            {
                NotificationService.NotifyOfMissingLayer(tableName);

                progressDialog.Hide();

                return;
            }

            var filter2 = new QueryFilter {
                SubFields   = "GUID",
                WhereClause = $"AuthorizationType IN ('IP', 'AP') AND GUID IN ({string.Join(",", authorizations.Keys.Select(x => $"'{x}'"))})"
            };

            Log.Verbose("searching for well authorizations with type IP or AP");

            using (var cursor = table2.Search(filter2)) {
                while (cursor.MoveNext())
                {
                    var guid = Convert.ToString(cursor.Current["GUID"]);

                    authorizations[guid].ForEach(x => noAreaOfReview.Add(x));
                }
            }

            Log.Verbose("got the guids {dict}", authorizations);

            progressor.Value = 90;

            if (noAreaOfReview.Count == 0)
            {
                NotificationService.NotifyOfValidationSuccess();

                progressDialog.Hide();

                return;
            }

            Log.Verbose("Found {count} wells with no AOR with an authorization of IP or AP", noAreaOfReview.Count);

            var layerName = "UICWell";
            var layer     = LayerService.GetLayer(layerName, MapView.Active.Map);

            if (layer == null)
            {
                NotificationService.NotifyOfMissingLayer(layerName);

                progressDialog.Hide();

                return;
            }

            Log.Verbose("Selecting Wells");

            progressor.Value = 95;

            MapView.Active.Map.SetSelection(new Dictionary <MapMember, List <long> > {
                { layer, noAreaOfReview.ToList() }
            });

            progressor.Value = 100;

            progressDialog.Hide();

            NotificationService.NotifyOfValidationFailure(noAreaOfReview.Count);

            Log.Verbose("Zooming to selected");

            MapView.Active.ZoomToSelectedAsync(TimeSpan.FromSeconds(1.5));

            Log.Debug("Finished Authorization Validation");
        });
Exemple #18
0
 public Logger(string loggerDirectory)
 {
     _pendingLogLines = new BlockingCollection <LogLine>();
     _documentService = new DocumentService(loggerDirectory);
     _threadService   = new ThreadService(this);
 }
        public async Task <Message> BuildMessage(Channel channel, ZaloMessage msg, Customer customer)
        {
            var message_id       = MessageService.FormatId01(channel.business_id, msg.msgid);
            var sender_ext_id    = "";
            var recipient_ext_id = "";

            if (Convert.ToInt64(msg.fromuid) > 0 && msg.fromuid.ToString() != channel.ext_id)
            {
                sender_ext_id    = msg.fromuid.ToString();
                recipient_ext_id = msg.oaid.ToString();
            }
            else
            {
                sender_ext_id    = msg.oaid.ToString();
                recipient_ext_id = msg.touid.ToString();
            }
            if (sender_ext_id.Length < 5)
            {
                return(null);
            }

            var thread_id = ThreadService.FormatId01(channel.business_id, customer.ext_id);

            var timestamp    = msg.timestamp > 9999999999 ? msg.timestamp / 1000 : msg.timestamp;
            var created_time = Core.Helpers.CommonHelper.UnixTimestampToDateTime(timestamp);

            var imageUrl = msg.href;

            if (!string.IsNullOrWhiteSpace(imageUrl) && !imageUrl.Contains("hibaza") && !imageUrl.Contains("firebase"))
            {
                imageUrl = await DownloadToLocalAsync(imageUrl);
            }

            var message = new Domain.Entities.Message
            {
                //"sendmsg"  "sendimagemsg")
                id                  = message_id,
                parent_id           = "",
                parent_ext_id       = "",
                root_ext_id         = "",
                conversation_ext_id = sender_ext_id,
                ext_id              = msg.msgid,
                thread_id           = thread_id,
                thread_type         = "message",
                sender_id           = CustomerService.FormatId01(channel.business_id, sender_ext_id),
                sender_ext_id       = sender_ext_id,
                sender_name         = sender_ext_id == customer.ext_id ? customer.name : channel.name,
                sender_avatar       = sender_ext_id == customer.ext_id ? customer.avatar : "",
                recipient_id        = CustomerService.FormatId01(channel.business_id, recipient_ext_id),
                recipient_ext_id    = recipient_ext_id,
                recipient_name      = recipient_ext_id == channel.ext_id ? channel.name : customer.name,
                recipient_avatar    = recipient_ext_id == channel.ext_id ? "" : customer.avatar,
                author              = CustomerService.FormatId01(channel.business_id, sender_ext_id),
                customer_id         = customer.id,
                message             = msg.message,
                tag                 = "",
                template            = "",
                url                 = imageUrl,
                timestamp           = timestamp,
                updated_time        = created_time,
                created_time        = created_time,
                business_id         = channel.business_id,
                channel_id          = channel.id,
                channel_ext_id      = channel.ext_id,
                channel_type        = channel.type,
                owner_id            = sender_ext_id,
                agent_id            = customer.agent_id,
                type                = msg.@event == "sendimagemsg" ? "image" : "text",
                liked               = false,
                hidden              = false,
                deleted             = false,
                urls                = "[]"
            };

            return(message);
        }
 static void Main(string[] args)
 {
     ThreadService threadService = new ThreadService();
     //Console.ReadKey();
 }
 public ThreadGetTests()
 {
     _proxy          = SettingsManager.GetGmailProxy();
     _service        = new ThreadService(_proxy);
     _messageService = new MessageService(_proxy);
 }
 public ThreadController(ThreadService threadService)
 {
     this.ThreadService = threadService;
 }
 private void pararServicosUniNFe()
 {
     ThreadService.Stop();
     Empresas.ClearLockFiles(false);
 }
Exemple #24
0
        protected override async void OnClick() => await ThreadService.RunOnBackground(async() => {
            /*
             * The UICAreaOfReview tbl has a field NoArtPenDate.
             * This is the date it was determined that there were no artificial penetrations
             * If this field is empty there should be at least one UICArtPen well associated with the AOR.
             *
             * Also, remember there is a many to many relationship between UICAreaOfReview and UICArtPen
             * so there isn't an AOR_FK in the UICArtPen record.
             */

            Log.Debug("Running area of review missing artificial penetration validation");

            var progressDialog = new ProgressDialog("🔍 Finding issues...", "Cancel", 100, false);
            var progressor     = new CancelableProgressorSource(progressDialog).Progressor;
            progressDialog.Show();

            var tableName = "UICAreaOfReview";
            using (var table = LayerService.GetTableFromLayersOrTables(tableName, MapView.Active.Map)) {
                progressor.Value = 10;

                if (table == null)
                {
                    NotificationService.NotifyOfMissingLayer(tableName);

                    progressDialog.Hide();

                    return;
                }

                var filter = new QueryFilter {
                    SubFields   = "OBJECTID",
                    WhereClause = "NoArtPenDate IS NULL"
                };

                Log.Verbose("searching for area of review records with no art pen date");

                var problems = new List <long>();
                using (var gdb = table.GetDatastore() as Geodatabase) {
                    if (gdb == null)
                    {
                        Log.Warning("Could not get geodatabase object");

                        progressDialog.Hide();
                    }

                    Log.Verbose("Got datastore as a geodatabase");

                    Log.Verbose("Opening relationship class and selecting {table} records", tableName);

                    var dbSchema = LayerService.GetDbSchema(MapView.Active.Map);

                    Log.Verbose("Using db and schema {schema}", dbSchema);

                    using (var relationshipClass = gdb.OpenDataset <RelationshipClass>($"{dbSchema}AreaOfReviewToArtPen"))
                        using (var selection = table.Select(filter, SelectionType.ObjectID, SelectionOption.Normal)) {
                            progressor.Value = 40;

                            var ids = selection.GetObjectIDs().ToList();

                            if (ids.Count == 0)
                            {
                                NotificationService.NotifyOfValidationSuccess();

                                progressDialog.Hide();

                                return;
                            }

                            Log.Verbose("Finding related records to {ids}", ids);

                            foreach (var id in ids)
                            {
                                var rows = relationshipClass.GetRowsRelatedToDestinationRows(new[] { id });
                                if (!rows.Any())
                                {
                                    problems.Add(id);
                                }
                                else
                                {
                                    foreach (var row in rows)
                                    {
                                        row.Dispose();
                                    }
                                }
                            }

                            progressor.Value = 75;
                        }

                    if (problems.Count == 0)
                    {
                        NotificationService.NotifyOfValidationSuccess();

                        progressDialog.Hide();

                        return;
                    }

                    var layerName = "UICAreaOfReview";
                    var layer     = LayerService.GetLayer(layerName, MapView.Active.Map);

                    if (layer == null)
                    {
                        NotificationService.NotifyOfMissingLayer(layerName);

                        progressDialog.Hide();

                        return;
                    }

                    MapView.Active.Map.SetSelection(new Dictionary <MapMember, List <long> > {
                        { layer, problems }
                    });

                    progressor.Value = 100;

                    progressDialog.Hide();

                    NotificationService.NotifyOfValidationFailure(problems.Count);

                    Log.Verbose("Zooming to selected");

                    await MapView.Active.ZoomToSelectedAsync(TimeSpan.FromSeconds(1.5));

                    Log.Debug("Finished aor artpen Validation");
                }
            }
        });