public void Accept(Judge decisionBy) { if (Status == CallForSpeechStatus.AcceptedByJudge) { throw new ApplicationException("You already Accepted this CallForSpeech"); } if (Status == CallForSpeechStatus.Rejected) { throw new ApplicationException("Cannot accept application that is already rejected"); } if (Status != CallForSpeechStatus.PreliminaryAcceptedByJudge) { throw new ApplicationException("Cannot accept application that wasn't PreliminaryAccepted FIRST"); } if (ScoreResult == null) { throw new ApplicationException("Cannot accept application before scoring"); } if (!decisionBy.CanAccept(this.Category.Id)) { throw new ApplicationException("Judge is from diffrent category. Can't Accept"); } Status = CallForSpeechStatus.AcceptedByJudge; FinalDecision = new Decision(AppTime.Now(), decisionBy); }
public ExecutionStatus TryPreliminaryAccept(Judge decisionBy) { if (Status == CallForSpeechStatus.PreliminaryAcceptedByJudge) { return(ExecutionStatus. LogicError("You already PreliminaryAcceptedByJudge this CallForSpeech")); } if (Status != CallForSpeechStatus.EvaluatedByMachine) { return(ExecutionStatus.LogicError("Cannot accept application that WASNT'T in EvaluatedByMachine")); } if (ScoreResult == null) { return(ExecutionStatus.LogicError("Cannot accept application before scoring")); } if (!decisionBy.CanAccept(this.Category.Id)) { return(ExecutionStatus. LogicError("Judge is from diffrent category. Can't Accept")); } Status = CallForSpeechStatus.PreliminaryAcceptedByJudge; PreliminaryDecision = new Decision(AppTime.Now(), decisionBy); return(ExecutionStatus.LogicOk()); }
public void Reject(Judge decisionBy) { if (Status == CallForSpeechStatus.Rejected || Status == CallForSpeechStatus.AcceptedByJudge) { throw new ApplicationException("Cannot reject application that is already accepted or rejected"); } if (!decisionBy.CanAccept(this.Category.Id)) { throw new ApplicationException("Judge is from diffrent category. Can't Accept"); } Status = CallForSpeechStatus.Rejected; FinalDecision = new Decision(AppTime.Now(), decisionBy); }
public ExecutionStatus TryReject(Judge decisionBy) { if (Status == CallForSpeechStatus.Rejected || Status == CallForSpeechStatus.AcceptedByJudge) { return(ExecutionStatus. LogicError("Cannot reject application that is already accepted or rejected")); } if (!decisionBy.CanAccept(this.Category.Id)) { return(ExecutionStatus. LogicError("Judge is from diffrent category. Can't Accept")); } Status = CallForSpeechStatus.Rejected; FinalDecision = new Decision(AppTime.Now(), decisionBy); return(ExecutionStatus.LogicOk()); }