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] プロジェクトファイルを追加。

---
 HotelPms.SourceFactory/Util/TypeScriptFactory.cs |   46 ++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 46 insertions(+), 0 deletions(-)

diff --git a/HotelPms.SourceFactory/Util/TypeScriptFactory.cs b/HotelPms.SourceFactory/Util/TypeScriptFactory.cs
new file mode 100644
index 0000000..52b5028
--- /dev/null
+++ b/HotelPms.SourceFactory/Util/TypeScriptFactory.cs
@@ -0,0 +1,46 @@
+namespace HotelPms.SourceFactory.Util
+{
+    public class TypeScriptFactory
+    {
+        public static string ToTsType(string sqlType)
+        {
+            switch (sqlType)
+            {
+                case "int":
+                case "tinyint":
+                case "smallint":
+                case "decimal":
+                case "float":
+                    return "number";
+                case "bit":
+                    return "boolean";
+                case "smalldatetime":
+                case "datetime":
+                    return "Date";
+                default:
+                    return "string";
+            }
+        }
+
+        public static string GetDefValue(string sqlType)
+        {
+            switch (sqlType)
+            {
+                case "int":
+                case "tinyint":
+                case "smallint":
+                    return "0";
+                case "decimal":
+                case "float":
+                    return "0";
+                case "bit":
+                    return "false";
+                case "smalldatetime":
+                case "datetime":
+                    return "new Date()";
+                default:
+                    return "''";
+            }
+        }
+    }
+}

--
Gitblit v1.10.0