| | |
| | | { |
| | | try |
| | | { |
| | | string sReturn = ""; |
| | | List<object> columnNameList = new List<object>(); |
| | | //根据当前人获取职务 |
| | | string sql = "select a.Czymc 用户名称,c.GroupName 职务 from Gy_Czygl a left join System_UserGroupInfo b on a.Czybm = b.UserId left join System_UserGroup c on b.GroupId = c.GroupID where a.Czymc = '"+HName+"'"; |
| | | ds = oCN.RunProcReturn(sql, "Gy_ErrMsgBackType"); |
| | | string Job = ds.Tables[0].Rows[0]["职务"].ToString(); |
| | | if (oSystemParameter.ShowBill(ref sReturn) == true) |
| | | { |
| | | //系统参数是否为私有云模式,N为本地,Y为斯莫尔 |
| | | if (oSystemParameter.omodel.OA_ErrMsgBackBill_SendDingDingMsg == "N") |
| | | { |
| | | Job = ds.Tables[0].Rows[0]["职务"].ToString(); |
| | | } |
| | | else |
| | | { |
| | | Job = "注塑班组长"; |
| | | } |
| | | } |
| | | |
| | | //根据职务找到他的上级 |
| | | string sql1 = "select * from Gy_Duty where HParentID=(select HParentID from Gy_Duty where HItemID =(select HParentID from Gy_Duty group by HParentID, HName having HName = '"+Job+"' and count(*) = 1))"; |
| | | ds = oCN.RunProcReturn(sql1, "Gy_Duty"); |
| | | ds = oCN.RunProcReturn(sql1, "Gy_Duty"); |
| | | string Job1= ds.Tables[0].Rows[0]["HName"].ToString(); |
| | | //用上级的职务找到用户 |
| | | string sql2 = "select a.Czymc 用户名称 from Gy_Czygl a left join System_UserGroupInfo b on a.Czybm = b.UserId left join System_UserGroup c on b.GroupId = c.GroupID where c.GroupName = '"+Job1+"'"; |