private void mnu_reg_Click_1(object sender, RoutedEventArgs e) { MessageBoxResult m = MessageBox.Show("آیا مایل به حذف رکورد میباشید" + Environment.NewLine + "", "حذف رکورد", MessageBoxButton.YesNo, MessageBoxImage.Question); if (m == MessageBoxResult.Yes) { var id = (grid_AccountiTafsilLevels.SelectedValue as dynamic).Id; AccountingMoeinTafsilRelation deleteItem = Business.GetAccountingMoeinTafsilRelationBussiness().GetByTafsilID(id, parentID); Business.GetAccountingMoeinTafsilRelationBussiness().Delete(deleteItem); var tafsil = Business.GetAccountingMoeinTafsilRelationBussiness().GetByMoeinID((Guid)cmb_sotoheTafsili.SelectedValue).Select(r => r.AccountingTafsil_ID); RefreshGrid(tafsil); } }
public void Delete(AccountingMoeinTafsilRelation entity) { try { if (entity == null) { return; } this.Table.Remove(entity); this.SubmitChanges(); } catch { throw; } }