public void Delete(Data.SOTax entity) { try { if (entity == null) { return; } this.Table.Remove(entity); this.SubmitChanges(); } catch { throw; } }
private void btn_click(object sender, RoutedEventArgs e) { try { var soTax = Business.GetSOTaxBusiness().GetByFinancialYearBaseInfo(cmbFinancialYear.SelectedValue.ToGUID(), cmbBaseInfo.SelectedValue.ToGUID()); if (soTax == null) { soTax = new Data.SOTax() { IdBaseinfo = cmbBaseInfo.SelectedValue.ToGUID(), IdFinancialMainYear = cmbFinancialYear.SelectedValue.ToGUID(), } } ; soTax.Percent = txtPercent.Text.ToDecimal(); Business.GetSOTaxBusiness().Save(soTax); this.Close(); } catch { throw; } }