/// <summary> /// 批量删除产品类型 /// </summary> /// <param name="list"></param> /// <returns></returns> public int DelBat(List<string> list) { using (TransactionScope ts = new TransactionScope()) { int line = 0; foreach (string cateNum in list) { ProductCategoryEntity entity = new ProductCategoryEntity(); entity.Where(a => a.CateNum == cateNum); entity.IsDelete = (int)EIsDelete.Deleted; entity.IncludeIsDelete(true); line += this.ProductCategory.Update(entity); } ts.Complete(); if (line > 0) { CacheHelper.Remove(CacheKey.JOOSHOW_PRODUCTCATEGORY_CACHE); } return line; } }
/// <summary> /// 根据产品类别删除删除 /// </summary> /// <param name="cateNum"></param> /// <returns></returns> public int Delete(string cateNum) { ProductCategoryEntity entity = new ProductCategoryEntity(); entity.Where(a => a.CateNum == cateNum); entity.IsDelete = (int)EIsDelete.Deleted; entity.IncludeIsDelete(true); int line = this.ProductCategory.Update(entity); if (line > 0) { CacheHelper.Remove(CacheKey.JOOSHOW_PRODUCTCATEGORY_CACHE); } return line; }