private ImportEntity[] ParseXml(string path, ConfigImportCategoryEntity config) { var root = OpenXml(path); var importEntities = new List <ImportEntity>(); importEntities.AddRange(SubCategoryElements(root)); return(importEntities.ToArray()); }
public ImportOneSImpl( IProductService productService, ICategoryService categoryService, ISpecificationAttributeService specificationAttribute, IProductAttributeService productAttributeService, IUrlRecordService urlRecordService, IRepository <Product> producRepository, MiscOneSSettings miscOneSSetting) { _productService = productService; _categoryService = categoryService; _specificationAttributeService = specificationAttribute; _productAttributeService = productAttributeService; _urlRecordService = urlRecordService; _productRepository = producRepository; _miscOneSSetting = miscOneSSetting; _configImportCategoryEntity = new ConfigImportCategoryEntity(); }
public bool ImportProductStorages(string path, ConfigImportCategoryEntity config) { var xmlRootElement = GetXmlRootElement(path, config.RootCategoryName); _configImportCategoryEntity = config; _importOneSImpl.SetConfig(config); if (xmlRootElement == config.RootName.ToLower()) { var importEntities = ParseXml(path, config); _importOneSImpl.ImportStoragesEntities(importEntities); return(true); } if (xmlRootElement == "products") { var importEntities = ParseXml(path, config); _importOneSImpl.ImportAllEntities(importEntities); return(true); } return(false); }
void Initialize() { OilConfig = new ConfigImportCategoryEntity { Title = "Масла", FileName = "MaslaProducts_*.xml", RootName = "ProductsAvtomasla", RootCategoryName = "Oils", RootCategoryElementsName = "Oil", ProductSpecifications = new List <ImportProductSpecification>() { new ImportProductSpecification() { XName = "TypeOils", RusName = "Тип масла", FilterBy = true }, new ImportProductSpecification() { XName = "Viscous", RusName = "Вязкость", FilterBy = true }, new ImportProductSpecification() { XName = "Volume", RusName = "Объем", FilterBy = true }, new ImportProductSpecification() { XName = "Brand", RusName = "Производитель", FilterBy = true } } }; OilConfig.CategoryId = GetCategoryId(OilConfig.Title); FastenersConfig = new ConfigImportCategoryEntity { Title = "Крепеж", FileName = "FastenerProducts_*.xml", RootName = "ProductsFastener", RootCategoryName = "Fasteners", RootCategoryElementsName = "Fastener", ProductSpecifications = new List <ImportProductSpecification>() { new ImportProductSpecification() { XName = "Type", RusName = "Тип крепежа", FilterBy = true }, new ImportProductSpecification() { XName = "Size", RusName = "Размер/шаг резьбы", FilterBy = true }, new ImportProductSpecification() { XName = "Skirt", RusName = "Юбка", FilterBy = true }, new ImportProductSpecification() { XName = "Key", RusName = "Размер ключа", FilterBy = true }, new ImportProductSpecification() { XName = "Length", RusName = "Длинна", FilterBy = true }, new ImportProductSpecification() { XName = "OpenClose", RusName = "Закрытый или открытый", FilterBy = false }, new ImportProductSpecification() { XName = "Secret", RusName = "Секретный", FilterBy = false }, new ImportProductSpecification() { XName = "Descriptor", RusName = "Комплектация", FilterBy = false }, new ImportProductSpecification() { XName = "Brand", RusName = "Производитель", FilterBy = true } } }; FastenersConfig.CategoryId = GetCategoryId(FastenersConfig.Title); }
public void SetConfig(ConfigImportCategoryEntity configImportCategoryEntity) { _configImportCategoryEntity = configImportCategoryEntity; }
public ImportOneS(IImportOneSImpl importOneSImpl, ILogger _logger) { _importOneSImpl = importOneSImpl; this._logger = _logger; _configImportCategoryEntity = new ConfigImportCategoryEntity(); }