public static bool Delete(int id)
        {
            bool flag = dal.Delete(id);

            if (flag)
            {
                CollectionFieldRules.UpdateExclosionId(id);
            }
            return(flag);
        }
Exemplo n.º 2
0
        public static bool Copy(int id)
        {
            if (id <= 0)
            {
                return(false);
            }
            CollectionItemInfo infoById = GetInfoById(id);

            if (infoById.IsNull)
            {
                return(false);
            }
            bool flag = false;

            infoById.ItemName = infoById.ItemName + "_复制";
            if (!Add(infoById))
            {
                return(flag);
            }
            CollectionListRuleInfo collectionListRuleInfo = CollectionListRules.GetInfoById(id);

            collectionListRuleInfo.ItemId = infoById.ItemId;
            if (!CollectionListRules.Add(collectionListRuleInfo))
            {
                return(flag);
            }
            foreach (CollectionPagingRuleInfo info3 in CollectionPagingRules.GetCollectionPagingRuleList(id))
            {
                info3.ItemId = infoById.ItemId;
                CollectionPagingRules.Add(info3);
            }
            foreach (CollectionFieldRuleInfo info4 in CollectionFieldRules.GetList(id))
            {
                info4.ItemId = infoById.ItemId;
                CollectionFieldRules.Add(info4);
            }
            return(true);
        }