testaaaaa

该篇文章详细描述了一个过程,使用C#代码遍历请求中的不同审批者字段(approver2,approvers,approver),通过OAManager获取每个员工的EmpDataConfig并合并为单个值,最后更新字段值。
摘要由CSDN通过智能技术生成
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;
                        }
                    }

评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值