public void Delete(Data.Treasury entity) { try { if (entity == null) { return; } using (var scope = new TransactionScope(TransactionScopeOption.Required, new TransactionOptions() { IsolationLevel = System.Transactions.IsolationLevel.ReadUncommitted, Timeout = new TimeSpan(2, 0, 0) })) { Business.GetTreasuryDetailBusiness().Delete(Business.GetTreasuryDetailBusiness().GetByTreasuryId(entity.ID).ToList()); this.Table.Remove(entity); this.SubmitChanges(); scope.Complete(); } } catch { throw; } }
public void Save(Data.Treasury entity) { try { if (entity.ID == Guid.Empty) { entity.ID = Guid.NewGuid(); entity.LastEdit = DateTime.Now; this.Table.Add(entity); } this.SubmitChanges(); } catch { throw; } }