/// <summary> /// 根据主键编号修改部门信息(修改部门名和部门级别) /// </summary> /// <param name="entity"></param> /// <returns></returns> public int UpdateDepartByID(SysDepartEntity entity) { entity.IncludeDepartName(true) .IncludeParentNum(true); entity.Where <SysDepartEntity>("ID", ECondition.Eth); int line = this.SysDepart.Update(entity); if (line > 0) { CacheHelper.Remove(CacheKey.JOOSHOW_SYSDEPART_CACHE); } return(line); }
/// <summary> /// 修改部门信息(修改部门名称) /// 根据主键和父类编号修改部门信息 /// </summary> /// <param name="entity"></param> /// <returns></returns> public int UpdateDepart(SysDepartEntity entity) { entity.ThrowIfNull("修改部门信息对象为空"); entity.IncludeDepartName(true) ; //entity.Where<SysDepartEntity>("ID", ECondition.Eth) // .And<SysDepartEntity>("ParentNum", ECondition.Eth); entity.Where(a => a.DepartNum == entity.DepartNum); int line = this.SysDepart.Update(entity); if (line > 0) { CacheHelper.Remove(CacheKey.JOOSHOW_SYSDEPART_CACHE); } return(line); }