public ExecuteCommandResult(ExpenseReport expenseReport, string command, IWorkflowFacilitator facilitator, IStateCommandVisitor visitor, IUserSession session, INotifier notifier)
 {
     _expenseReport = expenseReport;
     _session = session;
     _notifier = notifier;
     _command = command;
     _facilitator = facilitator;
     _visitor = visitor;
 }
Beispiel #2
0
 public ExecuteCommandResult(ExpenseReport expenseReport, string command, IWorkflowFacilitator facilitator, IStateCommandVisitor visitor, IUserSession session, INotifier notifier)
 {
     _expenseReport = expenseReport;
     _session       = session;
     _notifier      = notifier;
     _command       = command;
     _facilitator   = facilitator;
     _visitor       = visitor;
 }
Beispiel #3
0
 public ExpenseReportController(IEmployeeRepository employeeRepository,
                                IExpenseReportRepository expenseReportRepository, IExpenseReportBuilder expenseReportBuilder, IUserSession session,
                                IWorkflowFacilitator workflowFacilitator, IStateCommandVisitor stateCommandVisitor)
 {
     _employeeRepository      = employeeRepository;
     _expenseReportRepository = expenseReportRepository;
     _expenseReportBuilder    = expenseReportBuilder;
     _session             = session;
     _workflowFacilitator = workflowFacilitator;
 }
        public void Execute(IStateCommandVisitor commandVisitor)
        {
            //            Log.Info(this, "Executing");
            preExecute(commandVisitor);
            string currentUserFullName = _currentUser.GetFullName();
            _expenseReport.ChangeStatus(_currentUser, DateTime.Now, GetEndStatus());

            commandVisitor.Save(_expenseReport);

            string loweredTransitionVerb = TransitionVerbPastTense.ToLower();
            string reportNumber = _expenseReport.Number;
            string message = string.Format("You have {0} work order {1}", loweredTransitionVerb, reportNumber);
            commandVisitor.SendMessage(message);
            string debugMessage = string.Format("{0} has {1} work order {2}", currentUserFullName, loweredTransitionVerb,
                reportNumber);
            //            Log.Debug(this, debugMessage);
            postExecute(commandVisitor);

            //            Log.Info(this, "Executed");
        }
        public void Execute(IStateCommandVisitor commandVisitor)
        {
//            Log.Info(this, "Executing");
            preExecute(commandVisitor);
            string currentUserFullName = _currentUser.GetFullName();

            _expenseReport.ChangeStatus(_currentUser, DateTime.Now, GetEndStatus());

            commandVisitor.Save(_expenseReport);

            string loweredTransitionVerb = TransitionVerbPastTense.ToLower();
            string reportNumber          = _expenseReport.Number;
            string message = string.Format("You have {0} work order {1}", loweredTransitionVerb, reportNumber);

            commandVisitor.SendMessage(message);
            string debugMessage = string.Format("{0} has {1} work order {2}", currentUserFullName, loweredTransitionVerb,
                                                reportNumber);

//            Log.Debug(this, debugMessage);
            postExecute(commandVisitor);

//            Log.Info(this, "Executed");
        }
 protected abstract void postExecute(IStateCommandVisitor commandVisitor);
 protected virtual void preExecute(IStateCommandVisitor commandVisitor)
 {
 }
 protected override void postExecute(IStateCommandVisitor commandVisitor)
 {
     commandVisitor.GoToEdit(_expenseReport);
 }
 protected override void preExecute(IStateCommandVisitor commandVisitor)
 {
 }
 public void Execute(IStateCommandVisitor commandVisitor)
 {
     throw new NotImplementedException();
 }
Beispiel #11
0
 protected override void postExecute(IStateCommandVisitor commandVisitor)
 {
     commandVisitor.GoToEdit(_expenseReport);
 }
Beispiel #12
0
 protected virtual void preExecute(IStateCommandVisitor commandVisitor)
 {
 }
Beispiel #13
0
 protected abstract void postExecute(IStateCommandVisitor commandVisitor);
Beispiel #14
0
 public void Execute(IStateCommandVisitor commandVisitor)
 {
     throw new NotImplementedException();
 }
 protected override void preExecute(IStateCommandVisitor commandVisitor)
 {
 }