Esempio n. 1
0
        public ActionResult MarkPrepared(Guid tabId, FormCollection form)
        {
            var servedItemsPattern = new Regex("^prepared_\\d+_(\\d+)$", RegexOptions.Compiled);
            var servedMenuNumbers  =
                form.AllKeys
                .Where(key => servedItemsPattern.IsMatch(key))
                .Where(key => form[key] != "false")
                .Select(key => servedItemsPattern.Match(key))
                .Select(match => match.Groups[1].Value)
                .Select(int.Parse)
                .ToList();

            _dispatcher.DispatchCommand(
                new MarkFoodPrepared
            {
                TabId       = tabId,
                MenuNumbers = servedMenuNumbers
            });

            return(RedirectToAction("Index"));
        }
Esempio n. 2
0
        public ActionResult Open(OpenTab command)
        {
            _dispatcher.DispatchCommand(command);

            return(RedirectToAction("Order", new { id = command.TableNumber }));
        }