From c47c3ec2488961b3a006aaebcb03dba582f8b19b Mon Sep 17 00:00:00 2001
From: WJC <wjc@hdlchina.com.cn>
Date: 星期四, 12 三月 2020 17:08:42 +0800
Subject: [PATCH] 2020-03-12-1

---
 ZigbeeApp/Shared/Phone/UserCenter/Device/Bind/BindInfo.cs |  105 +++-------------------------------------------------
 1 files changed, 7 insertions(+), 98 deletions(-)

diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Device/Bind/BindInfo.cs b/ZigbeeApp/Shared/Phone/UserCenter/Device/Bind/BindInfo.cs
index a804ced..b22d780 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/Device/Bind/BindInfo.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/Device/Bind/BindInfo.cs
@@ -20,94 +20,6 @@
         /// </summary>
         public static List<CommonDevice> oldTargetList = new List<CommonDevice>();
 
-        //public static async System.Threading.Tasks.Task<int> RemoveTargets(BindObj.BindListResponseObj bindDevice, Panel currentKey)
-        //{
-        //    var delDevice = new BindObj.DelDeviceBindData();
-        //    delDevice.DeviceAddr = currentKey.DeviceAddr;
-        //    delDevice.Epoint = currentKey.DeviceEpoint;
-
-        //    if (bindDevice.BindType == 0 || bindDevice.BindType == 1)
-        //    {
-        //        var removeDevice = new BindObj.RemoveBindListObj();
-        //        removeDevice.BindCluster = bindDevice.BindCluster;
-        //        removeDevice.BindType = 0;
-        //        removeDevice.BindMacAddr = bindDevice.BindMacAddr;
-        //        removeDevice.BindEpoint = bindDevice.BindEpoint;
-        //        delDevice.RemoveBindList.Add(removeDevice);
-        //    }
-        //    else if (bindDevice.BindType == 2)
-        //    {
-        //        var removeDevice = new BindObj.RemoveBindListObj();
-        //        removeDevice.BindCluster = bindDevice.BindCluster;
-        //        removeDevice.BindType = 1;
-        //        removeDevice.BindScenesId = bindDevice.BindScenesId;
-        //        delDevice.RemoveBindList.Add(removeDevice);
-        //    }
-        //    var delResult = await currentKey.DelDeviceBindAsync(delDevice);
-        //    foreach (var re in delResult.delDeviceBindResponseData.RemoveBindList)
-        //    {
-        //        switch (re.Result)
-        //        {
-        //            case 0:
-        //                return 0;
-        //                break;
-        //            case 4:
-
-        //                if (delResult.removeBindResultResponseData != null)
-        //                {
-        //                    if (delResult.removeBindResultResponseData.Result == 0)
-        //                    {
-        //                        return 0;
-        //                    }
-        //                }
-        //                break;
-        //        }
-        //    }
-        //    return -1;
-        //}
-
-        public static async System.Threading.Tasks.Task<int> RemoveTargets(BindObj.BindListResponseObj bindDevice, Panel currentKey)
-        {
-            var delDevice = new BindObj.DelDeviceBindData();
-            delDevice.DeviceAddr = currentKey.DeviceAddr;
-            delDevice.Epoint = currentKey.DeviceEpoint;
-
-            if (bindDevice.BindType == 0 || bindDevice.BindType == 1)
-            {
-                var removeDevice = new BindObj.RemoveBindListObj();
-                removeDevice.BindCluster = bindDevice.BindCluster;
-                removeDevice.BindType = 0;
-                removeDevice.BindMacAddr = bindDevice.BindMacAddr;
-                removeDevice.BindEpoint = bindDevice.BindEpoint;
-                delDevice.RemoveBindList.Add(removeDevice);
-            }
-            else if (bindDevice.BindType == 2)
-            {
-                var removeDevice = new BindObj.RemoveBindListObj();
-                removeDevice.BindCluster = bindDevice.BindCluster;
-                removeDevice.BindType = 1;
-                removeDevice.BindScenesId = bindDevice.BindScenesId;
-                delDevice.RemoveBindList.Add(removeDevice);
-            }
-            var delResult = await currentKey.DelDeviceBindAsync(delDevice);
-            if (delResult != null && delResult.removeBindResultResponseData != null)
-            {
-                if (delResult.removeBindResultResponseData.Result == 0)
-                {
-                    return 0;
-                }
-                else
-                {
-                    new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.RemoveFailed), Direction = AMPopTipDirection.None, CloseTime = 2 }.Show(CommonPage.Instance);
-                }
-            }
-            else
-            {
-                new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.GwResponseOvertime), Direction = AMPopTipDirection.None, CloseTime = 2 }.Show(CommonPage.Instance);
-            }
-            return -1;
-        }
-
         /// <summary>
         /// 妫�娴嬭璁惧鑳藉惁鏄剧ず
         /// </summary>
@@ -134,7 +46,7 @@
         /// <returns></returns>
         public static bool CheckCanShowRoom(Common.Room room, string curDeviceBindType = "AddSwitch")
         {
-            if (room.DeviceUIList.Count == 0)
+            if (room.ListDevice.Count == 0)
             {
                 return false;
             }
@@ -142,10 +54,11 @@
             {
                 return false;
             }
-            foreach (var deviceUi in room.DeviceUIList)
+            foreach (var deviceKeys in room.ListDevice)
             {
+                var device = Common.LocalDevice.Current.GetDevice(deviceKeys);
                 //妫�娴嬭璁惧鑳藉惁鏄剧ず
-                if (CheckCanShowDevice(deviceUi.CommonDevice, curDeviceBindType) == false)
+                if (CheckCanShowDevice(device, curDeviceBindType) == false)
                 {
                     continue;
                 }
@@ -215,7 +128,7 @@
         /// <returns></returns>
         public static string GetCurrentKeyAllRoomList()
         {
-            var dicFloor = Common.Room.CurrentRoom.GetFloorSortList();
+            var dicFloor = HdlRoomLogic.Current.GetFloorSortList();
             foreach (var floorId in dicFloor.Keys)
             {
                 //绗竴涓ゼ灞�
@@ -231,7 +144,7 @@
         /// <returns></returns>
         public static string GetCurrentSelectFloorId()
         {
-            var dicFloor = Common.Room.CurrentRoom.GetFloorSortList();
+            var dicFloor = HdlRoomLogic.Current.GetFloorSortList();//
             foreach (var floorId in dicFloor.Keys)
             {
                 //绗竴涓ゼ灞�
@@ -247,7 +160,7 @@
         /// <returns></returns>
         public static string GetCurrentSelectFloorIdName()
         {
-            var dicFloor = Common.Room.CurrentRoom.GetFloorSortList();
+            var dicFloor = HdlRoomLogic.Current.GetFloorSortList();
             foreach (var floorId in dicFloor.Keys)
             {
                 //绗竴涓ゼ灞�
@@ -464,11 +377,7 @@
                     }
                 }
             }
-
             return dicCheck;
         }
-
-
-
     }
 }

--
Gitblit v1.8.0