Exemple #1
0
        public void Handle(OutboxManagementNeeded @event)
        {
            var urgentMessage = _dispatcher.DispatchQuery(new MostUrgentMessage());

            if (urgentMessage.HasValue)
            {
                _eventPublisher.Publish(new DeliveryReady {
                    Message = urgentMessage.Value
                });
            }
        }
Exemple #2
0
        public ActionResult Order(int id, OrderModel orderModel)
        {
            _dispatcher.DispatchCommand(new PlaceOrder
            {
                TabId = _dispatcher.DispatchQuery(new TabIdForTable {
                    TableNumber = id
                }),
                Items = OrderedItems(orderModel).ToList()
            });

            return(RedirectToAction("Status", new { id = id }));
        }
Exemple #3
0
        public ActionResult Todo(string id)
        {
            var tabItems = _dispatcher.DispatchQuery(new TodoListForWaiter {
                StaffId = id
            });

            ViewBag.Waiter = id;

            return(View(tabItems));
        }
        public override void OnResultExecuting(ResultExecutingContext filterContext)
        {
            var viewResult = filterContext.Result as ViewResult;

            if (viewResult != null)
            {
                var bag = viewResult.ViewBag;

                bag.WaitStaff    = StaticData.WaitStaff;
                bag.ActiveTables = _dispatcher.DispatchQuery(new ActiveTableNumbers());
            }
        }
Exemple #5
0
        public ActionResult Index()
        {
            var todoLists = _dispatcher.DispatchQuery(new GetTodoLists());

            return(View(todoLists));
        }