foreach (var a in request.mainTables)
{
switch (a.fieldname)
{
case "approver2":
string appEmp = "";
var approver2 = request.mainTables.Where
(exp => exp.fieldname == "approver2").FirstOrDefault().fieldvalue;
foreach (var b in approver2.Split(','))
{
EmpDataConfig empDataConfig = OAManager.GetEmpDataConfig(request.company, b);
if (empDataConfig != null)
appEmp += empDataConfig.gfmEmpId + ",";
}
request.mainTables.Where
(exp => exp.fieldname == "approver2").FirstOrDefault().fieldvalue =
appEmp.TrimEnd(',');
break;
case "approvers":
string appEmp1 = "";
var approvers = request.mainTables.Where
(exp => exp.fieldname == "approvers").FirstOrDefault().fieldvalue;
foreach (var b in approvers.Split(','))
{
EmpDataConfig empDataConfig = OAManager.GetEmpDataConfig(request.company, b);
if (empDataConfig != null)
appEmp1 += empDataConfig.gfmEmpId + ",";
}
request.mainTables.Where
(exp => exp.fieldname == "approvers").FirstOrDefault().fieldvalue =
appEmp1.TrimEnd(',');
break;
case "approver":
string appEmp2 = "";
var approver = request.mainTables.Where
(exp => exp.fieldname == "approver").FirstOrDefault().fieldvalue;
foreach (var b in approver.Split(','))
{
EmpDataConfig empDataConfig = OAManager.GetEmpDataConfig(request.company, b);
if (empDataConfig != null)
appEmp2 += empDataConfig.gfmEmpId + ",";
}
request.mainTables.Where
(exp => exp.fieldname == "approver").FirstOrDefault().fieldvalue =
approver.TrimEnd(',');
break;
}
}
testaaaaa
最新推荐文章于 2024-11-12 21:14:07 发布
该篇文章详细描述了一个过程,使用C#代码遍历请求中的不同审批者字段(approver2,approvers,approver),通过OAManager获取每个员工的EmpDataConfig并合并为单个值,最后更新字段值。
摘要由CSDN通过智能技术生成