public ApprovableOffhireDomainService( IOffhireDomainService offhireDomainService, IFinanceNotifier eventNotifier, ITankDomainService tankDomainService, ICurrencyDomainService currencyDomainService, IGoodDomainService goodDomainService, IGoodUnitDomainService goodUnitDomainService) { this.offhireDomainService = offhireDomainService; this.eventNotifier = eventNotifier; this.tankDomainService = tankDomainService; this.currencyDomainService = currencyDomainService; this.goodDomainService = goodDomainService; this.goodUnitDomainService = goodUnitDomainService; }
//================================================================================ public void Submit(SubmittedState submittedState, IOffhireDomainService offhireDomainService, IFinanceNotifier eventNotifier, ITankDomainService tankDomainService, ICurrencyDomainService currencyDomainService, IGoodDomainService goodDomainService, IGoodUnitDomainService goodUnitDomainService) { this.validateToBeOpenOrSubmitRejected(); this.validateApproveAction(offhireDomainService, tankDomainService, currencyDomainService, goodDomainService, goodUnitDomainService); //Perform Submit operations. eventNotifier.NotifySubmittingOffhire(this); this.setState(submittedState); }
//================================================================================ public void Cancel(CancelledState cancelledState, IFinanceNotifier eventNotifier) { this.setState(cancelledState); eventNotifier.NotifyOffhireCancelled(this); }