From ee6683a1351733a7c5b1e50a7722c96dfd42e2a2 Mon Sep 17 00:00:00 2001 From: hao <1836460075@qq.com> Date: 星期五, 30 五月 2025 16:25:28 +0800 Subject: [PATCH] 退换料确认 --- StandardInterface/MES.Service/util/DataTableExtension.cs | 29 +++++++++++++++++++++++++++++ 1 files changed, 29 insertions(+), 0 deletions(-) diff --git a/StandardInterface/MES.Service/util/DataTableExtension.cs b/StandardInterface/MES.Service/util/DataTableExtension.cs new file mode 100644 index 0000000..01ed599 --- /dev/null +++ b/StandardInterface/MES.Service/util/DataTableExtension.cs @@ -0,0 +1,29 @@ +锘縰sing System; +using System.Collections.Generic; +using System.Data; +using System.Dynamic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace MES.Service.util +{ + public static class DataTableExtension + { + public static List<dynamic> ToDynamic(this DataTable dt) + { + var list = new List<dynamic>(); + foreach (DataRow row in dt.Rows) + { + dynamic obj = new ExpandoObject(); + var dict = (IDictionary<string, object>)obj; + foreach (DataColumn col in dt.Columns) + dict[col.ColumnName] = row[col]; + list.Add(obj); + } + return list; + } + } + + +} -- Gitblit v1.9.3