Exemplo n.º 1
0
        public override void ExecuteResult(ControllerContext context)
        {
            IStateCommand[] commands        = _facilitator.GetValidStateCommands(_expenseReport, _session.GetCurrentUser());
            IStateCommand   matchingCommand =
                Array.Find(commands, delegate(IStateCommand obj) { return(obj.Matches(_command)); });

            matchingCommand.Execute(_visitor);

            context.Controller.TempData["Flash"] = _session.PopUserMessage();
        }
Exemplo n.º 2
0
        public ExecuteTransitionResult Handle(ExecuteTransitionCommand command)
        {
            IStateCommand[] commands        = new WorkflowFacilitator().GetValidStateCommands(command);
            IStateCommand   matchingCommand =
                Array.Find(commands, delegate(IStateCommand obj) { return(obj.Matches(command.Command)); });

            matchingCommand.Execute(command);

            _bus.Send(new ExpenseReportSaveCommand {
                ExpenseReport = command.Report
            });
            _bus.Send(new AddExpenseReportFactCommand(new ExpenseReportFact(command.Report, command.CurrentDate)));

            return(new ExecuteTransitionResult
            {
                NewStatus = command.Report.Status.FriendlyName,
                NextStep = NextStep.Edit
            });
        }
Exemplo n.º 3
0
 public void ExecuteCommand()
 {
     _command.Execute();
 }