public bool DeletePurchaseEvent(int id) { if (PurchaseExists(id)) { purchaseRepository.DeletePurchaseEvent(id); return(true); } return(false); }
public bool AddReturnEvent(ReturnEvent ev) { if (ev == null || InvalidEventData(ev)) { return(false); } PurchaseEvent recentPurchase = GetClientRecentPurchaseOfSuchProduct(ev); if (recentPurchase == null) { return(false); } returnRepository.AddReturnEvent(ev); purchaseRepository.DeletePurchaseEvent(recentPurchase.Id); return(true); }