예제 #1
0
        /// <summary>
        /// Sets <paramref name="configurator"/> Required to true
        /// </summary>
        public static IEntityConfigurator <T> IsRequired <T>(this IEntityConfigurator <T> configurator)
            where T : Entity
        {
            configurator.Required = true;

            return(configurator);
        }
        //    private readonly IApprovableDomainService _approvableDomainService;
        //    private readonly IGoodPartyAssignmentDomainService _goodPartyAssignmentDomainService;
        public OrderApplicationService(IOrderRepository orderRepository,
                                       IUnitOfWorkScope unitOfWorkScope,
            //  IGoodPartyAssignmentDomainService goodPartyAssignmentDomainService,
                                       //IFuelUserRepository userRepository,
                                       IVesselInCompanyDomainService vesselDomainService,
                                       IGoodDomainService goodDomainService,
                                       IOrderFactory iOrderFactory,
                                       ICompanyDomainService companyDomainService,
                                       IOrderItemDomainService orderItemDomainService,
                                       IEntityConfigurator<Order> orderConfigurator
            //,IApprovableDomainService approvableDomainService
            )
        {
            this.orderRepository = orderRepository;
            this.vesselDomainService = vesselDomainService;
            this.goodDomainService = goodDomainService;
            this.iOrderFactory = iOrderFactory;
            this.unitOfWorkScope = unitOfWorkScope;
            this.companyDomainService = companyDomainService;

            this.orderItemDomainService = orderItemDomainService;
            this.orderConfigurator = orderConfigurator;
            // _approvableDomainService = approvableDomainService;
            //  _goodPartyAssignmentDomainService = goodPartyAssignmentDomainService;
        }
        public OffhireApplicationService(
            IOffhireFactory offhireFactory,
            IOffhireRepository offhireRepository,
            IUnitOfWorkScope unitOfWorkScope,
            IOffhireDomainService offhireDomainService,
            IEntityConfigurator<Offhire> offhireConfigurator,
            IVesselInCompanyDomainService vesselDomianService,
            IVoyageDomainService voyageDomianService,
            ICompanyDomainService companyDomainService,
            ICurrencyDomainService currencyDomainService,
            IGoodDomainService goodDomainService,
            IGoodUnitDomainService goodUnitDomainService,
            ITankDomainService tankDomainService,
            IActivityLocationDomainService activityLocationDomainService,
            IOffhireManagementSystemDomainService offhireManagementSystemDomainService)
        {
            this.offhireFactory = offhireFactory;
            this.offhireRepository = offhireRepository;
            this.unitOfWorkScope = unitOfWorkScope;

            this.offhireDomainService = offhireDomainService;
            this.vesselDomianService = vesselDomianService;
            this.companyDomainService = companyDomainService;
            this.currencyDomainService = currencyDomainService;
            this.goodDomainService = goodDomainService;
            this.goodUnitDomainService = goodUnitDomainService;
            this.tankDomainService = tankDomainService;
            this.activityLocationDomainService = activityLocationDomainService;
            this.offhireManagementSystemDomainService = offhireManagementSystemDomainService;
            this.voyageDomianService = voyageDomianService;

            this.offhireDomainService.SetConfigurator(offhireConfigurator);
        }
예제 #4
0
 public OffhireFactory(
     IEntityConfigurator<Offhire> offhireConfigurator,
     IWorkflowRepository workflowRepository,
     IOffhireDomainService offhireDomainService,
     IVesselInCompanyDomainService vesselDomainService,
     ICompanyDomainService companyDomainService,
     ITankDomainService tankDomainService,
     ICurrencyDomainService currencyDomainService,
     IGoodDomainService goodDomainService,
     IGoodUnitDomainService goodUnitDomainService,
     IOffhireManagementSystemDomainService offhireManagementSystemDomainService,
     IVoyageDomainService voyageDomainService,
     IActivityLocationDomainService activityLocationDomainService)
 {
     this.offhireConfigurator = offhireConfigurator;
     this.workflowRepository = workflowRepository;
     this.offhireDomainService = offhireDomainService;
     this.vesselDomainService = vesselDomainService;
     this.companyDomainService = companyDomainService;
     this.tankDomainService = tankDomainService;
     this.currencyDomainService = currencyDomainService;
     this.goodDomainService = goodDomainService;
     this.goodUnitDomainService = goodUnitDomainService;
     this.offhireManagementSystemDomainService = offhireManagementSystemDomainService;
     this.voyageDomainService = voyageDomainService;
     this.activityLocationDomainService = activityLocationDomainService;
 }
예제 #5
0
        /// <summary>
        /// Sets <paramref name="configurator"/> Required to false
        /// </summary>
        public static IEntityConfigurator <T> IsOptional <T>(this IEntityConfigurator <T> configurator)
            where T : Entity
        {
            configurator.Required = false;

            return(configurator);
        }
예제 #6
0
        public OrderFactory(IOrderCodeGenerator iOrderCodeGenerator,
                            IEntityConfigurator<Order> orderConfigurator,
            IWorkflowRepository workflowRepository

            )
        {
            _iOrderCodeGenerator = iOrderCodeGenerator;
            _orderConfigurator = orderConfigurator;
            _workflowRepository = workflowRepository;
        }
예제 #7
0
        public Invoice(InvoiceTypes invoiceType,
                       string invoiceNumber,
                       Company owner,
                       DateTime invoiceDate,
                       DivisionMethods divisionMethod,
                       AccountingTypes accountType,
                       Invoice invoiceRefrence,
                       List<Order> orderRefrences,
                       Currency currency,
                       bool isCreditor,
                       Company transporter,
                       Company supplier,
                       string description,
                       List<InvoiceItem> list,
                       List<InvoiceAdditionalPrice> invoiceAdditionalPriceList,
                       IEntityConfigurator<Invoice> invoiceConfigurator,
                       IInvoiceDomainService invoiceDomainService,
                       IInvoiceItemDomainService invoiceItemDomainService,
                       IGoodUnitConvertorDomainService goodUnitConvertorDomainService,
                       IInvoiceAdditionalPriceDomainService invoiceAdditionalPriceDomainService,
                       IBalanceDomainService balanceDomainService)
            : this()
        {
            // TODO: Complete member initialization
            InvoiceType = invoiceType;
            InvoiceNumber = invoiceNumber;
            Owner = owner;
            InvoiceDate = invoiceDate;
            DivisionMethod = divisionMethod;
            AccountingType = accountType;
            InvoiceRefrence = invoiceRefrence;
            OrderRefrences = orderRefrences;
            Currency = currency;
            IsCreditor = isCreditor;
            Transporter = transporter;
            Supplier = supplier;

            TransporterId = Transporter == null ? (long?)null : Transporter.Id;
            SupplierId = Supplier == null ? (long?)null : Supplier.Id;
            InvoiceRefrenceId = InvoiceRefrence == null ? (long?)null : InvoiceRefrence.Id;
            Description = description;

            UpdateInvoiceItems(list, null, balanceDomainService);
            UpdateInvoiceAdditionalPrice(invoiceAdditionalPriceList, null);

            this.invoiceConfigurator = invoiceConfigurator;
            this.invoiceAdditionalPriceDomainService = invoiceAdditionalPriceDomainService;
            invoiceConfigurator.Configure(this);
            invoiceBaseType.ValidateType(this);

            checkInvoiceNumberToBeUnique(invoiceDomainService);
            CheckInvoiceHaveInvoiceItem();
            invoiceBaseType.CheckInvoiceItemValidateQuantityAndRefrence(this, invoiceItemDomainService, goodUnitConvertorDomainService);
            invoiceAdditionalPriceDomainService.CalculateAdditionalPrice(this);
        }
예제 #8
0
        protected HL7ComponentMap()
        {
            Set(x => x.IsEmpty, IsComponentEmpty, x => x.NoFormat());

            Value(x => x.Fields, 0, x =>
            {
                x.SetRange();
                x.NoFormat();
            });

            IEntityConfigurator <TComponent, TSchema> entityConfigurator = this;

            entityConfigurator.FormatterFactory = formatters => new HL7ComponentFormatter <TComponent, TSchema>(formatters);
        }
예제 #9
0
 public InvoiceFactory(
                     IEntityConfigurator<Invoice> invoiceConfigurator,
     IWorkflowRepository workflowRepository,
     IInvoiceDomainService invoiceDomainService,
     IInvoiceItemDomainService invoiceItemDomainService, IGoodUnitConvertorDomainService goodUnitConvertorDomainService,
     IInvoiceAdditionalPriceDomainService invoiceAdditionalPriceDomainService, IBalanceDomainService balanceDomainService)
 {
     this.invoiceConfigurator = invoiceConfigurator;
     this.workflowRepository = workflowRepository;
     this.invoiceDomainService = invoiceDomainService;
     this.invoiceItemDomainService = invoiceItemDomainService;
     this.goodUnitConvertorDomainService = goodUnitConvertorDomainService;
     this.invoiceAdditionalPriceDomainService = invoiceAdditionalPriceDomainService;
     this.balanceDomainService = balanceDomainService;
 }
        public void Initialize(EntityContext context, IEntityConfigurator configurator)
        {
            lock (this)
            {
                if (_isInitialized)
                {
                    return;
                }

                InitializeCommonIndexes(configurator);

                context.OnConfiguring();

                _isInitialized = true;
            }
        }
예제 #11
0
        public CharterInFacadeService(

         ICharterInApplicationService charterInApplicationService,
         ICharterInRepository charterInRepository,
         ICharterInToDtoMapper charterInToDtoMapper,
         ICharterItemToDtoMapper charterItemToDtoMapper,
            IInventoryOperationToInventoryOperationDtoMapper inventoryOperationDtoMapper,
            IEntityConfigurator<Charter> configurator 
)
        {
            _charterInApplicationService = charterInApplicationService;
            _charterInRepository = charterInRepository;
            _charterInToDtoMapper = charterInToDtoMapper;
            _charterItemToDtoMapper = charterItemToDtoMapper;
            _inventoryOperationDtoMapper = inventoryOperationDtoMapper;
            _configurator = configurator;
        }
예제 #12
0
        public Order(string code, string description, long ownerId, long? transporterId, long? supplierId, long? receiverId, OrderTypes _orderTypeClass, DateTime orderDate, VesselInCompany fromVesselInCompany, VesselInCompany toVesselInCompany, States state, IEntityConfigurator<Order> orderConfigurator)
        {
            Code = code;
            Description = description;
            SupplierId = supplierId;
            OwnerId = ownerId;
            TransporterId = transporterId;
            ReceiverId = receiverId;

            OrderDate = orderDate;
            FromVesselInCompanyId = fromVesselInCompany == null ? (long?)null : fromVesselInCompany.Id;
            ToVesselInCompanyId = toVesselInCompany == null ? (long?)null : toVesselInCompany.Id;
            this.OrderType = _orderTypeClass;
            State = state;
            orderConfigurator.Configure(this);
            _orderBaseType.Add(this, fromVesselInCompany, toVesselInCompany);
            ApproveWorkFlows = new List<OrderWorkflowLog>();
        }
        public InvoiceApplicationService(IInvoiceRepository invoiceRepository,
                                         IUnitOfWorkScope unitOfWorkScope,
            //  IGoodPartyAssignmentDomainService goodPartyAssignmentDomainService,
                                         //IUserRepository userRepository,
                                         IVesselInCompanyDomainService vesselDomainService,
                                         IGoodDomainService goodDomainService,
                                         IInvoiceFactory invoiceFactory,
                                         ICompanyDomainService companyDomainService,
                                         IInvoiceDomainService invoiceDomainService,
                                         IInvoiceItemDomainService invoiceItemDomainService,
                                         IEffectiveFactorDomainService effectiveFactorDomainService,
                                         ICompanyRepository companyRepository
            //,IApprovableDomainService approvableDomainService
                                         ,
                                         IOrderRepository orderRepository,
                                         IGoodRepository goodRepository,
                                         ICurrencyDomainService currencyDomainService,
                                         IInvoiceAdditionalPriceDomainService invoiceAdditionalPriceDomainService,
                                         IGoodUnitConvertorDomainService goodUnitConvertorDomainService, IBalanceDomainService balanceDomainService, IEntityConfigurator<Invoice> invoiceConfigurator)
        {
            this.invoiceRepository = invoiceRepository;
            this.vesselDomainService = vesselDomainService;
            this.goodDomainService = goodDomainService;
            this.invoiceFactory = invoiceFactory;
            this.unitOfWorkScope = unitOfWorkScope;
            this.companyDomainService = companyDomainService;
            this.invoiceDomainService = invoiceDomainService;

            this.invoiceItemDomainService = invoiceItemDomainService;
            this.effectiveFactorDomainService = effectiveFactorDomainService;
            this.companyRepository = companyRepository;
            this.orderRepository = orderRepository;
            this.goodRepository = goodRepository;
            this.currencyDomainService = currencyDomainService;
            this.invoiceAdditionalPriceDomainService = invoiceAdditionalPriceDomainService;
            this.goodUnitConvertorDomainService = goodUnitConvertorDomainService;
            this.balanceDomainService = balanceDomainService;
            this.invoiceConfigurator = invoiceConfigurator;

            // _approvableDomainService = approvableDomainService;
            //  _goodPartyAssignmentDomainService = goodPartyAssignmentDomainService;
        }
 public ApproveFlowApplicationService(IUnitOfWorkScope unitOfWorkScope, IWorkflowLogRepository workflowLogRepository,
                                      IWorkflowRepository workflowRepository,
     IEntityConfigurator<Order> orderConfigurator,
     IEntityConfigurator<FuelReport> fuelReportConfigurator,
     IEntityConfigurator<Scrap> scrapConfigurator,
     IEntityConfigurator<Charter> charterConfigurator,
     IEntityConfigurator<Invoice> invoiceConfigurator, IEntityConfigurator<Offhire> offhireConfigurator)
 {
     _unitOfWorkScope = unitOfWorkScope;
     _workflowLogRepository = workflowLogRepository;
     _workflowRepository = workflowRepository;
     this.orderConfigurator = orderConfigurator;
     this.fuelReportConfigurator = fuelReportConfigurator;
     this.scrapConfigurator = scrapConfigurator;
     this.invoiceConfigurator = invoiceConfigurator;
     this.offhireConfigurator = offhireConfigurator;
     this._charterConfigurator = charterConfigurator;
     //          _approveWorkFlowFactory = approveWorkFlowFactory;
     //           _orderApplicationService = orderApplicationService;
 }
예제 #15
0
 //private readonly IOffhireDomainService offhireDomainService;
 //private readonly IVesselInCompanyDomainService vesselDomainService;
 //private readonly ICompanyDomainService companyDomainService;
 //private readonly ITankDomainService tankDomainService;
 //private readonly ICurrencyDomainService currencyDomainService;
 //private readonly IGoodDomainService goodDomainService;
 //private readonly IGoodUnitDomainService goodUnitDomainService;
 //private readonly IOffhireManagementSystemDomainService offhireManagementSystemDomainService;
 //private readonly IVoyageDomainService voyageDomainService;
 //private readonly IActivityLocationDomainService activityLocationDomainService;
 public FuelReportFactory(
     IEntityConfigurator<FuelReport> fuelReportConfigurator,
     IWorkflowRepository workflowRepository, 
     IVesselInCompanyRepository vesselInCompanyRepository /*,
     IOffhireDomainService offhireDomainService,
     IVesselInCompanyDomainService vesselDomainService,
     ICompanyDomainService companyDomainService,
     ITankDomainService tankDomainService,
     ICurrencyDomainService currencyDomainService,
     IGoodDomainService goodDomainService,
     IGoodUnitDomainService goodUnitDomainService,
     IOffhireManagementSystemDomainService offhireManagementSystemDomainService,
     IVoyageDomainService voyageDomainService,
     IActivityLocationDomainService activityLocationDomainService*/)
 {
     this.fuelReportConfigurator = fuelReportConfigurator;
     this.workflowRepository = workflowRepository;
     //this.vesselInInventoryRepository = vesselInInventoryRepository;
     this.vesselInCompanyRepository = vesselInCompanyRepository;
 }
예제 #16
0
        protected HL7SegmentMap()
        {
            Value(x => x.SegmentId, 0, x =>
            {
                x.Required  = true;
                x.MaxLength = 10;
            });

            Set(x => x.IsEmpty, IsSegmentEmpty, x => x.NoFormat());

            Value(x => x.Fields, 1, x =>
            {
                x.SetRange();
                x.NoFormat();
            });

            IEntityConfigurator <TSegment, TSchema> entityConfigurator = this;

            entityConfigurator.FormatterFactory = formatters => new HL7SegmentFormatter <TSegment, TSchema>(formatters);
        }
예제 #17
0
 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;
 }
예제 #18
0
        public OffhireFacadeService(
            IOffhireApplicationService offhireApplicationService,
            IOffhireDomainService offhireDomainService,
            IEntityConfigurator<Offhire> offhireConfigurator,
            IOffhireToOffhireDtoMapper offhireDtoMapper,
            IOffhireDetailToOffhireDetailDtoMapper offhireDetailDtoMapper,
            IInventoryOperationToInventoryOperationDtoMapper inventoryOperationDtoMapper,
            IOffhireManagementSystemDomainService offhireManagementSystemDomainService,
            IOffhireManagementSystemEntityToOffhireManagementSystemDtoMapper offhireManagementSystemDtoMapper,
            IOffhirePreparedDataToOffhireDtoMapper offhirePreparedDataToOffhireDtoMapper,
            IPricingValueToPricingValueDtoMapper pricingValueDtoMapper)
        {
            this.offhireApplicationService = offhireApplicationService;
            this.offhireDomainService = offhireDomainService;
            this.offhireDtoMapper = offhireDtoMapper;
            this.offhireDetailDtoMapper = offhireDetailDtoMapper;
            this.inventoryOperationDtoMapper = inventoryOperationDtoMapper;
            this.offhireManagementSystemDomainService = offhireManagementSystemDomainService;
            this.offhireManagementSystemDtoMapper = offhireManagementSystemDtoMapper;
            this.offhirePreparedDataToOffhireDtoMapper = offhirePreparedDataToOffhireDtoMapper;
            this.pricingValueDtoMapper = pricingValueDtoMapper;

            this.offhireDomainService.SetConfigurator(offhireConfigurator);
        }
        private void InitializeCommonIndexes(IEntityConfigurator configurator)
        {
            configurator.DefineIndex(new IndexDefinition <EntityNode>
            {
                Name   = "path_asc",
                Fields = new List <IndexField <EntityNode> >
                {
                    new IndexField <EntityNode>(x => x.Path, Abstractions.Infrastructure.IndexSortOrder.Asc)
                },
                Options = new IndexOptions
                {
                    Unique = false,
                }
            });

            configurator.DefineIndex(new IndexDefinition <EntityNode>
            {
                Name   = "parentId_asc",
                Fields = new List <IndexField <EntityNode> >
                {
                    new IndexField <EntityNode>(x => x.ParentId, Abstractions.Infrastructure.IndexSortOrder.Asc)
                },
                Options = new IndexOptions
                {
                    Unique = false,
                }
            });

            configurator.DefineIndex(new IndexDefinition <EntityNode>
            {
                Name   = "idPath_asc",
                Fields = new List <IndexField <EntityNode> >
                {
                    new IndexField <EntityNode>(x => x.IdPath, Abstractions.Infrastructure.IndexSortOrder.Asc)
                },
                Options = new IndexOptions
                {
                    Unique = false,
                }
            });

            configurator.DefineIndex(new IndexDefinition <EntityNode>
            {
                Name   = "nodeId_asc",
                Fields = new List <IndexField <EntityNode> >
                {
                    new IndexField <EntityNode>(x => x.EntityId, Abstractions.Infrastructure.IndexSortOrder.Asc)
                },
                Options = new IndexOptions
                {
                    Unique = true,
                }
            });

            configurator.DefineIndex(new IndexDefinition <EntitySecurityRule>
            {
                Name   = "entityId_asc",
                Fields = new List <IndexField <EntitySecurityRule> >
                {
                    new IndexField <EntitySecurityRule>(x => x.EntityId, Abstractions.Infrastructure.IndexSortOrder.Asc)
                },
                Options = new IndexOptions
                {
                    Unique = false,
                }
            });

            configurator.DefineIndex(new IndexDefinition <EntitySecurityRule>
            {
                Name   = "uniqueSecurityRule_asc",
                Fields = new List <IndexField <EntitySecurityRule> >
                {
                    new IndexField <EntitySecurityRule>(x => x.EntityId, Abstractions.Infrastructure.IndexSortOrder.Asc),
                    new IndexField <EntitySecurityRule>(x => x.Subject.SubjectId, Abstractions.Infrastructure.IndexSortOrder.Asc),
                    new IndexField <EntitySecurityRule>(x => x.Subject.SubjectType, Abstractions.Infrastructure.IndexSortOrder.Asc),
                    new IndexField <EntitySecurityRule>(x => x.Rule.Right, Abstractions.Infrastructure.IndexSortOrder.Asc),
                },
                Options = new IndexOptions
                {
                    Unique = true,
                }
            });

            configurator.DefineIndex(new IndexDefinition <Container>
            {
                Name   = "containerName_asc",
                Fields = new List <IndexField <Container> >
                {
                    new IndexField <Container>(x => x.Name, Abstractions.Infrastructure.IndexSortOrder.Asc)
                },
                Options = new IndexOptions
                {
                    Unique = false,
                }
            });
        }
예제 #20
0
 protected X12EntityMap()
 {
     _configurator = this;
 }
예제 #21
0
        public void Update(string description, OrderTypes orderType, long ownerId, long? transporterId,
            long? supplierId, long? receiverId, VesselInCompany fromVesselInCompany, VesselInCompany toVesselInCompany, IEntityConfigurator<Order> orderConfigurator, IOrderItemDomainService orderItemDomainService)
        {
            if (OrderType != orderType)
            {

                foreach (var orderItem in OrderItems.ToList())
                {
                    orderItemDomainService.DeleteOrderItem(orderItem);
                }
            }
            OrderType = orderType;
            Description = description;
            OwnerId = ownerId;
            TransporterId = transporterId;
            ReceiverId = receiverId;
            SupplierId = supplierId;
            FromVesselInCompanyId = fromVesselInCompany == null ? (long?)null : fromVesselInCompany.Id;
            ToVesselInCompanyId = toVesselInCompany == null ? (long?)null : toVesselInCompany.Id;
            orderConfigurator.Configure(this);

            IsOnOpenState();

            _orderBaseType.Update(this, fromVesselInCompany, toVesselInCompany);
        }
예제 #22
0
 protected HL7EntityMap()
 {
     _configurator = this;
 }
예제 #23
0
 //================================================================================
 public void SetConfigurator(IEntityConfigurator<Offhire> offhireConfigurator)
 {
     this.offhireConfigurator = offhireConfigurator;
     this.offhireRepository.SetConfigurator(this.offhireConfigurator);
 }