/// <summary>
        /// Sends the corresponding shopping cart update response to the digital shelf.
        /// </summary>
        /// <param name="shoppingCart">The shopping cart in it's current state.</param>
        /// <param name="status">The status of the update.</param>
        /// <param name="description">The (optional) description.</param>
        private void SendResponse(IShoppingCart shoppingCart, UpdateResultStatus status, string description)
        {
            if (!_isFinished)
            {
                var response = new ShoppingCartUpdateResponseEnvelope()
                {
                    ShoppingCartUpdateResponse = new ShoppingCartUpdateResponse()
                    {
                        Id           = this.Id,
                        Source       = this.Destination,
                        Destination  = this.Source,
                        ShoppingCart = (ShoppingCart)shoppingCart,
                        UpdateResult = new UpdateResult()
                        {
                            Status      = status,
                            Description = description
                        }
                    }
                };

                if (!this.MessageObjectStream.Write(response))
                {
                    throw new ApplicationException("Sending 'ShoppingCartUpdateResponse' to digital shelf failed.");
                }

                _isFinished = true;
            }
        }
示例#2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="UpdateResult{T}"/> class.
 /// </summary>
 /// <param name="status">The <see cref="UpdateResultStatus"/> of the result</param>
 public UpdateResult(UpdateResultStatus status)
 {
     this.Status = status;
 }