/// <summary>
        /// Handles the Click event of the btnDeleteGroup control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="RoutedEventArgs"/> instance containing the event data.</param>
        private async void btnDeleteGroup_Click(object sender, RoutedEventArgs e)
        {
            MessageBoxResult messageBoxResult = System.Windows.MessageBox.Show("Are you sure you want to delete this group and database matches?", "Delete Confirmation", System.Windows.MessageBoxButton.YesNo);

            if (messageBoxResult == MessageBoxResult.Yes)
            {
                try
                {
                    await RetryHelper.VoidOperationWithBasicRetryAsync(() =>
                                                                       _faceServiceClient.DeleteLargePersonGroupAsync(SelectedGroup.Group.LargePersonGroupId),
                                                                       new[] { "RateLimitExceeded" },
                                                                       traceWriter : _mainWindowLogTraceWriter);

                    _db.RemovePersonsForGroup(SelectedGroup.Group.LargePersonGroupId);

                    FaceGroups.Remove(SelectedGroup);
                    SelectedGroup = null;
                    MainWindow.Log($"Selected group deleted successfully");
                }
                catch (Exception ex)
                {
                    MainWindow.Log($"Error deleting group: {ex.Message}");
                }
            }
        }
Example #2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ScanFolderControl"/> class.
 /// </summary>
 /// <param name="group">The group.</param>
 /// <param name="mainWindow">The main window.</param>
 public ScanFolderControl(LargePersonGroupExtended group, MainWindow mainWindow)
 {
     _scanGroup  = group;
     _mainWindow = mainWindow;
     _mainWindowLogTraceWriter = new MainWindowLogTraceWriter();
     InitializeComponent();
     Loaded += ScanFolderControl_Loaded;
 }
        /// <summary>
        /// Handles the Click event of the btnAddGroup control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="RoutedEventArgs"/> instance containing the event data.</param>
        private async void btnAddGroup_Click(object sender, RoutedEventArgs e)
        {
            var groupId = Guid.NewGuid().ToString();

            //await faceServiceClient.CreateLargePersonGroupAsync(groupId, groupId);
            await RetryHelper.VoidOperationWithBasicRetryAsync(() =>
                                                               _faceServiceClient.CreateLargePersonGroupAsync(groupId, groupId),
                                                               new[] { "RateLimitExceeded" },
                                                               traceWriter : _mainWindowLogTraceWriter);

            await LoadGroups();

            SelectedGroup = FaceGroups.Where(a => a.Group.LargePersonGroupId == groupId).SingleOrDefault();
        }