private async void UxProcessTips_Click(object sender, RoutedEventArgs e) { bool success = false; foreach (Tip tip in uxTipListView.Items) { success = await DeleteTipRequest.SendDeleteTipRequest(tip._id); } if (success) { ContentDialog responseAlert = new ContentDialog { Title = "Processed", Content = "Employee tips have been processed", CloseButtonText = "Ok" }; ContentDialogResult result = await responseAlert.ShowAsync(); var validGetTips = await GetEmployeeTips.SendGetEmployeeTips(selectedEmployee._id); uxTipListView.ItemsSource = RealmManager.All <Tips>().FirstOrDefault().tip; } else { ContentDialog responseAlert = new ContentDialog { Title = "Unsuccessful", Content = "Tip processing was unsuccessful", CloseButtonText = "Ok" }; ContentDialogResult result = await responseAlert.ShowAsync(); } }
public SuccessResponse Delete(DeleteTipRequest request) { try { var tip = _tipRepository.FindBy(request.Id); tip.ThrowExceptionIfRecordIsNull(); _tipRepository.Remove(tip); return(new SuccessResponse { IsSuccess = true }); } catch (DataAccessException) { throw new ApplicationException(); } }
public SuccessResponse Delete(DeleteTipRequest request) { return(_tipService.Delete(request)); }