From 98c998ca98ee014266f65a517d672df0cd97f244 Mon Sep 17 00:00:00 2001
From: WJC <wjc@hdlchina.com.cn>
Date: 星期三, 25 三月 2020 17:51:18 +0800
Subject: [PATCH] 2020-03-25-1

---
 ZigbeeApp/Shared/Phone/Device/Logic/Method.cs |   62 ++++++++++++++++++++++--------
 1 files changed, 45 insertions(+), 17 deletions(-)

diff --git a/ZigbeeApp/Shared/Phone/Device/Logic/Method.cs b/ZigbeeApp/Shared/Phone/Device/Logic/Method.cs
index 16cbc62..354f6bd 100644
--- a/ZigbeeApp/Shared/Phone/Device/Logic/Method.cs
+++ b/ZigbeeApp/Shared/Phone/Device/Logic/Method.cs
@@ -97,40 +97,47 @@
         {
             List<string> devicetypelist = new List<string>();
             devicetypelist.Clear();
+
             var lightjosn = devicelist.Find((device) => device.Type == DeviceType.DimmableLight || device.Type == DeviceType.OnOffOutput);
             if (lightjosn != null)
             {
                 devicetypelist.Add(Language.StringByID(MyInternationalizationString.Lights));
             }
-            var iASZonejosn = devicelist.Find((device) => device.Type == DeviceType.IASZone || device.Type == DeviceType.TemperatureSensor);
-            if (iASZonejosn != null)
-            {
-                devicetypelist.Add(Language.StringByID(MyInternationalizationString.sensor));
-            }
-            var onOffSwitchjson = devicelist.Find((device) => device.Type == DeviceType.OnOffSwitch);
-            if (onOffSwitchjson != null)
-            {
-                devicetypelist.Add(Language.StringByID(MyInternationalizationString.OnOffSwitch));
-            }
-            var doorLock = devicelist.Find((device) => device.Type == DeviceType.DoorLock);
-            if (doorLock != null)
-            {
-                devicetypelist.Add(Language.StringByID(MyInternationalizationString.doorLock));
-            }
+
             var curtainjosn = devicelist.Find((device) => device.Type == DeviceType.WindowCoveringDevice);
             if (curtainjosn != null)
             {
                 devicetypelist.Add(Language.StringByID(MyInternationalizationString.Curtains));
             }
+
             var ac = devicelist.Find((device) => device.Type == DeviceType.Thermostat);
             if (ac != null)
             {
                 devicetypelist.Add(Language.StringByID(MyInternationalizationString.AC));
             }
+
+            var onOffSwitchjson = devicelist.Find((device) => device.Type == DeviceType.OnOffSwitch);
+            if (onOffSwitchjson != null)
+            {
+                devicetypelist.Add(Language.StringByID(MyInternationalizationString.OnOffSwitch));
+            }
+
+            var doorLock = devicelist.Find((device) => device.Type == DeviceType.DoorLock);
+            if (doorLock != null)
+            {
+                devicetypelist.Add(Language.StringByID(MyInternationalizationString.doorLock));
+            }
+
             var airSwitch = devicelist.Find((device) => device.Type == DeviceType.AirSwitch);
             if (airSwitch != null)
             {
                 devicetypelist.Add(Language.StringByID(MyInternationalizationString.Airswitch));
+            }
+
+            var iASZonejosn = devicelist.Find((device) => device.Type == DeviceType.IASZone || device.Type == DeviceType.TemperatureSensor);
+            if (iASZonejosn != null)
+            {
+                devicetypelist.Add(Language.StringByID(MyInternationalizationString.sensor));
             }
 
             return devicetypelist;
@@ -712,6 +719,9 @@
         /// <param name="CurrentLogic">褰撳墠閫昏緫</param>
         public async static void SaveLogic(string if_logic, string name, bool tag, Common.Logic CurrentLogic)
         {
+            //璁板綍閫昏緫绫诲瀷
+            //鍙槸瀵硅烦杞晫闈㈡湁鐢紝鍩烘湰娌″暐鐢�
+            int Type = CurrentLogic.LogicType;
             if (string.IsNullOrEmpty(name))
             {
                 var alert = new UserCenter.ShowMsgControl(UserCenter.ShowMsgType.Normal,
@@ -765,13 +775,29 @@
                 //TipView("娣诲姞鑷姩鍖栧け璐�");
                 //return;
             }
-            UserView.HomePage.Instance.RemoveViewByTag("Logic");
+          
+
             if (LogicView.IfString._Logic == if_logic)
             {
-                Category.Category.instance?.RefreshBodyView();
+                if (Type == 0)
+                {
+                   
+                    UserView.HomePage.Instance.RemoveViewByTag("Logic");
+                    //鍙埛鏂板垎绫讳笂涓嬫粦鍔╲iew锛�
+                    Phone.Category.CategoryMainForm.instance?.RefreshBodyView();
+                    // Category.Category.instance?.RefreshBodyView();
+                }
+                else if (Type == 2)
+                {
+                    //鍒锋柊鏁翠釜鍒嗙被锛�
+                    //闂ㄩ攣甯稿紑妯″紡鐗规畩;
+                    UserView.UserPage.Instance.ShowCategoryAutoListForm();
+
+                }
             }
             else if (LogicView.IfString._LockLogic == if_logic)
             {
+                UserView.HomePage.Instance.RemoveViewByTag("Logic");
                 var doorLockLogicList = new DoorLockLogic.LockLogicList();
                 UserView.HomePage.Instance.AddChidren(doorLockLogicList);
                 UserView.HomePage.Instance.PageIndex += 1;
@@ -791,5 +817,7 @@
             UserView.HomePage.Instance.PageIndex += 1;
             deviceTarget.Show(str1, str2);
         }
+
+       
     }
 }

--
Gitblit v1.8.0