From 1a1c8e71fcd14858f595029f089b2d4a00202b32 Mon Sep 17 00:00:00 2001
From: ogi <Administrator@S-OGI-PC>
Date: Fri, 05 Dec 2025 09:24:16 +0900
Subject: [PATCH] プロジェクトファイルを追加。

---
 ProtosExpan/Master/ItemTable.cs |   42 ++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 42 insertions(+), 0 deletions(-)

diff --git a/ProtosExpan/Master/ItemTable.cs b/ProtosExpan/Master/ItemTable.cs
new file mode 100644
index 0000000..1aa6a99
--- /dev/null
+++ b/ProtosExpan/Master/ItemTable.cs
@@ -0,0 +1,42 @@
+using HotelPms.Share.Util;
+using System;
+using System.Collections.Generic;
+using System.Data;
+using System.Diagnostics;
+using System.Linq;
+using System.Reflection;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace HotelPms.Data.Master;
+
+public partial class ItemTable
+{
+    /// <summary>
+    /// 自動データテーブル生成
+    /// </summary>
+    /// <returns></returns>
+    public DataTable ToDataTable()
+    {
+        DataTable dataTable = new DataTable();
+        dataTable.TableName = Name;
+        PropertyInfo[] myInfo = typeof(Item).GetProperties(BindingFlags.Public | BindingFlags.Instance);
+        foreach (PropertyInfo item in myInfo)
+        {
+            System.Diagnostics.Debug.WriteLine(item.Name);
+
+            Attribute attribute = item.GetCustomAttribute(typeof(DebuggerNonUserCodeAttribute));
+            if (attribute == null) { continue; }                
+            dataTable.Columns.Add(item.Name, item.PropertyType);
+        }
+
+        //データ
+        foreach (Item row in Rows)
+        {
+            DataRow dtRow = dataTable.NewRow();
+            row.ToDataRow(dtRow);
+            dataTable.Rows.Add(dtRow);
+        }
+        return dataTable;
+    }
+}

--
Gitblit v1.10.0