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.Share/Xml/XmlOperation.cs |  135 +++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 135 insertions(+), 0 deletions(-)

diff --git a/HotelPms.Share/Xml/XmlOperation.cs b/HotelPms.Share/Xml/XmlOperation.cs
new file mode 100644
index 0000000..0b84e8c
--- /dev/null
+++ b/HotelPms.Share/Xml/XmlOperation.cs
@@ -0,0 +1,135 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+using System.Xml;
+
+namespace HotelPms.Share.Xml
+{
+    public class XmlOperation
+    {
+        /// ****************************** Description *******************************
+        /// ���V�X�e������
+        /// �@�ėp�N���X
+        /// ���T�v
+        /// �@XML�̑���F�lj��A�C���A�폜�A�����Ȃ�
+        /// <>�g�p���@
+        /// ������
+        /// �@2007/11/10  ���؁@����    �V�K�쐬
+        /// ****************************** Declarations ******************************
+        #region  �����������@Declartions�@����������
+
+        private string fileName;
+        private XmlDocument? xd;
+
+        #endregion
+
+        #region  �����������@Property�@����������
+
+        public string FileName
+        {
+            get { return fileName; }
+            set { fileName = value; }
+        }
+	        
+        #endregion
+
+        #region  �����������@Class Event�@����������
+
+        public XmlOperation()
+            : this("")
+        {
+        }
+
+        public XmlOperation(string fileName)
+        {
+            if (!fileName.Equals(""))
+            {
+                this.fileName = fileName;
+            }
+            xd = new XmlDocument();
+            xd.Load(this.fileName);
+        }
+
+        #endregion
+
+        #region  �����������@Private Function�@����������
+        #endregion
+
+        #region  �����������@Public  Function�@����������
+
+        public XmlElement? AddNode(string parentXPath, string key, string value)
+        {
+            try
+            {
+                XmlElement ownerNode = (XmlElement)xd.SelectSingleNode(parentXPath);
+                XmlElement newNode = xd.CreateElement(key);
+                newNode.InnerText = value;
+                ownerNode.AppendChild(newNode);
+                return newNode;
+            }
+            catch
+            {
+                return null;
+            }
+        }
+
+        /// <summary>
+        /// Node��Text�̏C��
+        /// </summary>
+        /// <param name="xPath"></param>
+        /// <param name="value"></param>
+        /// <returns></returns>
+        public bool SetNodeText(string xPath,string value)
+        {
+            try
+            {
+                xd.SelectSingleNode(xPath).InnerText = value;
+                return true;
+            }
+            catch
+            {
+                return false;
+            }
+        }
+
+        /// <summary>
+        /// Node��Text���擾����
+        /// </summary>
+        /// <param name="xPath"></param>
+        /// <returns></returns>
+        public string GetNodeText(string xPath)
+        {
+            return xd.SelectSingleNode(xPath).InnerText;
+        }
+
+
+        /// <summary>
+        /// Node����
+        /// </summary>
+        /// <param name="xPath"></param>
+        /// <returns></returns>
+        public XmlNode? SelectSingleNode(string xPath)
+        {
+            return xd.SelectSingleNode(xPath);
+        }
+        
+        /// <summary>
+        /// �ۑ�����
+        /// </summary>
+        /// <returns></returns>
+        public bool Save()
+        {
+            try
+            {
+                xd.Save(fileName);
+                return true;
+            }
+            catch
+            {
+                return false;
+            }
+        }
+
+        #endregion
+    }
+}

--
Gitblit v1.10.0