private bool DeleteData() { if (_selectedYeareId == -1) { return(false); } var dialogResult = MessageBox.Show("Delete this Account", "Warning", MessageBoxButton.YesNo, MessageBoxImage.Question); if (dialogResult != MessageBoxResult.Yes) { return(false); } try { if (AccountingService.DeleteAccountingYear(new tAccountingYear() { AccountYearId = _selectedYeareId, CompanyId = ShatedData.ApplicationState.SelectedCompanyId }) == 0) { return(false); } _selectedYeareId = -1; LoadAccountingYearData(); ClearFields(); return(true); } catch (Exception ex) { throw ex; } }