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);
        }
Exemplo n.º 2
0
        private void CopyProductGroupMappingLanguage(int fromProductGroupMappingID, int toProductGroupMappingID)
        {
            List <MasterGroupMappingLanguage> productGroupMappingLanguages = masterGroupMappingRepo.GetListOfMasterGroupMappingLanguagesByMasterGroupMappingID(fromProductGroupMappingID);

            productGroupMappingLanguages.ForEach(language =>
            {
                MasterGroupMappingLanguage masterGroupMappingLanguage = new MasterGroupMappingLanguage()
                {
                    MasterGroupMappingID = toProductGroupMappingID,
                    LanguageID           = language.LanguageID,
                    Name = language.Name
                };

                masterGroupMappingRepo.InsertMasterGroupMappingLanguage(masterGroupMappingLanguage);
            });
        }