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);
 }
示例#2
0
        //===================================================================================
        private void setEntityState(FuelReportState entityNewState)
        {
            this.EntityState = entityNewState;

            this.State = entityNewState.State;
        }
示例#3
0
        //===================================================================================
        public void SubmittedReject(FuelReportState entityNewState)
        {
            //validateToBeEndOfVoyageFuelReport();

            CheckToBeOperational();

            validateToBeInSubmittedState();

            setEntityState(entityNewState);
        }
示例#4
0
        //===================================================================================
        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);
        }
示例#5
0
 //===================================================================================
 public void Invalidate(FuelReportState entityNewState)
 {
     setEntityState(entityNewState);
 }
示例#6
0
        //===================================================================================
        public void Close(FuelReportState entityNewState)
        {
            this.CheckToBeOperational();

            IsWaitingToBeClosed();

            setEntityState(entityNewState);
        }