From 0bf9e65bc3ba98391e7835c922b15baab3c77876 Mon Sep 17 00:00:00 2001
From: 黄学彪 <hxb@hdlchina.com.cn>
Date: 星期一, 01 六月 2020 14:59:39 +0800
Subject: [PATCH] 上传一个合并的版本

---
 ZigbeeApp/Shared/Phone/UserCenter/Device/Panel/PanelFangyueFreshAirTargetsForm.cs |  226 +++++++++++++++++++++++++++++++++++++++++--------------
 1 files changed, 167 insertions(+), 59 deletions(-)

diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Device/Panel/PanelFangyueFreshAirTargetsForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Device/Panel/PanelFangyueFreshAirTargetsForm.cs
index f0a3123..b996092 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/Device/Panel/PanelFangyueFreshAirTargetsForm.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/Device/Panel/PanelFangyueFreshAirTargetsForm.cs
@@ -38,7 +38,7 @@
         /// <summary>
         /// 鏄剧ず琚粦瀹氳澶囨垨鍦烘櫙鐨剉iew
         /// </summary>
-        VerticalFrameRefreshControl midVerticalScrolViewLayout;
+        VerticalRefreshLayout midVerticalScrolViewLayout;
         /// <summary>
         /// 鏄剧ず鎴块棿鐨剉iew
         /// </summary>
@@ -221,7 +221,7 @@
             btnMidTopLayout.AddChidren(btnHorizontalScrolViewLayout);
 
             //璁惧鏍�
-            midVerticalScrolViewLayout = new VerticalFrameRefreshControl()
+            midVerticalScrolViewLayout = new VerticalRefreshLayout()
             {
                 Y = btnMidTopLayout.Bottom,
                 Height = Application.GetRealHeight(1145),
@@ -954,68 +954,128 @@
 
                                 var delResult = new DelDeviceBindResponseAllData();
                                 delResult = HdlDeviceBindLogic.Current.DelDeviceBindAsync(delDevice);
-                                if (delResult != null && delResult.removeBindResultResponseData != null)
-                                {
-                                    if (delResult.removeBindResultResponseData.Result == 0)
-                                    {
-                                        switch (curDeviceBindType)
-                                        {
-                                            case 1:
-                                                if (actionFreshAirTarget != null)
-                                                {
-                                                    actionFreshAirTarget("");
-                                                }
-                                                break;
-                                            case 2:
-                                                if (actionTemperatureTarget != null)
-                                                {
-                                                    actionTemperatureTarget("");
-                                                }
-                                                break;
-                                            case 3:
-                                                if (actionHumidityTarget != null)
-                                                {
-                                                    actionHumidityTarget("");
-                                                }
-                                                break;
-                                            case 4:
-                                                if (actionPMTarget != null)
-                                                {
-                                                    actionPMTarget("");
-                                                }
-                                                break;
-                                        }
-                                        Application.RunOnMainThread(() =>
-                                        {
-                                            CommonPage.Loading.Hide();
-                                            btnFinifh.Enable = true;
-                                            btnFinifh.BackgroundColor = Shared.Common.ZigbeeColor.Current.XMBlack;
-                                            this.RemoveFromParent();
-                                        });
-
-                                    }
-                                    else
-                                    {
-                                        Application.RunOnMainThread(() =>
-                                        {
-                                            new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.BindFailed), Direction = AMPopTipDirection.None, CloseTime = 1 }.Show(CommonPage.Instance);
-                                            btnFinifh.Enable = true;
-                                            btnFinifh.BackgroundColor = Shared.Common.ZigbeeColor.Current.XMBlack;
-                                            CommonPage.Loading.Hide();
-                                        });
-                                        return;
-                                    }
-                                }
-                                else
+                                if (delResult == null)
                                 {
                                     Application.RunOnMainThread(() =>
                                     {
-                                        new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.OperrateFailed), Direction = AMPopTipDirection.None, CloseTime = 1 }.Show(CommonPage.Instance);
+                                        new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.BindFailed), Direction = AMPopTipDirection.None, CloseTime = 1 }.Show(CommonPage.Instance);
                                         btnFinifh.Enable = true;
                                         btnFinifh.BackgroundColor = Shared.Common.ZigbeeColor.Current.XMBlack;
                                         CommonPage.Loading.Hide();
                                     });
                                     return;
+                                }
+                                else
+                                {
+                                    if (delResult.removeBindResultResponseData == null)
+                                    {
+                                        if (delResult.delDeviceBindResponseData != null)
+                                        {
+                                            foreach (var d in delResult.delDeviceBindResponseData.RemoveBindList)
+                                            {
+                                                if (d.Result == 1)
+                                                {
+                                                    switch (curDeviceBindType)
+                                                    {
+                                                        case 1:
+                                                            if (actionFreshAirTarget != null)
+                                                            {
+                                                                actionFreshAirTarget("");
+                                                            }
+                                                            break;
+                                                        case 2:
+                                                            if (actionTemperatureTarget != null)
+                                                            {
+                                                                actionTemperatureTarget("");
+                                                            }
+                                                            break;
+                                                        case 3:
+                                                            if (actionHumidityTarget != null)
+                                                            {
+                                                                actionHumidityTarget("");
+                                                            }
+                                                            break;
+                                                        case 4:
+                                                            if (actionPMTarget != null)
+                                                            {
+                                                                actionPMTarget("");
+                                                            }
+                                                            break;
+                                                    }
+                                                    Application.RunOnMainThread(() =>
+                                                    {
+                                                        CommonPage.Loading.Hide();
+                                                        btnFinifh.Enable = true;
+                                                        btnFinifh.BackgroundColor = Shared.Common.ZigbeeColor.Current.XMBlack;
+                                                        this.RemoveFromParent();
+                                                    });
+                                                }
+                                                else
+                                                {
+                                                    Application.RunOnMainThread(() =>
+                                                    {
+                                                        new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.BindFailed), Direction = AMPopTipDirection.None, CloseTime = 1 }.Show(CommonPage.Instance);
+                                                        btnFinifh.Enable = true;
+                                                        btnFinifh.BackgroundColor = Shared.Common.ZigbeeColor.Current.XMBlack;
+                                                        CommonPage.Loading.Hide();
+                                                    });
+                                                    return;
+                                                }
+                                            }
+                                        }
+                                    }
+                                    else
+                                    {
+                                        if (delResult.removeBindResultResponseData.Result == 0)
+                                        {
+                                            switch (curDeviceBindType)
+                                            {
+                                                case 1:
+                                                    if (actionFreshAirTarget != null)
+                                                    {
+                                                        actionFreshAirTarget("");
+                                                    }
+                                                    break;
+                                                case 2:
+                                                    if (actionTemperatureTarget != null)
+                                                    {
+                                                        actionTemperatureTarget("");
+                                                    }
+                                                    break;
+                                                case 3:
+                                                    if (actionHumidityTarget != null)
+                                                    {
+                                                        actionHumidityTarget("");
+                                                    }
+                                                    break;
+                                                case 4:
+                                                    if (actionPMTarget != null)
+                                                    {
+                                                        actionPMTarget("");
+                                                    }
+                                                    break;
+                                            }
+                                            Application.RunOnMainThread(() =>
+                                            {
+                                                CommonPage.Loading.Hide();
+                                                btnFinifh.Enable = true;
+                                                btnFinifh.BackgroundColor = Shared.Common.ZigbeeColor.Current.XMBlack;
+                                                this.RemoveFromParent();
+                                            });
+
+                                        }
+                                        else
+                                        {
+                                            Application.RunOnMainThread(() =>
+                                            {
+                                                new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.BindFailed), Direction = AMPopTipDirection.None, CloseTime = 1 }.Show(CommonPage.Instance);
+                                                btnFinifh.Enable = true;
+                                                btnFinifh.BackgroundColor = Shared.Common.ZigbeeColor.Current.XMBlack;
+                                                CommonPage.Loading.Hide();
+                                            });
+                                            return;
+                                        }
+                                    }
                                 }
                             }
                         }
@@ -1080,7 +1140,8 @@
                                 var delDevice = DelBindDevice(bd);
                                 var delResult = new DelDeviceBindResponseAllData();
                                 delResult = HdlDeviceBindLogic.Current.DelDeviceBindAsync(delDevice);
-                                if (delResult == null || delResult.removeBindResultResponseData == null)
+
+                                if (delResult == null)
                                 {
                                     Application.RunOnMainThread(() =>
                                     {
@@ -1090,6 +1151,29 @@
                                         CommonPage.Loading.Hide();
                                     });
                                     return;
+                                }
+                                else
+                                {
+                                    if (delResult.removeBindResultResponseData == null)
+                                    {
+                                        if (delResult.delDeviceBindResponseData != null)
+                                        {
+                                            foreach (var d in delResult.delDeviceBindResponseData.RemoveBindList)
+                                            {
+                                                if (d.Result != 1)
+                                                {
+                                                    Application.RunOnMainThread(() =>
+                                                    {
+                                                        new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.BindFailed), Direction = AMPopTipDirection.None, CloseTime = 1 }.Show(CommonPage.Instance);
+                                                        btnFinifh.Enable = true;
+                                                        btnFinifh.BackgroundColor = Shared.Common.ZigbeeColor.Current.XMBlack;
+                                                        CommonPage.Loading.Hide();
+                                                    });
+                                                    return;
+                                                }
+                                            }
+                                        }
+                                    }
                                 }
                                 if (delResult != null && delResult.removeBindResultResponseData != null)
                                 {
@@ -1116,7 +1200,8 @@
                                 var delDevice = DelBindDevice(curBindDevice);
                                 var delResult = new DelDeviceBindResponseAllData();
                                 delResult = HdlDeviceBindLogic.Current.DelDeviceBindAsync(delDevice);
-                                if (delResult == null || delResult.removeBindResultResponseData == null)
+
+                                if (delResult == null)
                                 {
                                     Application.RunOnMainThread(() =>
                                     {
@@ -1126,6 +1211,29 @@
                                         CommonPage.Loading.Hide();
                                     });
                                     return;
+                                }
+                                else
+                                {
+                                    if (delResult.removeBindResultResponseData == null)
+                                    {
+                                        if (delResult.delDeviceBindResponseData != null)
+                                        {
+                                            foreach (var d in delResult.delDeviceBindResponseData.RemoveBindList)
+                                            {
+                                                if (d.Result != 1)
+                                                {
+                                                    Application.RunOnMainThread(() =>
+                                                    {
+                                                        new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.BindFailed), Direction = AMPopTipDirection.None, CloseTime = 1 }.Show(CommonPage.Instance);
+                                                        btnFinifh.Enable = true;
+                                                        btnFinifh.BackgroundColor = Shared.Common.ZigbeeColor.Current.XMBlack;
+                                                        CommonPage.Loading.Hide();
+                                                    });
+                                                    return;
+                                                }
+                                            }
+                                        }
+                                    }
                                 }
                                 if (delResult != null && delResult.removeBindResultResponseData != null)
                                 {
@@ -1171,7 +1279,7 @@
                             addBindInfo.BindType = 0;
                             addBindInfo.BindMacAddr = de.DeviceAddr;
                             addBindInfo.BindEpoint = de.DeviceEpoint;
-                            addBindeDev.BindName = de.DeviceEpointName;
+                            addBindeDev.BindName = Common.LocalDevice.Current.GetDeviceEpointName(de);
                             switch (curDeviceBindType)
                             {
                                 case 2:

--
Gitblit v1.8.0