コード例 #1
0
        public void DeleteOrder(int id)
        {
            repository.Remove(id);

            // Notify all Staff that orders table was updated
            OrdersHub.NotifyOrdersUpdateToAllClient();
        }
コード例 #2
0
        public bool UpdateOrder(Order order)
        {
            var result = repository.Update(order);

            // Notify all Staff that orders table was updated
            OrdersHub.NotifyOrdersUpdateToAllClient();

            return(result);
        }
コード例 #3
0
        public ViewResult Checkout(Cart cart, Order order)
        {
            if (cart.Lines.Count() == 0)
            {
                ModelState.AddModelError("", "Извините, ваша корзина пуста!");
            }

            if (ModelState.IsValid)
            {
                orderProcessor.ProcessOrder(cart, order);
                cart.Clear();

                // Notify all Staff that orders table was updated
                OrdersHub.NotifyOrdersUpdateToAllClient();

                return(View("Completed"));
            }
            else
            {
                return(View(order));
            }
        }