コード例 #1
0
 public ActionResult Close(CloseModel model)
 {
     Domain.Dispatcher.SendCommand(new CloseTab {
         Id         = Domain.OpenTabQueries.TabIdForTable(model.Id),
         AmountPaid = model.AmountPaid
     });
     return(RedirectToAction("Index", "Home"));
 }
コード例 #2
0
        public ActionResult CloseDialogAndRedirect(string url)
        {
            var model = new CloseModel
            {
                Url         = url,
                CloseAction = CloseAction.CloseAndRedirect
            };

            return(View("_CloseDialog", model));
        }
コード例 #3
0
ファイル: TabController.cs プロジェクト: sonbua/Scratchpad
        public ActionResult Close(CloseModel model)
        {
            var tabId = _dispatcher.DispatchQuery(new TabIdForTable {TableNumber = model.TableNumber});

            _dispatcher.DispatchCommand(
                new CloseTab
                {
                    TabId = tabId,
                    AmountPaid = model.AmountPaid
                });

            return RedirectToAction("Index", "Home");
        }
コード例 #4
0
ファイル: TabController.cs プロジェクト: sonbua/Reusables
        public ActionResult Close(CloseModel model)
        {
            var tabId = _dispatcher.DispatchQuery(new TabIdForTable {
                TableNumber = model.TableNumber
            });

            _dispatcher.DispatchCommand(
                new CloseTab
            {
                TabId      = tabId,
                AmountPaid = model.AmountPaid
            });

            return(RedirectToAction("Index", "Home"));
        }
コード例 #5
0
        public IActionResult Update(int id, [FromBody] CloseModel model)
        {
            var account = _mapper.Map <Account>(model);

            account.Id = id;

            try
            {
                _accountService.Close(account);
                return(Ok());
            }
            catch (AppException ex)
            {
                return(BadRequest(new { message = ex.Message }));
            }
        }