コード例 #1
0
        /// <summary>
        /// Executes the command in the specified context.
        /// </summary>
        /// <param name="context">The context.</param>
        public override void Execute(CommandContext context)
        {
            string orderNumber = context.Parameters["orderNumber"];
            string statusCode  = context.Parameters["statusCode"];

            IOrderManager <Order> orderProvider = Context.Entity.Resolve <IOrderManager <Order> >();
            Order order = orderProvider.GetOrder(orderNumber);

            order.Status = Context.Entity.Resolve <OrderStatus>(statusCode);
            order.ProcessStatus();

            orderProvider.SaveOrder(order);

            ICatalogView catalogView = context.CustomData as ICatalogView;

            if (catalogView != null)
            {
                IEntity orderEntity = order as IEntity;
                if (orderEntity != null)
                {
                    catalogView.SelectedRowsId = new StringCollection {
                        orderEntity.Alias
                    };
                    catalogView.RefreshGrid();
                    catalogView.UpdateRibbon();
                }
            }
        }