Exemplo n.º 1
0
        public void Handle(OrderSubmittedEvent orderSumbiteEvent)
        {
            ClientOrderDetailsDto orderDetails = OrderFinder
                                                 .GetClientOrderDetails(orderSumbiteEvent.OrderId);

            Shipment shipment = Factory.CreateShipment(orderDetails);

            Repository.Save(shipment);
        }
Exemplo n.º 2
0
        private void DisplayMostRecentOrder()
        {
            OrderFinder finder = new OrderFinder {
                UserId = CurrentUser.UserId.GetValueOrDefault()
            };

            finder.SortExpressions.Add(new DescendingSort(Order.Columns.OrderId));
            Order order = Order.FindOne(finder);

            if (order.IsNull)
            {
                // The 'no orders' page is a little complicated as there are controls
                // scattered around, so rather than creating more complexity by showing
                // and hiding controls on this page, we just transfer to a new page.
                Server.Transfer("ViewOrdersEmpty.aspx");
            }

            DisplayOrder(order);
        }
Exemplo n.º 3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                PageSizeDropDownList1.SafeSelectValue(SessionInfo.Current.UserSessionInfo.DownloadManagerPageSize);

                int orderId = WebUtils.GetIntRequestParam("orderId", 0);

                if (orderId == 0)
                {
                    DisplayMostRecentOrder();
                }
                else
                {
                    OrderFinder finder = new OrderFinder {
                        OrderId = orderId, UserId = CurrentUser.UserId.GetValueOrDefault()
                    };
                    Order order = Order.FindOne(finder);

                    DisplayOrder(order);
                }
            }
        }
Exemplo n.º 4
0
 public ActionResult ConfirmOrder(int orderId)
 {
     return(View(OrderFinder.GetClientOrderDetails(orderId)));
 }
 public void OrderFindFinalLongTest()
 {
     OrderFinder.Calculate(2, 5).Should().Be(4);
 }
 public void OrderFindFinalTest()
 {
     OrderFinder.Calculate(2, 3).Should().Be(2);
     OrderFinder.Calculate(3, 4).Should().Be(2);
 }