/// <summary> /// 根据部门ID取出部门负责人、部门领导和大于某职位的人 /// </summary> /// <param name="strDeptID">部门ID</param> /// <param name="strPost">职位名称</param> /// <param name="enmuType">职务类型枚举</param> /// <param name="iFloorCode">层级(0自己,>0 子部门层数,-1所有)</param> /// <returns></returns> private static ViewBase GetUserByDeptPost(string strDeptID, string strPost, Common.LeaderType enmuType, int iFloorCode) { ViewBase vb = null; Department dept = Department.GetDepartment(OADept.ConvertInt(strDeptID)); if (dept != null) { vb = OAUser.FilterUser(dept.GetManagerOrLeader(iFloorCode, enmuType, strPost)); } return(vb); }
/// <summary> /// 根据部门的ID和职位名称取出大于这个职位的人(向下遍历) /// </summary> /// <param name="strDeptID">部门ID</param> /// <param name="strPostName">职位名称</param> /// <param name="iFloorCode">层级(0自己,>0 子部门层数,-1所有)</param> /// <returns >ViewBase</returns> private static ViewBase GetSupUserByPost(string strDeptID, string strPostName, int iFloorCode) { ViewBase vb = null; Department dept = Department.GetDepartment(OADept.ConvertInt(strDeptID)); if (dept != null) { vb = OAUser.FilterUser(dept.GetUserByPosition(strPostName, iFloorCode)); } return(vb); }
/// <summary> /// 根据部门ID获取部门领导 /// </summary> /// <param name="strDeptID">部门ID</param> /// <param name="iFloorCode">层级(0.自己;-1.所有)</param> /// <returns>ViewBase</returns> public static ViewBase GetDeptLeader(String strDeptID, int iFloorCode) { ViewBase vb = null; Department dept = Department.GetDepartment(OADept.ConvertInt(strDeptID)); if (dept != null) { vb = OAUser.FilterUser(dept.GetLeaders(iFloorCode)); } return(vb); }
/// <summary> /// 根据部门的ID和角色的名称获取用户的信息 /// </summary> /// <param name="strDeptID"> 部门ID</param> /// <param name="strRoleName">角色名称</param> /// <param name="iFloorCode">向下遍历的层级(0.自己 ;-1.所有)</param> /// <returns>ViewBase</returns> public static ViewBase GetUserByDeptIDRole(String strDeptID, String strRoleName, int iFloorCode) { ViewBase vb = null; if (String.IsNullOrEmpty(strDeptID) == false && String.IsNullOrEmpty(strRoleName) == false) { Role role = Role.GetRole(strRoleName); if (role != null) { vb = OAUser.FilterUser(role.GetUserByDept(OADept.ConvertInt(strDeptID))); } } return(vb); }
/// <summary> /// 根据部门的ID和职位名称取人支持多个职位以逗号分隔 /// </summary> /// <param name="strDeptID">部门ID</param> /// <param name="strPostName">职位名称</param> /// <param name="iFloorCode">层级</param> /// <returns >ViewBase</returns> public static ViewBase GetUserByPost(string strDeptID, string strPostName, int iFloorCode) { ViewBase vb = null; int deptID = OADept.ConvertInt(strDeptID); if (deptID != int.MinValue && string.IsNullOrEmpty(strPostName) == false) { Department dept = Department.GetDepartment(deptID); if (dept != null) { vb = OAUser.FilterUser(dept.GetUserByPostNames(strPostName, iFloorCode)); } } return(vb); }
/// <summary> /// 根据部门ID获取部门人员信息 /// </summary> /// <param name="strDeptID">部门ID</param> /// <param name="iFloorCode">向下遍历的层级(0.自己 ;-1.所有)</param> /// <returns>ViewBase</returns> public static ViewBase GetUserByDeptID(String strDeptID, int iFloorCode) { ViewBase vb = null; int index = OADept.ConvertInt(strDeptID); if (index != int.MinValue) { Department dept = OADept.GetDeptByDeptID(strDeptID); if (dept != null) { vb = OAUser.FilterUser(dept.GetChildDeptUsers(iFloorCode)); } vb.Sort = "e.SortNum,a.Userid"; } return(vb); }
/// <summary> /// 根据处室部门的ID和用户账号找出用户所属该处室下的科室 /// </summary> /// <param name="strDeptID">部门ID</param> /// <param name="strUserID">用户账号</param> /// <param name="iFloorCode">层级(1.处室,2.科室……)</param> /// <returns>ViewBase</returns> public static ViewBase GetDeptByDeptUser(string strDeptID, string strUserID, int iFloorCode) { ViewBase vb = null; if (string.IsNullOrEmpty(strUserID) == false) { vb = OADept.GetDeptByUser(strUserID, iFloorCode); if (string.IsNullOrEmpty(strDeptID) == false && OADept.ConvertInt(strDeptID) != int.MinValue) { if (vb != null) { vb.Condition = "a.ParentID=" + OADept.ConvertInt(strDeptID); } } } return(vb); }