public void Submit(Scrap scrap, SubmittedState submittedState)
 {
     scrap.Submit(submittedState,
         vesselDomainService, inventoryOperationNotifier,
         tankDomainService, currencyDomainService,
         goodDomainService, goodUnitDomainService);
 }
Esempio n. 2
0
        //================================================================================
        public void Submit(SubmittedState submittedState,
            IVesselInCompanyDomainService vesselDomainService, IInventoryOperationNotifier eventNotifier,
            ITankDomainService tankDomainService, ICurrencyDomainService currencyDomainService,
            IGoodDomainService goodDomainService, IGoodUnitDomainService goodUnitDomainService)
        {
            this.validateToBeOpenOrSubmitRejected();

            this.validateApproveAction(vesselDomainService, tankDomainService, currencyDomainService, goodDomainService, goodUnitDomainService);

            //Perform Submit operations.
            //foreach (var scrapDetail in this.ScrapDetails)
            //{
            //    scrapDetail.InventoryOperations.AddRange(eventNotifier.NotifySubmittingScrapDetail(scrapDetail));
            //}

            if (this.isOpen.IsSatisfiedBy(this))
                vesselDomainService.ScrapVessel(this.VesselInCompanyId);

            var invResult = eventNotifier.NotifySubmittingScrap(this);

            this.InventoryOperations.AddRange(invResult);

            this.setState(submittedState);
        }