public void Submit(FuelReport fuelReport, FuelReportState entityNewState) { fuelReport.Submit( entityNewState, this.voyageDomainService, this.fuelReportDomainService, this.inventoryOperationDomainService, this.goodDomainService, this.orderDomainService, this.currencyDomainService, this.balanceDomainService, inventoryManagementDomainService, this.inventoryOperationNotifier); }
//=================================================================================== private void setEntityState(FuelReportState entityNewState) { this.EntityState = entityNewState; this.State = entityNewState.State; }
//=================================================================================== public void SubmittedReject(FuelReportState entityNewState) { //validateToBeEndOfVoyageFuelReport(); CheckToBeOperational(); validateToBeInSubmittedState(); setEntityState(entityNewState); }
//=================================================================================== public void Submit( FuelReportState entityNewState, IVoyageDomainService voyageDomainService, IFuelReportDomainService fuelReportDomainService, IInventoryOperationDomainService inventoryOperationDomainService, IGoodDomainService goodDomainService, IOrderDomainService orderDomainService, ICurrencyDomainService currencyDomainService, IBalanceDomainService balanceDomainService, IInventoryManagementDomainService inventoryManagementDomainService, IInventoryOperationNotifier inventoryOperationNotifier) { this.CheckToBeOperational(); validateSubmittingState( voyageDomainService, fuelReportDomainService, inventoryOperationDomainService, goodDomainService, orderDomainService, currencyDomainService, inventoryManagementDomainService); sendDataToBalancingDomainService(balanceDomainService); if (this.FuelReportType == FuelReportTypes.EndOfVoyage || this.FuelReportType == FuelReportTypes.EndOfYear || this.FuelReportType == FuelReportTypes.EndOfMonth) { var inventoryResult = inventoryOperationNotifier.NotifySubmittingFuelReportConsumption(this); this.ConsumptionInventoryOperations.Add(inventoryResult); } else { foreach (var fuelReportDetail in this.FuelReportDetails) { var inventoryResult = inventoryOperationNotifier.NotifySubmittingFuelReportDetail(fuelReportDetail, fuelReportDomainService); if (inventoryResult != null) fuelReportDetail.InventoryOperations.AddRange(inventoryResult); } } setEntityState(entityNewState); }
//=================================================================================== public void Invalidate(FuelReportState entityNewState) { setEntityState(entityNewState); }
//=================================================================================== public void Close(FuelReportState entityNewState) { this.CheckToBeOperational(); IsWaitingToBeClosed(); setEntityState(entityNewState); }