private int CreateNewMasterGroupMapping(string masterGroupMappingName, int?parentMasterGroupMappingID)
        {
            MasterGroupMapping newMasterGroupMapping = new MasterGroupMapping()
            {
                ProductGroupID = -1,
                Score          = 100
            };

            if (parentMasterGroupMappingID.HasValue && parentMasterGroupMappingID.Value > 0)
            {
                newMasterGroupMapping.ParentMasterGroupMappingID = parentMasterGroupMappingID.Value;
            }

            int masterGroupMappingID = masterGroupMappingRepo.InsertMasterGroupMapping(newMasterGroupMapping);

            MasterGroupMappingLanguage newMasterGroupMappingLanguage = new MasterGroupMappingLanguage()
            {
                MasterGroupMappingID = masterGroupMappingID,
                LanguageID           = 2,
                Name = masterGroupMappingName
            };

            masterGroupMappingRepo.InsertMasterGroupMappingLanguage(newMasterGroupMappingLanguage);
            return(masterGroupMappingID);
        }
Esempio n. 2
0
        private void InsertProductGroupMappingToDestConnector(List <MasterGroupMapping> listOfProductGroupMappingToInsert, Connector connector, int?parentProductGroupMappingID)
        {
            listOfProductGroupMappingToInsert.ForEach(productGroupMapping =>
            {
                productGroupMapping.SourceProductGroupMappingID = productGroupMapping.MasterGroupMappingID;
                productGroupMapping.ConnectorID = connector.ConnectorID;
                if (parentProductGroupMappingID.HasValue && parentProductGroupMappingID.Value > 0)
                {
                    productGroupMapping.ParentMasterGroupMappingID = parentProductGroupMappingID.Value;
                }
                int newProductGroupMappingID = masterGroupMappingRepo.InsertMasterGroupMapping(productGroupMapping);

                CopyProductGroupMappingLanguage(productGroupMapping.MasterGroupMappingID, newProductGroupMappingID);
                if (connector.ConnectorSystemID == 2)
                {
                    CopyMagentoProductGroupSetting(productGroupMapping.MasterGroupMappingID, newProductGroupMappingID);
                }
            });
        }