public void DeleteOrder(int id)
        {
            repository.Remove(id);

            // Notify all Staff that orders table was updated
            OrdersHub.NotifyOrdersUpdateToAllClient();
        }
        public bool UpdateOrder(Order order)
        {
            var result = repository.Update(order);

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

            return(result);
        }
Beispiel #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));
            }
        }