private DeleteEventTopicRequest CreateUsedRequest()
 {
     var request = new DeleteEventTopicRequest();
     request.Id = _existingUsedEventTopicId;
     return request;
 }
        private void DeleteRecords()
        {
            try
            {
                var selectedCount = _viewModel.SelectedIds.Count();

                var itemInUse = false;

                foreach (var id in _viewModel.SelectedIds)
                {
                    var request = new DeleteEventTopicRequest()
                    {
                        Id = int.Parse(id.ToString(), CultureInfo.InvariantCulture)
                    };

                    var response = ProcessRequest<DeleteEventTopicResponse>(request);

                    if (!response.Status)
                        itemInUse = true;
                }

                _viewModel.SelectedIds = new List<object>();

                if (itemInUse)
                {
                    var errorMessage = selectedCount > 1 ?
                        "Some or all of the Event Topics are currently in use." :
                        "Event Topic is currently in use.";

                    _viewModel.SetErrorMessage(errorMessage);
                }
                else
                {
                    var successMessage = selectedCount > 1 ?
                        "Event Topics successfully deleted." :
                        "Event Topic successfully deleted.";

                    _viewModel.SetSuccessMessage(successMessage);
                }
            }
            catch (Exception ex)
            {
                _viewModel.SetErrorMessage(ex.Message);
            }
        }