private void getUserIDByIdentifier(string PositionTypeCode, int OrganizationUnitID, ref string userid, ref string email) { try { string Pid = string.Empty;//职位 APWorkFlowTableAdapters.StuffUserTableAdapter TAUser = new APWorkFlowTableAdapters.StuffUserTableAdapter(); APWorkFlow.StuffUserDataTable dt = TAUser.GetDataByNode(PositionTypeCode, OrganizationUnitID); if (dt.Rows.Count < 1) { userid = "none";//此处给出找不到人时的标识 email = ""; } else { foreach (APWorkFlow.StuffUserRow dataRow in dt.Rows) { //人员 if (!string.IsNullOrEmpty(dataRow.StuffUserId.ToString())) { userid += "P" + dataRow.StuffUserId + "P"; } //职位 if (!string.IsNullOrEmpty(dataRow.PositionId.ToString())) { Pid += "P" + dataRow.PositionId + "P"; } //email if (!string.IsNullOrEmpty(dataRow.EMail)) { email += dataRow.EMail + ";"; } } userid = userid + "$" + Pid; } } catch (Exception) { throw; } }
//得到用户邮箱 public string getUserEmailByID(int userid) { APWorkFlowTableAdapters.StuffUserTableAdapter TAUser = new APWorkFlowTableAdapters.StuffUserTableAdapter(); APWorkFlow.StuffUserDataTable dt = TAUser.GetDataByID(userid); return(dt[0].EMail); }