Example #1
0
        public IGlobalOrderRepository Next(IGlobalOrderRepository globalOrderRepository, string currentPartName)
        {
            if (string.IsNullOrWhiteSpace(currentPartName))
            {
                currentPartName = Constants.BuiltInPart.INITIALIZING;
            }

            var nextPartName = ProcessingFlow.GetNextPartName(currentPartName, this.GetType().ToString());

            if (nextPartName == Constants.BuiltInPart.FINALIZING)
            {
                return(globalOrderRepository);
            }

            var nextPart = ProcessingFlow.GetPart(nextPartName, _compositionParts);

            if (nextPart != null)
            {
                return(nextPart.Process(globalOrderRepository, this.GetType().ToString()));
            }
            else
            {
                return(Next(globalOrderRepository, nextPartName));
            }
        }
Example #2
0
        //We load all channels into memory as a dictionary, function module can look up this dictionary by request type to get the imports(dependencies).
        private static void SetUpChannels()
        {
            try
            {
                var channelMappings    = new Dictionary <string, List <string> >();
                var strChannelMappings = Properties.Settings.Default.channelMapping.Cast <string>().ToList();
                foreach (var strChannelMapping in strChannelMappings)
                {
                    var arrChannelMapping = strChannelMapping.Split(":".ToCharArray(), StringSplitOptions.RemoveEmptyEntries);
                    var controllerName    = arrChannelMapping[0].Trim().ToLower();
                    var channelname       = arrChannelMapping[1].Trim().ToLower();

                    var channelContent = ConfigurationManager.AppSettings[channelname].Split("\r\n".ToCharArray(), StringSplitOptions.RemoveEmptyEntries);
                    //remove spaces
                    for (var i = 0; i < channelContent.Length; i++)
                    {
                        channelContent[i] = channelContent[i].Trim().ToLower();
                    }
                    channelMappings.Add(controllerName, channelContent.ToList());
                }

                ProcessingFlow.SetUp(channelMappings);
            }
            catch (Exception ex)
            {
                throw new ApplicationException(ex.Message);
            }
        }
Example #3
0
        public IGlobalOrderRepository Next(IGlobalOrderRepository globalOrderRepository, string currentPartName, string controllerName)
        {
            var nextPartName = ProcessingFlow.GetNextPartName(currentPartName, controllerName);

            if (nextPartName == Constants.BuiltInPart.FINALIZING)
            {
                return(globalOrderRepository);
            }

            _nextPart = ProcessingFlow.GetPart(nextPartName, _compositionParts);
            if (_nextPart != null)
            {
                return(_nextPart.Process(globalOrderRepository, controllerName));
            }
            else
            {
                return(Next(globalOrderRepository, nextPartName, controllerName));
            }
        }