public InventoryOperationDomainService( IInventoryOperationRepository inventoryOperationRepository, IScrapDomainService scrapDomainService) { this.inventoryOperationRepository = inventoryOperationRepository; this.scrapDomainService = scrapDomainService; }
public ScrapFacadeService( IScrapApplicationService scrapApplicationService, IScrapDomainService scrapDomainService, IScrapToScrapDtoMapper scrapDtoMapper, IScrapDetailToScrapDetailDtoMapper scrapDetailDtoMapper, IInventoryOperationDomainService inventoryOperationDomainService, IInventoryOperationToInventoryOperationDtoMapper inventoryOperationDtoMapper) { this.scrapApplicationService = scrapApplicationService; this.scrapDomainService = scrapDomainService; this.scrapDtoMapper = scrapDtoMapper; this.scrapDetailDtoMapper = scrapDetailDtoMapper; this.inventoryOperationDomainService = inventoryOperationDomainService; this.inventoryOperationDtoMapper = inventoryOperationDtoMapper; }
internal ScrapDetail(double rob, double price, Currency currency, Good good, GoodUnit unit, Tank tank, Scrap scrap, IScrapDomainService scrapDomainService, ITankDomainService tankDomainService, ICurrencyDomainService currencyDomainService, IGoodDomainService goodDomainService, IGoodUnitDomainService goodUnitDomainService) : this() { this.validateScrap(scrap, scrapDomainService); this.validateValues(rob, price, currency, good, unit, tank, scrap, tankDomainService, currencyDomainService, goodDomainService, goodUnitDomainService); this.ROB = rob; this.Price = price; this.Currency = currency; this.Good = good; this.Unit = unit; this.Tank = tank; this.Scrap = scrap; }
internal Scrap( VesselInCompany vesselInCompany, Company secondParty, DateTime scrapDate, IScrapDomainService scrapDomainService, IVesselInCompanyDomainService vesselDomainService, ICompanyDomainService companyDomainService) : this() { this.validateCreation(vesselInCompany, secondParty, scrapDate, scrapDomainService, vesselDomainService, companyDomainService); this.ScrapDate = scrapDate; this.VesselInCompany = vesselInCompany; this.SecondParty = secondParty; this.ScrapDetails = new List<ScrapDetail>(); this.ApproveWorkflows = new List<ScrapWorkflowLog>(); }
public ScrapFactory( IEntityConfigurator<Scrap> scrapConfigurator, IWorkflowRepository workflowRepository, IScrapDomainService scrapDomainService, IVesselInCompanyDomainService vesselDomainService, ICompanyDomainService companyDomainService, ITankDomainService tankDomainService, ICurrencyDomainService currencyDomainService, IGoodDomainService goodDomainService, IGoodUnitDomainService goodUnitDomainService) { this.scrapConfigurator = scrapConfigurator; this.workflowRepository = workflowRepository; this.vesselDomainService = vesselDomainService; this.companyDomainService = companyDomainService; this.tankDomainService = tankDomainService; this.currencyDomainService = currencyDomainService; this.goodDomainService = goodDomainService; this.goodUnitDomainService = goodUnitDomainService; this.scrapDomainService = scrapDomainService; }
public ScrapApplicationService( IScrapFactory scrapFactory, IScrapRepository scrapRepository, IUnitOfWorkScope unitOfWorkScope, IScrapDomainService scrapDomainService, IVesselInCompanyDomainService vesselDomianService, ICompanyDomainService companyDomainService, ICurrencyDomainService currencyDomainService, IGoodDomainService goodDomainService, IGoodUnitDomainService goodUnitDomainService, ITankDomainService tankDomainService) { this.scrapFactory = scrapFactory; this.scrapRepository = scrapRepository; this.unitOfWorkScope = unitOfWorkScope; this.scrapDomainService = scrapDomainService; this.vesselDomianService = vesselDomianService; this.companyDomainService = companyDomainService; this.currencyDomainService = currencyDomainService; this.goodDomainService = goodDomainService; this.goodUnitDomainService = goodUnitDomainService; this.tankDomainService = tankDomainService; }
//================================================================================ private void validateScrap(Scrap scrap, IScrapDomainService scrapDomainService) { if (scrap == null) throw new InvalidArgument("Scrap"); if (scrapDomainService.Get(scrap.Id) == null) throw new ObjectNotFound("Scrap", scrap.Id); }
//================================================================================ private void validateUpdate( VesselInCompany vesselInCompany, Company secondParty, DateTime scrapDate, IScrapDomainService scrapDomainService, IVesselInCompanyDomainService vesselDomainService, ICompanyDomainService companyDomainService) { this.validateToBeOpen(); this.validateCompanyExistance(secondParty, companyDomainService); this.validateVesselExistance(vesselInCompany, vesselDomainService); this.validateVesselOwnedState(vesselInCompany, vesselDomainService); this.validateScrapDateToBeAfterTheLastVesselActivity(scrapDate, vesselInCompany, vesselDomainService); this.validateToBeTheOnlyScrapForVessel(vesselInCompany, scrapDomainService); }
//================================================================================ private void validateToBeTheOnlyScrapForVessel(VesselInCompany vesselInCompany, IScrapDomainService scrapDomainService) { List<Scrap> notCancelledScraps = scrapDomainService.GetNotCancelledScrapsForVessel(vesselInCompany, this.Id); if (notCancelledScraps.Count != 0) { throw new BusinessRuleException("", "There is already another Scrap defined for the Vessel."); } }
//================================================================================ public void Update( VesselInCompany vesselInCompany, Company secondParty, DateTime scrapDate, IScrapDomainService scrapDomainService, IVesselInCompanyDomainService vesselDomainService, ICompanyDomainService companyDomainService) { this.validateUpdate(vesselInCompany, secondParty, scrapDate, scrapDomainService, vesselDomainService, companyDomainService); this.VesselInCompany = vesselInCompany; this.SecondParty = secondParty; this.ScrapDate = scrapDate; }
//================================================================================ public void DeleteDetail(long scrapDetailId, IScrapDomainService scrapDomainService) { this.validateDetailDeletion(scrapDetailId); ScrapDetail scrapDetailToDelete = this.findDetail(scrapDetailId); scrapDomainService.DeleteScrapDetail(scrapDetailToDelete); }
//================================================================================ public void Delete(IScrapDomainService scrapDomainService) { this.validateDeletion(); scrapDomainService.Delete(this); }