public override void Cancel(Offhire offhire) { ApprovableDomainService.Cancel(offhire, (CancelledState)this.OffhireStateFactory.CreateCancelledState()); }
public Offhire CreateOffhire( long referenceNumber, DateTime startDateTime, DateTime endDateTime, Company introducer, VesselInCompany vesselInCompany, Voyage voyage, ActivityLocation offhireLocation, DateTime voucherDate, Currency voucherCurrency) { var offhire = new Offhire( referenceNumber, startDateTime, endDateTime, introducer, vesselInCompany, voyage, offhireLocation, voucherDate, voucherCurrency, this.offhireDomainService, this.offhireManagementSystemDomainService, this.vesselDomainService, this.voyageDomainService, this.companyDomainService, this.activityLocationDomainService, this.currencyDomainService); var init = this.workflowRepository.Single(c => c.WorkflowEntity == WorkflowEntities.Offhire && c.CurrentWorkflowStage == WorkflowStages.Initial); if (init == null) throw new ObjectNotFound("OffhireInitialStep"); var offhireWorkflow = new OffhireWorkflowLog(offhire, WorkflowEntities.Offhire, DateTime.Now, WorkflowActions.Init, //TODO: Fake ActorId 1101, "", init.Id, true); offhire.ApproveWorkflows.Add(offhireWorkflow); offhireConfigurator.Configure(offhire); return offhire; }
public override void Approve(Offhire offhire) { ApprovableDomainService.Submit(offhire, (SubmittedState)this.OffhireStateFactory.CreateSubmittedState()); }
public OffhireDetail CreateOffhireDetail(decimal quantity, decimal feeInVoucherCurrency, decimal feeInMainCurrency, Good good, GoodUnit unit, Tank tank, Offhire offhire) { var offhireDetail = new OffhireDetail( quantity, feeInVoucherCurrency, feeInMainCurrency, good, unit, tank, offhire, offhireDomainService, tankDomainService, currencyDomainService, goodDomainService, goodUnitDomainService); return offhireDetail; }
public virtual void Reject(Offhire offhire) { throw new InvalidStateException("Reject", string.Format("Cannot Reject {0} State", offhire.State.ToString())); }
public virtual void Cancel(Offhire offhire) { throw new InvalidStateException("Cancel", string.Format("Cannot Cancel {0} State", offhire.State.ToString())); }
public virtual void Approve(Offhire offhire/*, IApprovableFuelReportDomainService approveService*/) { throw new InvalidStateException("Approve", string.Format("Cannot Approve {0} State", offhire.State.ToString())); }
public override void Approve(Offhire offhire) { ApprovableDomainService.Close(offhire, (ClosedState)this.OffhireStateFactory.CreateClosedState()); }