From 271faaf6664166dc368639b9f2e577f63f901be5 Mon Sep 17 00:00:00 2001
From: wei <kaede@kaededeMacBook-Air.local>
Date: 星期三, 23 十二月 2020 22:23:57 +0800
Subject: [PATCH] 20201223-99

---
 HDL_ON/Entity/Function/Function.cs |   99 +++++++++++++++++++++++++++++++++++++++++++------
 1 files changed, 86 insertions(+), 13 deletions(-)

diff --git a/HDL_ON/Entity/Function/Function.cs b/HDL_ON/Entity/Function/Function.cs
index a41d3d2..26c6ff3 100644
--- a/HDL_ON/Entity/Function/Function.cs
+++ b/HDL_ON/Entity/Function/Function.cs
@@ -316,31 +316,104 @@
                 return "FunctionData_" + sid;
             }
         }
+
         /// <summary>
-        /// 淇濆瓨鍔熻兘鏁版嵁
+        /// 淇濆瓨鍔熻兘鏂囦欢
         /// </summary>
-        public void SaveFunctionData(bool upSevser)
+        public void SaveFunctionFile()
         {
-            if (upSevser)
+            var ssd = System.Text.Encoding.UTF8.GetBytes(Newtonsoft.Json.JsonConvert.SerializeObject(this));
+            FileUtlis.Files.WriteFileByBytes(savePath, ssd);
+        }
+        /// <summary>
+        /// 淇濆瓨鎴块棿缁戝畾淇℃伅
+        /// </summary>
+        public void UpdataRoomIds()
+        {
+            new System.Threading.Thread(() =>
             {
-                var pm = new HttpServerRequest();
-                var pack = pm.UpdataDevcieInfo(this);
+                var pack = ApiUtlis.Ins.HttpRequest.UpdataDevcieBindRoomInfo(this);
+                //鐩存帴淇濆瓨鏈湴锛�
+                SaveFunctionFile();
                 if (pack.Code == StateCode.SUCCESS)
                 {
-                    var ssd = System.Text.Encoding.UTF8.GetBytes(Newtonsoft.Json.JsonConvert.SerializeObject(this));
-                    FileUtlis.Files.WriteFileByBytes(savePath, ssd);
                 }
                 else
                 {
                     IMessageCommon.Current.ShowErrorInfoAlter(pack.Code);
                 }
-            }
-            else
-            {
-                var ssd = System.Text.Encoding.UTF8.GetBytes(Newtonsoft.Json.JsonConvert.SerializeObject(this));
-                FileUtlis.Files.WriteFileByBytes(savePath, ssd);
-            }
+            })
+            { IsBackground = true }.Start();
         }
+        /// <summary>
+        /// 鏇存柊鍔熻兘淇℃伅
+        /// </summary>
+        public void UpdataFuncitonInfo()
+        {
+            new System.Threading.Thread(() =>
+            {
+                var pm = new HttpServerRequest();
+                var pack = pm.UpdataDevcieInfo(this);
+                SaveFunctionFile();
+                if (pack.Code == StateCode.SUCCESS)
+                {
+                }
+                else
+                {
+                    IMessageCommon.Current.ShowErrorInfoAlter(pack.Code);
+                }
+            })
+            { IsBackground = true }.Start();
+        }
+        /// <summary>
+        /// 鏇存柊鍔熻兘鍚嶇О
+        /// </summary>
+        public void UpdataFunctionName()
+        {
+            new System.Threading.Thread(() =>
+            {
+                var pm = new HttpServerRequest();
+                var pack = pm.UpdataDevcieInfo(this);
+                SaveFunctionFile();
+                if (pack.Code == StateCode.SUCCESS)
+                {
+                }
+                else
+                {
+                    IMessageCommon.Current.ShowErrorInfoAlter(pack.Code);
+                }
+            })
+            { IsBackground = true }.Start();
+        }
+        /// <summary>
+        /// 淇濆瓨鍔熻兘鏁版嵁
+        /// </summary>
+        //public void SaveFunctionData(bool upSevser)
+        //{
+        //    if (upSevser)
+        //    {
+        //        new System.Threading.Thread(() =>
+        //        {
+        //            var pm = new HttpServerRequest();
+        //            var pack = pm.UpdataDevcieInfo(this);
+        //            if (pack.Code == StateCode.SUCCESS)
+        //            {
+        //                var ssd = System.Text.Encoding.UTF8.GetBytes(Newtonsoft.Json.JsonConvert.SerializeObject(this));
+        //                FileUtlis.Files.WriteFileByBytes(savePath, ssd);
+        //            }
+        //            else
+        //            {
+        //                IMessageCommon.Current.ShowErrorInfoAlter(pack.Code);
+        //            }
+        //        })
+        //        { IsBackground = true }.Start();
+        //    }
+        //    else
+        //    {
+        //        var ssd = System.Text.Encoding.UTF8.GetBytes(Newtonsoft.Json.JsonConvert.SerializeObject(this));
+        //        FileUtlis.Files.WriteFileByBytes(savePath, ssd);
+        //    }
+        //}
 
 
         /// <summary>

--
Gitblit v1.8.0