/// <summary> /// 根据条件获取部门负责人用户编号多个编号用,分割 /// </summary> /// <param name="Wherestr">null或“”将查询全部</param> /// <returns></returns> public static string GetUserIDListByDeptID(int topN, string clom, int id) { string users = XSql.GetDataTable("SELECT " + clom + " FROM TE_Departments where ID=" + id).Rows[0][0].ToString(); if (users != "") { users = XSql.GetXDataTable("SELECT" + (topN > 0 ? " top " + topN : "") + " UserID FROM TU_Users where UserID in('" + users.Replace(",", "','") + "') and State in(10,20) order by Grade desc").ToColValueList("','"); } return(users); }
/// <summary> /// 根据部门ID获取部门名称,部门ID用,分割 /// </summary> /// <param name="deptIdList">部门ID字符串</param> /// <returns>部门名称</returns> public static string GetDeptNameListByDeptIdList(string deptIdList) { if (deptIdList == "*") { return("所有部门"); } string con = !string.IsNullOrEmpty(deptIdList) ? " where ID in (" + deptIdList + ")" : " where 1<>1"; return(XSql.GetXDataTable("SELECT Name FROM TE_Departments" + con + "").ToColValueList()); }
/// <summary> /// 根据职务ID获取职务名称,职务用,分割 /// </summary> /// <param name="dutyIdList">职务ID字符串</param> /// <returns>职务名称</returns> public static string GetDutyNameListByDutyIdList(string dutyIdList) { if (dutyIdList == "*") { return("所有职务"); } string con = !string.IsNullOrEmpty(dutyIdList) ? " where ID in (" + dutyIdList + ")" : " where 1<>1"; return(XSql.GetXDataTable("SELECT Name FROM TE_Duties" + con + "").ToColValueList()); }
/// <summary> /// 根据用户ID获取用户姓名 /// </summary> /// <param name="guidList">用户ID字符串,中间用,分割</param> /// <returns>用户姓名</returns> public static string GetRealNameListByUserIdList(string guidList) { if (guidList == "*") { return("所有人员"); } string con = !string.IsNullOrEmpty(guidList)?" where UserID in ('" + guidList.Replace(",", "','") + "')":" where 1<>1"; return(XSql.GetXDataTable("SELECT RealName FROM TU_Users" + con).ToColValueList()); }
/// <summary> /// 根据条件获取用户编号多个编号用,分割 /// </summary> /// <param name="Wherestr">null或“”将查询全部</param> /// <returns></returns> public static string GetUserIDListByWhereStr(int topN, string Wherestr) { string con = !string.IsNullOrEmpty(Wherestr) ? " where " + Wherestr : ""; return(XSql.GetXDataTable("SELECT" + (topN > 0?" top " + topN:"") + " UserID FROM TU_Users" + con + "").ToColValueList("','")); }