Beispiel #1
0
        public CharterIn CreateCharterIn(long id, long chartererId, long ownerId, long vesselInCompanyId, long currencyId,
                            DateTime actionDate,
                            List<CharterItem> charterItems,
                            List<InventoryOperation> inventoryOperationItems
                           , CharterType charterType, CharterEndType charterEndType, OffHirePricingType offHirePricingType)
        {
            var charterIn = new CharterIn(id, chartererId, ownerId, vesselInCompanyId,
                               currencyId, actionDate,
                               charterItems, inventoryOperationItems
                              , charterType, charterEndType, offHirePricingType,
                              _charterInDomainService, _charterOutDomainService,
                              _eventPublisher);

            var init = this._workflowRepository.Single(c => c.WorkflowEntity == WorkflowEntities.CharterIn && c.CurrentWorkflowStage == WorkflowStages.Initial);
            if (init == null)
                throw new ObjectNotFound("CharterInitialStep");

            var charterWorkflowLog = new CharterWorkflowLog(charterIn, WorkflowEntities.CharterIn, DateTime.Now, WorkflowActions.Init,
                //TODO: Fake ActorId
                1101, "", init.Id, true);

            charterIn.ApproveWorkflows.Add(charterWorkflowLog);

            return charterIn;
        }
Beispiel #2
0
 public CharterIn ResolveCharterIn(CharterIn charter)
 {
     charter.Resolve(_charterInDomainService, _charterOutDomainService, _eventPublisher, vesselInCompanyDomainService, inventoryOperationNotifier);
     return charter;
 }
Beispiel #3
0
        public CharterIn ReCreateCharterIn(CharterIn charter)
        {
            charter.Resolve(_charterInDomainService, _charterOutDomainService, _eventPublisher, vesselInCompanyDomainService, inventoryOperationNotifier);

            //var init = this._workflowRepository.Single(c => c.WorkflowEntity == WorkflowEntities.CharterIn && c.CurrentWorkflowStage == WorkflowStages.Initial);
            //if (init == null)
            //    throw new ObjectNotFound("CharterInitialStep");

            //var charterWorkflowLog = new CharterWorkflowLog(charter, WorkflowEntities.CharterIn, DateTime.Now, WorkflowActions.Init, 1, "", init.Id, true);

            //charter.ApproveWorkflows.Add(charterWorkflowLog);

            return charter;
        }