Created
January 17, 2019 22:45
-
-
Save MarcoNicolodi/fb46c081460e3f838d7870a4a8680219 to your computer and use it in GitHub Desktop.
Chain of responsibility
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class CriteriaHasEvaluation : RuleHandler { | |
public override Label Run(Request request) | |
{ | |
if(request.CriteriaHasEvaluation) | |
{ | |
return request.Evaluation.IsEvaluated | |
? request.Approve | |
? request.Evaluation.IsApproved | |
? Label.Approved | |
: Label.ApprovedOff | |
: !request.Evaluation.IsApproved | |
? Label.ReprovedOn | |
: Label.ReprovedOff | |
: request.Approve | |
? Label.ReprovedOff | |
: Label.ReprovedOff; | |
} else { | |
return base.Run(request); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment