Пример #1
0
        private void InvokeWorkInternal_FromEBS(s2sMessage target, object source, object[] sourceChild)
        {
            ModuleProc PROC = new ModuleProc(this.DYN_MODULE_NAME, "InvokeWork_Items");

            try
            {
                Type sourceType = source.GetType();
                if (_worksFromEBS.ContainsKey(sourceType))
                {
                    TypeFromEBSWorkDictionary workDict = _worksFromEBS[sourceType];

                    if (sourceChild != null && sourceChild.Length > 0)
                    {
                        object item      = sourceChild[0];
                        Type   childType = item.GetType();
                        if (workDict.ContainsKey(childType))
                        {
                            workDict[childType](target, item);
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                Log.Exception(PROC, ex);
            }
        }
Пример #2
0
        private void InvokeWorkInternal_FromEBS(s2sMessage target, Is2sMessage_Items source)
        {
            ModuleProc PROC = new ModuleProc(this.DYN_MODULE_NAME, "InvokeWork_Items");

            try
            {
                Type sourceType = source.GetType();
                if (_worksFromEBS.ContainsKey(sourceType))
                {
                    TypeFromEBSWorkDictionary workDict = _worksFromEBS[sourceType];

                    foreach (var item in source.Items)
                    {
                        Type childType = item.GetType();
                        if (workDict.ContainsKey(childType))
                        {
                            workDict[childType](target, item);
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                Log.Exception(PROC, ex);
            }
        }