Exemple #1
0
 public ProductCatalogStructurePackage(BaseProductService baseProductService, ProductListService productListService,
                                       RelationshipTypeService relationshipTypeService, CategoryService categoryService,
                                       UnitOfMeasurementService unitOfMeasurementService, DataService dataService,
                                       FieldTemplateService fieldTemplateService,
                                       LanguageService languageService, VariantService variantService,
                                       InventoryService inventoryService,
                                       PriceListService priceListService,
                                       StructureInfoService structureInfoService,
                                       CurrencyService currencyService,
                                       FilterService filterService,
                                       InventoryItemService inventoryItemService,
                                       PriceListItemService priceListItemService,
                                       ProductListItemService productListItemService)
 {
     _baseProductService        = baseProductService;
     _categoryService           = categoryService;
     _dataService               = dataService;
     _fieldTemplateService      = fieldTemplateService;
     _languageService           = languageService;
     _variantService            = variantService;
     _inventoryService          = inventoryService;
     _priceListService          = priceListService;
     _structureInfoService      = structureInfoService;
     _currencyService           = currencyService;
     _filterService             = filterService;
     _productListService        = productListService;
     _relationshipTypeService   = relationshipTypeService;
     _unitOfMeasurementService  = unitOfMeasurementService;
     _bidirectionalRelationList = new List <ImportBidirectionalRelation>();
     _inventoryItemService      = inventoryItemService;
     _priceListItemService      = priceListItemService;
     _productListItemService    = productListItemService;
 }
 public ODataProductsController(DataService dataService, VariantService variantService,
                                PriceListItemService priceListItemService,
                                PriceListService priceListService)
 {
     this.dataService          = dataService;
     this.variantService       = variantService;
     this.priceListItemService = priceListItemService;
     this.priceListService     = priceListService;
 }
Exemple #3
0
        public decimal CalculatePrice(InsuranceDto insurance)
        {
            var service     = new PriceListItemService();
            var riskService = new RiskService();

            var     duration           = (insurance.EndDate - insurance.StartDate).Days;
            decimal durationPercentage = 0;

            if (duration == 0 || (duration > 0 && duration < 8))
            {
                durationPercentage = 1;
            }
            else if (duration > 7 && duration < 15)
            {
                durationPercentage = 0.9M;
            }
            else if (duration > 14 && duration < 31)
            {
                durationPercentage = 0.8M;
            }
            else
            {
                durationPercentage = 0.75M;
            }

            var     numOfInsurants      = int.Parse(insurance.NumberOfInsurants);
            decimal insurantsPercentage = 0;

            if (numOfInsurants < 5)
            {
                insurantsPercentage = 1;
            }
            else if (numOfInsurants > 4 && numOfInsurants < 10)
            {
                insurantsPercentage = 0.9M;
            }
            else
            {
                insurantsPercentage = 0.85M;
            }

            var durationPrice = service.GetPricelistItemByRiskItemId(18).First().Price *service.GetPricelistItemByRiskItemId(18).First().Coefficient;
            var regionPrice   = insurance.Region != 0 ? service.GetPricelistItemByRiskItemId(insurance.Region).First().Price *service.GetPricelistItemByRiskItemId(insurance.Region).First().Coefficient : 0.0M;
            var agePrice      = insurance.Age != 0 ? service.GetPricelistItemByRiskItemId(insurance.Age).First().Price *service.GetPricelistItemByRiskItemId(insurance.Age).First().Coefficient : 0.0M;
            var sportPrice    = insurance.Sport != 0 ? service.GetPricelistItemByRiskItemId(insurance.Sport).First().Price *service.GetPricelistItemByRiskItemId(insurance.Sport).First().Coefficient : 0.0M;
            var valuePrice    = insurance.InsuredValue != 0 ? service.GetPricelistItemByRiskItemId(insurance.InsuredValue).First().Price *service.GetPricelistItemByRiskItemId(insurance.InsuredValue).First().Coefficient : 0.0M;

            var durationPriceTotal = durationPrice * duration * durationPercentage;

            var totalPrice = durationPriceTotal + regionPrice + agePrice + sportPrice + valuePrice;

            var insurantPrice  = service.GetPricelistItemByRiskItemId(19).First().Price *service.GetPricelistItemByRiskItemId(19).First().Coefficient;
            var insurantsTotal = insurantPrice * numOfInsurants * insurantsPercentage;

            return(totalPrice * insurantsTotal);
        }
Exemple #4
0
 public AvioAdminController(AvioService avioService, AvioAdminService avioAdminService, AeroplaneService aeroplaneService, FlightService flightService,
                            FastReservationFlightTicketService fastReservationFlightTicketService, PriceListItemService priceListItemService)
 {
     AvioService      = avioService;
     AvioAdminService = avioAdminService;
     AeroplaneService = aeroplaneService;
     FlightService    = flightService;
     FastReservationFlightTicketService = fastReservationFlightTicketService;
     PriceListItemService = priceListItemService;
 }
Exemple #5
0
 public VariantInfoBuilder(
     VariantService variantService,
     FileService fileService,
     ProductPriceModelBuilder priceModelBuilder,
     WebsiteService websiteService,
     CurrencyService currencyService,
     ChannelService channelService,
     PriceListItemService priceListItemService)
 {
     _variantService       = variantService;
     _fileService          = fileService;
     _priceModelBuilder    = priceModelBuilder;
     _currencyService      = currencyService;
     _channelService       = channelService;
     _priceListItemService = priceListItemService;
 }
 public ProductIndexDocumentBuilder(
     IndexDocumentBuilderDependencies dependencies,
     BaseProductService baseProductService,
     DisplayTemplateService displayTemplateService,
     FieldTemplateService fieldTemplateService,
     VariantService variantService,
     TemplateSettingService templateSettingService,
     ProductIndexingContext productIndexingContext,
     CategoryService categoryService,
     MostSoldDataHolder mostSoldDataHolder,
     CampaignDataHolder campaignDataHolder,
     CountryService countryService,
     PriceListService priceListService,
     PriceListItemService priceListItemService,
     ProductListService productListService,
     ProductListItemService productListItemService,
     FilterService filterService,
     FieldDefinitionService fieldDefinitionService,
     SearchPermissionService searchPermissionService,
     ContentBuilderService contentBuilderService,
     ChannelService channelService,
     LanguageService languageService)
     : base(dependencies)
 {
     _baseProductService      = baseProductService;
     _displayTemplateService  = displayTemplateService;
     _fieldTemplateService    = fieldTemplateService;
     _variantService          = variantService;
     _templateSettingService  = templateSettingService;
     _productIndexingContext  = productIndexingContext;
     _categoryService         = categoryService;
     _mostSoldDataHolder      = mostSoldDataHolder;
     _campaignDataHolder      = campaignDataHolder;
     _countryService          = countryService;
     _priceListService        = priceListService;
     _priceListItemService    = priceListItemService;
     _productListService      = productListService;
     _productListItemService  = productListItemService;
     _filterService           = filterService;
     _fieldDefinitionService  = fieldDefinitionService;
     _searchPermissionService = searchPermissionService;
     _contentBuilderService   = contentBuilderService;
     _channelService          = channelService;
     _languageService         = languageService;
 }