public bool DeleteInvoice(Invoice invoice) { _rInvoice.Remove(invoice); var result = _uow.SaveChanges(); if (result > 0) return true; else return false; }
public bool SaveInvoice(Invoice invoice) { try { if (invoice.Id == 0) { _rInvoice.Add(invoice); } else { _uow.Entry(invoice).State = EntityState.Modified; } var result = _uow.SaveChanges(); if (result > 0) return true; else return false; } catch (Exception) { return false; } }
public void Update(Invoice obj) { Remove(obj); Add(obj); }
public void Remove(Invoice obj) { _repositoryInvoice.Remove(_repositoryInvoice.FirstOrDefault(f => f.Id == obj.Id)); }
public void Add(Invoice obj) { _repositoryInvoice.Add(obj); }
public void Update(Invoice obj) { _repository.Update(obj); }
public void Remove(Invoice obj) { _repository.Remove(obj); }
public Rule GetRule(Invoice invoice) { var list = _rules.Values.ToList(); return list.FirstOrDefault(c => c.Apply(invoice)); }