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/HotelTable.cs |   43 +++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 43 insertions(+), 0 deletions(-)

diff --git a/ProtosExpan/Master/HotelTable.cs b/ProtosExpan/Master/HotelTable.cs
new file mode 100644
index 0000000..eb2cb4b
--- /dev/null
+++ b/ProtosExpan/Master/HotelTable.cs
@@ -0,0 +1,43 @@
+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 HotelTable
+    {
+        /// <summary>
+        /// 自動データテーブル生成
+        /// </summary>
+        /// <returns></returns>
+        public DataTable ToDataTable()
+        {
+            DataTable dataTable = new DataTable();
+            dataTable.TableName = Name;
+            PropertyInfo[] myInfo = typeof(Hotel).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 (Hotel row in Rows)
+            {
+                DataRow dtRow = dataTable.NewRow();
+                row.ToDataRow(dtRow);
+                dataTable.Rows.Add(dtRow);
+            }
+            return dataTable;
+        }
+    }
+}

--
Gitblit v1.10.0