/// <summary> /// 根据当前用户权限,返回该用户可以访问的所有ID /// </summary> /// <param name="sAuthorIDs"></param> /// <returns></returns> public string GetSpecialIDsFromAuthors(string sAuthorIDs, string sDepartmentID) { string sReturn = "-1"; AuthorizationInfoDataListManage manAuthor = new AuthorizationInfoDataListManage(); DepartmentInfoManage manDepart = new DepartmentInfoManage(); List <tblAuthorizationInfo> authors = manAuthor.GetRecordsByID <tblAuthorizationInfo>(sAuthorIDs); if (!authors.Select(x => x.Name).ToArray().Contains(UserRoleName.SUPER)) //如果不是超级管理员,只显示其所在部门和下级部门 { sReturn = manDepart.GetAllLeaf(sDepartmentID); } return(sReturn); }
/// <summary> /// 根据高校ID获取ParentDepartmentID /// </summary> /// <param name="sGxID"></param> /// <returns></returns> public long GetParentDepartIDfromGxID(long lGxID) { DepartmentInfoManage man = new DepartmentInfoManage(); Expression <Func <tblDepartmentInfo, bool> > where = (c => c.GxID == lGxID && c.DelFlag == false); List <tblDepartmentInfo> list = man.GetRecord(where); if ((list != null) && (list.Count > 0)) { return(list[0].ID); } else { return(0); } }