示例#1
0
        private IEnumerable <MustSetShowConfig> GetMustSetProperies(NativeActivityContext context)
        {
            SKU sku;
            var skuId         = SKU.Get(context);
            var operationCode = OperationCode.Get(context);

            using (var mgr = GetManager <SKU>(context))
                sku = mgr.Get(skuId);
            if (sku == null)
            {
                throw new DeveloperException(string.Format("SKU с кодом '{0}' не существует", skuId));
            }
            var art = sku.ArtCode;

            using (var pmConfigMgr = IoC.Instance.Resolve <IPMConfigManager>())
            {
                SetUnitOfWork(context, pmConfigMgr);
                var set  = pmConfigMgr.GetPMConfigByParamListByArtCode(art, operationCode, "MUST_SET");
                var res  = set.Select(item => new MustSetShowConfig(item, true)).ToList();
                var show = pmConfigMgr.GetPMConfigByParamListByArtCode(art, operationCode, "MUST_SHOW");

                foreach (var item in show)
                {
                    var p = res.FirstOrDefault(i => i.PmConfig.PM2OperationCode_r == item.PM2OperationCode_r &&
                                               i.PmConfig.ObjectName_r == item.ObjectName_r &&
                                               i.PmConfig.ObjectEntitycode_R == item.ObjectEntitycode_R);
                    if (p == null)
                    {
                        res.Add(new MustSetShowConfig(item, false)
                        {
                            Show = true
                        });
                    }
                    else
                    {
                        p.Show = true;
                    }
                }
                return(res);
            }
        }
示例#2
0
        private IEnumerable <PMConfig> GetManualCorrectProperies(NativeActivityContext context)
        {
            SKU sku;
            var skuId         = SKU.Get(context);
            var operationCode = OperationCode.Get(context);

            using (var mgr = GetManager <SKU>(context))
                sku = mgr.Get(skuId);

            if (sku == null)
            {
                throw new DeveloperException(string.Format("SKU с кодом '{0}' не существует", skuId));
            }

            var art = sku.ArtCode;

            using (var pmConfigMgr = IoC.Instance.Resolve <IPMConfigManager>())
            {
                SetUnitOfWork(context, pmConfigMgr);
                return(pmConfigMgr.GetPMConfigByParamListByArtCode(art, operationCode, "CAN_PRODUCT_MANUAL_CORRECT"));
            }
        }