【金蝶云星空】插件二开→工具类分享篇之通过枚举值获取对应的枚举名称

栏目:云星空知识作者:金蝶来源:金蝶云社区发布:2024-09-16浏览:1

【金蝶云星空】插件二开→工具类分享篇之通过枚举值获取对应的枚举名称

## 【金蝶云星空】插件二开→工具类分享篇 ### 通过枚举值获取对应的枚举名称,代码即取即用: ```language c# /// 通过枚举值获取对应的枚举名称 /// fvalue 枚举值 /// erpEnumTypeFid 枚举内码ID public static string GetErpEnumName(Context ctx, string fvalue,string erpEnumTypeFid) { string erpEnumName = ""; string sql = string.Format($@"/*dialect*/ select t2_L.FCAPTION,t2.* from T_META_FORMENUM_L t1_L left join T_META_FORMENUM t1 on t1_L.FID = t1.FID and t1_L.FLOCALEID = 2052 left join T_META_FORMENUMITEM t2 on t1.FID = t2.FID left join T_META_FORMENUMITEM_L t2_L on t2.FENUMID = t2_L.FENUMID and t1_L.FLOCALEID = 2052 where t1_L.fid = '{erpEnumTypeFid}' and t2.FVALUE = '{fvalue}'"); DynamicObjectCollection dynamicObjects = DBUtils.ExecuteDynamicObject(ctx, sql); foreach (var item in dynamicObjects) { if (item["FCAPTION"] == null) { return erpEnumName; } erpEnumName = item["FCAPTION"].ToString(); } return erpEnumName; } ```

【金蝶云星空】插件二开→工具类分享篇之通过枚举值获取对应的枚举名称

## 【金蝶云星空】插件二开→工具类分享篇### 通过枚举值获取对应的枚举名称,代码即取即用:```language c# /// 通过...
点击下载文档
确认删除?
回到顶部
客服QQ
  • 客服QQ点击这里给我发消息