public ApprovalResponse Approve(IExpenseReport expenseReport) { var response = _approver.ApproveExpense(expenseReport); return(response == ApprovalResponse.Denied ? _next.Approve(expenseReport) : response); }
public ApprovalResponse Approve(IExpenseReport expenseReport) { var response = _expenseApprover.ApproveExpense(expenseReport); return(response == ApprovalResponse.BeyondApprovalLimit ? _expenseHandler.Approve(expenseReport) : response); }
public ApprovalResponse Approve(IExpenseReport expenseReport) { ApprovalResponse response = _approver.ApproveExpense(expenseReport); return(response == ApprovalResponse.BeyondApprovalLimit ? _next.Approve(expenseReport) : response); }
public ApprovalResponse Approve(IExpenseReport expense) { ApprovalResponse response = _approver.ApproveExpense(expense); if (response == ApprovalResponse.BeyondApprovalLimit) { return(_next.Approve(expense)); } return(response); }
public ApprovalResponse Approve(Expense expense) { var response = _approver.ApproveExpense(expense); if (response == ApprovalResponse.BeyondApprovalLimit) { return(_next.Approve(expense)); } return(response); }
public ApprovalResponse Approve(IExpenseReport expenseReport) { ApprovalResponse response = _approver.ApproveExpense(expenseReport); if (response == ApprovalResponse.BeyondApprovalLimit) { return(_next.Approve(expenseReport)); } Console.WriteLine($"Approved by {(_approver as Employee).Name}"); return(response); }
//################################################################################ #region IExpenseHandler Implementation ApprovalResponse IExpenseHandler.Approve(IExpenseReport expenseReport, out string approverName) { approverName = m_Approver.Name; var response = m_Approver.ApproveExpense(expenseReport); if (response == ApprovalResponse.BeyondApprovalLimit) { return(m_NextHandler.Approve(expenseReport, out approverName)); } return(response); }
public ApprovalResponse HandleExpense(IExpenseReport expenseReport) { var response = _expenseApprover.ApproveExpense(expenseReport); if (response != ApprovalResponse.BeyondApprovalLimit) { Console.WriteLine($"The request was {response} by {_expenseApprover.Name}"); } else { if (_successor == null) { Console.WriteLine("No one was able to approve your expense."); } else { _successor.HandleExpense(expenseReport); } } return(response); }