コード例 #1
0
        public bool DeletePurchaseEvent(int id)
        {
            if (PurchaseExists(id))
            {
                purchaseRepository.DeletePurchaseEvent(id);
                return(true);
            }

            return(false);
        }
コード例 #2
0
        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);
        }