public async Task <bool> DeleteAsync(int id)
        {
            var check = await _checks.GetDetails(id, true);

            _checks.Delete(check);
            await _manager.RemoveSchedule(check);

            await _checks.SaveChangesAsync();

            return(true);
        }
Example #2
0
        private void DeleteButton_OnClick(object sender, RoutedEventArgs e)
        {
            var yesorno = MessageBox.Show("Are you sure do you want to Delete this record?", "Delete Record",
                                          MessageBoxButton.YesNo);

            if (yesorno == MessageBoxResult.Yes)
            {
                Check checkToRemove = _c.SelectedCheck;
                _checkRepository.Delete(checkToRemove.Id);

                DisplaySearch();
            }
        }