lixiaojun
2024-10-12 a8ccc992964272f6a74631e8c164e8c91e5cb6d4
Service/HStation.Service.Assets.Core/05-service/01-PumpMainManage/05-PumpPartMain/PumpPartMain.cs
@@ -195,7 +195,7 @@
            if (id > 0)
            {
                UpdateCache(id);
                //   AssetsPumpPropContent.UpdateCacheByPartID(id);
                AssetsPumpPropContent.UpdateCacheByPartID(id);
                AssetsPumpMainAndPartMap.UpdateCacheByPartID(id);
            }
            return id;
@@ -327,22 +327,21 @@
            return bol;
        }
        /*        //通过 ID 删除产品表及属性表
                public bool DeleteExByID(long ID)
                {
                    var dal = DALCreateHelper.CreateDAL<HStation.DAL.IAssetsPumpPartMain>();
                    var partmain = dal.GetByID(ID);
                    var propmodellist = AssetsPumpPropContent.GetProplistByPartID(ID);
                    var propentitylist = AssetsPumpPropContent.Model2Entities(propmodellist);
                    var bol = dal.DeleteEx(partmain, propentitylist);
                    if (bol)
                    {
                        RemoveCache(ID);
                        AssetsPumpPropContent.RemoveCacheByIDs(propmodellist.Select(x => x.ID).ToList());
                    }
                    return bol;
                }
        */
        //通过 ID 删除产品表及属性表
        public bool DeleteExByID(long ID)
        {
            var dal = DALCreateHelper.CreateDAL<HStation.DAL.IAssetsPumpPartMain>();
            var partmain = dal.GetByID(ID);
            var propmodellist = AssetsPumpPropContent.GetProplistByPartID(ID);
            var propentitylist = AssetsPumpPropContent.Model2Entities(propmodellist);
            var bol = dal.DeleteEx(partmain, propentitylist);
            if (bol)
            {
                RemoveCache(ID);
                AssetsPumpPropContent.RemoveCacheByIDs(propmodellist.Select(x => x.ID).ToList());
            }
            return bol;
        }
        #endregion Delete
    }