示例#1
0
        private static void CreateCellInProfile()
        {
            var outProfiles = InOutProfileMaster.OutProfiles;
            var inProfiles  = InOutProfileMaster.InProfiles;

            var targetView = InputMart.Instance.ShopInTargetProdView;

            foreach (var op in outProfiles.Values)
            {
                if (op.HasCellCodeList() == false)
                {
                    continue;
                }

                string shopID    = op.ShopID;
                string ownerType = op.OwnerType;

                foreach (var cellCode in op.CellCodeList)
                {
                    var prod = BopHelper.FindProduct(Constants.CellShop, cellCode);
                    if (prod == null)
                    {
                        continue;
                    }

                    string key = CreateKey(cellCode, ownerType);

                    CellInProfile profile;
                    if (inProfiles.TryGetValue(key, out profile) == false)
                    {
                        profile = CreateHelper.CreateCellInProfile(prod, ownerType);
                        inProfiles.Add(key, profile);

                        var inTargets = targetView.FindRows(prod).ToList();
                        if (inTargets != null && inTargets.Count > 1)
                        {
                            inTargets.Sort(CompareHelper.ShopInTargetComparer.Default);
                        }

                        profile.InTargets = inTargets;
                    }

                    profile.AddOutInfos(shopID, op.Infos);
                }
            }
        }