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