Example #1
0
        public void Process()
        {
            //op dit moment is er al een mgm
            //het doel van deze plugin is het vullen ven de content en content product tabel

            List <Connector> connectors = new List <Connector>();

            connectors = connectorRepo.GetListOfActiveConnectors();

#if DEBUG
            //connectors = connectorRepo.GetListOfActiveConnectors().Where(x => x.ConnectorID == 1 || x.ConnectorID == 5468 || x.ConnectorID == 5474).OrderByDescending(x => x.ConnectorID).ToList();
            connectors = connectorRepo.GetListOfActiveConnectors().Where(x => x.ConnectorID == 5480).ToList();
#else
            connectors = connectorRepo.GetListOfActiveConnectors();
#endif

            int countConnectors = 0;
            connectors.ForEach(connector =>
            {
                log.DebugFormat("");
                log.DebugFormat("------------------------- Syncing Connector: {0} ({1}). Connector to sync: {2} -------------------------------------",
                                connector.ConnectorID,
                                connector.Name,
                                connectors.Count - countConnectors);

                //kijkt of deze connector een parent heeft, zo ja dan gaat deze synchroniseren
                if (connector.ParentConnectorID.HasValue && connector.ParentConnectorID.Value > 0)
                {
                    ProcessSyncChildConnector(connector);
                }

                // Sync Products
                //kijken welke producten volgens connector publication rule gekopieerd moeten worden vanuit mgm naar connector mgm.
                ProcessSyncProductGroups(connector);

                // Filter By Parent
                //als een mgm 'filter by parent' optie heeft dan kijkt de plugin naar de child van die mgm. Zitten er producten in de child die niet in de parent voorkomen dan zullen die verwijderd worden
                ProcessFilterByParentProductGroups(connector);

                EmptyParentProductGroupOfFilterByParentProductGroups(connector);

                // Flatten Hierachy
                //kijkt of een mgm flatten by hierarchy heeft, zo ja dan voeg je alle producten (van de childs van die mgm) bij elkaar
                ProcessFlattenHierachyProductGroups(connector);


                // Sync Contents
                //vanuit connector mgm gaan we de content tabel vullen
                ProcessSyncContent(connector);

                // Sync Content Product Groups
                //vanuit connector mgm gaan we de content product group tabel vullen
                ProcessSyncContentProductGroup(connector);

                countConnectors++;
            });
        }
        public void ImportProductGroupMappings()
        {
            // Connector Blueberry 5480
            // Connector Dixons 5468
            // Connector WPOS MyCom Webconnector 5474
            // Connector WPOS MyCom Shopconnector 5478

            log.DebugFormat("");

            log.DebugFormat("-------> Start Importing ProductGroupMappings");
            var connectors = connectorRepo
                             .GetListOfActiveConnectors()
                             .Where(x => x.ConnectorID == 5474)
            ;

            connectors.ForEach(connector =>
            {
                log.DebugFormat("---> Connector: {0}", connector.Name);

                ImportProductGroupMappings(connector);
                SyncSourceMasterGroupMapping(connector);
                //FillExportIDColumn(connector);
            });
            log.DebugFormat("-------> End Importing ProductGroupMappings");
        }