public CharterOut(long id, long chartererId, long ownerId, long vesselInCompanyId, long CurrencyId, DateTime actionDate, List<CharterItem> charterItems, List<InventoryOperation> inventoryOperationItems, CharterType charterType, CharterEndType charterEndType, OffHirePricingType offHirePricingType, ICharterInDomainService charterInDomainService , ICharterOutDomainService charterOutDomainService, IEventPublisher eventPublisher) : base(id, chartererId, ownerId, vesselInCompanyId, CurrencyId, actionDate, charterItems, inventoryOperationItems, charterType, charterEndType, charterInDomainService, charterOutDomainService, eventPublisher) { this.OffHirePricingType = offHirePricingType; this._eventPublisher.RegisterHandler<CharterOutApproveArg>(new InventorySubscriber()); this._eventPublisher.RegisterHandler<CharterOutFinalApproveArg>(new InventorySubscriber()); this._eventPublisher.RegisterHandler<CharterOutDisApproveArg>(new InventorySubscriber()); #region bz if (this.CharterType == CharterType.Start) { //B74 IsNotSameChatererOwner(ownerId, chartererId); //B29 IsValidateCharterOutStartProp(); //B23 IsValidStartDate(); //B2 IsValidCharterInStartDate(); //B22 IsVesselOwnedOrCharterIn(); //B28 HasVesselCharterOutStart(vesselInCompanyId); //B59 CompareOffhirePricing(); } else { //B36 CheckPeriodCharterInValid(); //B37 IsNextCharterStartDateGreaterThanActionDate(); //B31 ExistFinalApprove(); //B35 IsNotVesselCharterIn(VesselInCompanyId.Value); //B43 HasVesselCharterOutEnd(VesselInCompanyId.Value); //B45 IsValidEndDate(); //51 IsValidateCharterEnd(actionDate, CurrencyId, charterEndType); //B34 } #endregion }
internal CharterIn(long id, long chartererId, long ownerId, long vesselInCompanyId, long CurrencyId, DateTime actionDate, List<CharterItem> charterItems, List<InventoryOperation> inventoryOperationItems, CharterType charterType, CharterEndType charterEndType, OffHirePricingType offHirePricingType, ICharterInDomainService charterInDomainService, ICharterOutDomainService charterOutDomainService, IEventPublisher eventPublisher ) : base(id, chartererId, ownerId, vesselInCompanyId, CurrencyId, actionDate, charterItems, inventoryOperationItems, charterType, charterEndType, charterInDomainService, charterOutDomainService, eventPublisher) { this.OffHirePricingType = offHirePricingType; this._eventPublisher.RegisterHandler<CharterInApproveArg>(new InventorySubscriber()); this._eventPublisher.RegisterHandler<CharterInFinalApproveArg>(new InventorySubscriber()); this._eventPublisher.RegisterHandler<CharterInDisApproveArg>(new InventorySubscriber()); #region BZ if (CharterType == CharterType.Start) { //B74 IsNotSameChatererOwner(ownerId, chartererId); //B4 IsValidateCharterInStartProp(); //B17 HasVesselCharterInStart(); //B2 IsValidCharterInStartDate(); //B59 CompareOffhirePricing(); } else { //B45 IsValidEndDate(); //B48 ExistFinalApprove(); //B58 HasVesselCharterInEnd(); //B55 IsVesselCharterOut(); //B49 //B56 IsEndDateGreaterThanLastCharterOutEndDate(); } #endregion }
public CharterInApplicationService(ICharterInRepository charterInRepository, ICharterInToDtoMapper charterInToDtoMapper, IUnitOfWorkScope unitOfWorkScope, IWorkflowRepository workflowRepository, ICharterOutDomainService charterOutDomainService, ICharterInDomainService charterInDomainService, IEventPublisher eventPublisher, IVesselInCompanyDomainService vesselInCompanyDomainService, IInventoryOperationNotifier inventoryOperationNotifier) { this._charterInRepository = charterInRepository; this._charterInToDtoMapper = charterInToDtoMapper; this._unitOfWorkScope = unitOfWorkScope; _charterFactory = new CharterFactory(workflowRepository, charterInDomainService, charterOutDomainService, eventPublisher, vesselInCompanyDomainService, inventoryOperationNotifier); }
public CharterFactory(IWorkflowRepository workflowRepository, ICharterInDomainService charterInDomainService, ICharterOutDomainService charterOutDomainService, IEventPublisher eventPublisher, IVesselInCompanyDomainService vesselInCompanyDomainService, IInventoryOperationNotifier inventoryOperationNotifier) { _workflowRepository = workflowRepository; _charterInDomainService = charterInDomainService; _charterOutDomainService = charterOutDomainService; _eventPublisher = eventPublisher; this.vesselInCompanyDomainService = vesselInCompanyDomainService; this.inventoryOperationNotifier = inventoryOperationNotifier; }
public Charter(long id, long chartererId, long ownerId, long vesselInCompanyId, long CurrencyId, DateTime actionDate, List<CharterItem> charterItems, List<InventoryOperation> inventoryOperationItems, CharterType charterType, CharterEndType charterEndType, ICharterInDomainService charterInDomainService, ICharterOutDomainService charterOutDomainService , IEventPublisher eventPublisher) : this() { this.Id = id; this.ChartererId = chartererId; this.OwnerId = ownerId; this.VesselInCompanyId = vesselInCompanyId; this.CurrencyId = CurrencyId; this.ActionDate = actionDate; this.CharterItems = charterItems; this.InventoryOperationItems = inventoryOperationItems; this.CharterType = charterType; this.CharterEndType = charterEndType; _charterInDomainService = charterInDomainService; _charterOutDomainService = charterOutDomainService; _eventPublisher = eventPublisher; }
public void Resolve(ICharterInDomainService charterInDomainService, ICharterOutDomainService charterOutDomainService , IEventPublisher eventPublisher, IVesselInCompanyDomainService vesselInCompanyDomainService, IInventoryOperationNotifier inventoryOperationNotifier) { _charterInDomainService = charterInDomainService; _charterOutDomainService = charterOutDomainService; _eventPublisher = eventPublisher; InventoryOperationNotifier = inventoryOperationNotifier; VesselInCompanyDomainService = vesselInCompanyDomainService; }