/// <summary> /// 根据产品的唯一编号删除产品 /// </summary> /// <param name="SnNum"></param> /// <returns></returns> public int Delete(string SnNum) { string Key = string.Format(CacheKey.JOOSHOW_PRODUCT_CACHE, this.CompanyID); ProductEntity entity = new ProductEntity(); entity.IsDelete = (int)EIsDelete.Deleted; entity.IncludeIsDelete(true); entity.Where(item => item.SnNum == SnNum); entity.And(a => a.CompanyID == this.CompanyID); int line = this.Product.Update(entity); if (line > 0) { CacheHelper.Remove(Key); } return(line); }
/// <summary> /// 删除产品信息 /// </summary> /// <param name="snNum"></param> /// <returns></returns> public int Delete(IEnumerable <string> list) { string Key = string.Format(CacheKey.JOOSHOW_PRODUCT_CACHE, this.CompanyID); ProductEntity entity = new ProductEntity(); entity.IsDelete = (int)EIsDelete.Deleted; entity.IncludeIsDelete(true); entity.Where("SnNum", ECondition.In, list.ToArray()); entity.And(a => a.CompanyID == this.CompanyID); int line = this.Product.Update(entity); if (line > 0) { CacheHelper.Remove(Key); } return(line); }