예제 #1
0
        public void RemoveItem(string documentId, string cartId)
        {
            CartItem cartItem;
            CheckOut checkOut;

            try
            {
                cartItem = _cartItemRepository.GetCart(documentId, cartId);
            }
            catch (Exception e)
            {
                throw new UnityException("Unable to retrieve cart item", e);
            }

            try
            {
                checkOut = _checkOutRepository.GetCheckOut(cartItem.Document.DocumentId);
            }
            catch (Exception e)
            {
                throw new UnityException("Unable to get check out", e);
            }

            try
            {
                _cartItemRepository.Delete(cartItem);
            }
            catch (Exception e)
            {
                throw new UnityException("Unable to delete cart item", e);
            }

            try
            {
                _checkOutRepository.Delete(checkOut);
            }
            catch (Exception e)
            {
                throw new UnityException("Unable to delete check out");
            }
        }
예제 #2
0
        public bool IsDocumentCheckedOut(string documentId)
        {
            bool checkedOut = false;

            var currentCheckOut = _checkOutRepository.GetCheckOut(documentId);

            if (currentCheckOut != null)
            {
                checkedOut = true;
            }

            return(checkedOut);
        }