public void Finish(ShoppingCartContent shoppingCart,
                           ShoppingCartUpdateResult result)
        {
            this.OnStateChange();

            this.Workflow.SendResponse(new ShoppingCartUpdateResponse(this.Request, shoppingCart, result));
        }
示例#2
0
 public ShoppingCartResponse(ShoppingCartRequest request,
                             ShoppingCartContent shoppingCart)
     :
     base(request)
 {
     this.ShoppingCart = shoppingCart;
 }
        public Task FinishAsync(ShoppingCartContent shoppingCart,
                                ShoppingCartUpdateResult result,
                                CancellationToken cancellationToken = default)
        {
            this.OnStateChange();

            return(this.Workflow.SendResponseAsync(new ShoppingCartUpdateResponse(this.Request, shoppingCart, result), cancellationToken));
        }
示例#4
0
        public static bool Equals(ShoppingCartUpdateMessage?left, ShoppingCartUpdateMessage?right)
        {
            bool result = SubscribedMessage.Equals(left, right);

            result &= (result ? ShoppingCartContent.Equals(left?.ShoppingCart, right?.ShoppingCart) : false);

            return(result);
        }
示例#5
0
        public static bool Equals(ShoppingCartResponse?left, ShoppingCartResponse?right)
        {
            bool result = SubscribedResponse.Equals(left, right);

            result &= (result ? ShoppingCartContent.Equals(left?.ShoppingCart, right?.ShoppingCart) : false);

            return(result);
        }
示例#6
0
 public ShoppingCartResponse(MessageId id,
                             SubscriberId source,
                             SubscriberId destination,
                             ShoppingCartContent shoppingCart)
     :
     base(id, ExperimentalDialogs.ShoppingCart, source, destination)
 {
     this.ShoppingCart = shoppingCart;
 }
示例#7
0
 public ShoppingCartUpdateResponse(ShoppingCartUpdateRequest request,
                                   ShoppingCartContent shoppingCart,
                                   ShoppingCartUpdateResult result)
     :
     base(request)
 {
     this.ShoppingCart = shoppingCart;
     this.Result       = result;
 }
 private ShoppingCartUpdateMessage CreateMessage(ShoppingCartContent shoppingCart)
 {
     return(this.CreateMessage((MessageId id,
                                SubscriberId localSubscriberId,
                                SubscriberId remoteSubscriberId) =>
     {
         return new ShoppingCartUpdateMessage(id, localSubscriberId, remoteSubscriberId, shoppingCart);
     }));
 }
    /// <summary>
    /// Handle the visibility of the control.
    /// </summary>
    protected override void OnPreRender(EventArgs e)
    {
        base.OnPreRender(e);

        bool ItemIsProductOption   = (ShoppingCartItemInfoObject != null) && ShoppingCartItemInfoObject.IsProductOption;
        bool CartContentIsReadOnly = ValidationHelper.GetBoolean(ShoppingCartContent.GetValue("ReadOnlyMode"), false);

        // Remove is invisible for product option or in ReadOnly mode
        btnRemove.Visible = !(ItemIsProductOption || CartContentIsReadOnly);
    }
        public Task NotifyContentChangeAsync(ShoppingCartContent shoppingCart, CancellationToken cancellationToken = default)
        {
            ShoppingCartUpdateMessage message = this.CreateMessage(shoppingCart);

            return(this.SendMessageAsync(message,
                                         () =>
            {
                return this.Dialog.SendMessageAsync(message, cancellationToken);
            }));
        }
        public void NotifyContentChange(ShoppingCartContent shoppingCart)
        {
            ShoppingCartUpdateMessage message = this.CreateMessage(shoppingCart);

            this.SendMessage(message,
                             () =>
            {
                this.Dialog.SendMessage(message);
            });
        }
        public IShoppingCartUpdateFinishedProcessState StartProcess(ShoppingCartContent shoppingCart)
        {
            ShoppingCartUpdateRequest request = this.CreateRequest(shoppingCart);

            ShoppingCartUpdateResponse response = this.SendRequest(request,
                                                                   () =>
            {
                return(this.Dialog.SendRequest(request));
            });

            return(new ShoppingCartUpdateFinishedProcessState(request, response));
        }
 private ShoppingCartUpdateRequest CreateRequest(ShoppingCartContent shoppingCart)
 {
     return(this.CreateRequest((MessageId messageId,
                                SubscriberId localSubscriberId,
                                SubscriberId remoteSubscriberId) =>
     {
         return new ShoppingCartUpdateRequest(messageId,
                                              localSubscriberId,
                                              remoteSubscriberId,
                                              shoppingCart);
     }));
 }
 /// <summary>
 /// Handle the visibility of the control.
 /// </summary>
 protected override void OnPreRender(EventArgs e)
 {
     try
     {
         base.OnPreRender(e);
         cart = ShoppingCartInfoProvider.GetShoppingCartInfo(CartID);
         bool ItemIsProductOption =
             (ShoppingCartItemInfoObject != null) && ShoppingCartItemInfoObject.IsProductOption;
         bool CartContentIsReadOnly =
             ValidationHelper.GetBoolean(ShoppingCartContent.GetValue("ReadOnlyMode"), false);
         btnRemoveItem.Visible = !(ItemIsProductOption || CartContentIsReadOnly);
     }
     catch (Exception ex)
     {
         EventLogProvider.LogInformation("Kadena_CMSWebParts_Kadena_Cart_RemoveItemFromCart", "OnPreRender", ex.Message);
     }
 }
        public async Task <IShoppingCartUpdateFinishedProcessState> StartProcessAsync(ShoppingCartContent shoppingCart, CancellationToken cancellationToken = default)
        {
            ShoppingCartUpdateRequest request = this.CreateRequest(shoppingCart);

            ShoppingCartUpdateResponse response = await this.SendRequestAsync(request,
                                                                              () =>
            {
                return(this.Dialog.SendRequestAsync(request, cancellationToken));
            }).ConfigureAwait(continueOnCapturedContext: false);

            return(new ShoppingCartUpdateFinishedProcessState(request, response));
        }