From bbc74a6dae2e90a811b2507c5896fe89aa29ccc0 Mon Sep 17 00:00:00 2001
From: 陈嘉乐 <cjl@hdlchina.com.cn>
Date: 星期三, 08 一月 2020 11:30:46 +0800
Subject: [PATCH] 2020-01-08 1.替换新服务器接口。

---
 Crabtree/SmartHome/UI/SimpleControl/Phone/Guide/GuideAddGateway.cs |   42 ++++++++++++++++++++++++------------------
 1 files changed, 24 insertions(+), 18 deletions(-)

diff --git a/Crabtree/SmartHome/UI/SimpleControl/Phone/Guide/GuideAddGateway.cs b/Crabtree/SmartHome/UI/SimpleControl/Phone/Guide/GuideAddGateway.cs
index 2f42b0b..dd93b39 100644
--- a/Crabtree/SmartHome/UI/SimpleControl/Phone/Guide/GuideAddGateway.cs
+++ b/Crabtree/SmartHome/UI/SimpleControl/Phone/Guide/GuideAddGateway.cs
@@ -148,7 +148,7 @@
 
             var title = new Button () {
                 TextAlignment = TextAlignment.Center,
-                Text = home.RegionName,
+                Text = home.Name,
                 TextColor = SkinStyle.Current.TextColor1,
                 TextSize = 19,
             };
@@ -303,7 +303,28 @@
                                 }
                            
                               
-                                if (backBytes.Length >= 33) {
+                                if (backBytes.Length >= 37) {
+
+                                    //******************浣忓畢ID string绫诲瀷*************
+                                    bool enable = backBytes [0] == 0 ? false : true;
+                                    //杩斿洖浣忓畢ID 杞负string绫诲瀷
+                                    string backIDStr = CommonPage.MyEncodingGB2312.GetString (backBytes, 1, 36).Trim ('\0');
+                                    //36FF"每每每每每每每每每每每每每每" 
+                                    //32FF 每每每每每每每每每每
+                                    if (enable || backIDStr == UserConfig.Instance.CurrentRegion.Id || string.IsNullOrEmpty (backIDStr) || backIDStr.Equals("每每每每每每每每每每每每每每")) {
+                                        goNext = true;
+                                    } else {
+                                        //#if DEBUG
+                                        //                                    Control.ControlBytesSendHasReturn (Command.Write_APP_Data_STORE_1D5E_CMD, common.SubnetID, common.DeviceID, new byte [] { 0, 0, 0, 0 });
+                                        //#endif
+                                        Application.RunOnMainThread (() => {
+                                            //new Alert ("", "This gateway has been bound to a residence, please reset it before binding to another residence.", Language.StringByID (R.MyInternationalizationString.Close)).Show ();
+                                            new Alert ("", ErrorCode.UnableToBindGateway, Language.StringByID (R.MyInternationalizationString.Close)).Show ();
+
+                                        });
+                                    }
+
+                                    //******************浣忓畢ID int绫诲瀷*************
                                     //bool enable = backBytes [32] == 0 ? false : true;
                                     //int bingResideceId = 0;
                                     ////杩斿洖浣忓畢ID 杞负string绫诲瀷
@@ -322,24 +343,9 @@
                                     //    });
                                     //}
 
-                                    bool enable = backBytes [32] == 0 ? false : true;
-                                    //杩斿洖浣忓畢ID 杞负string绫诲瀷
-                                    string backIDStr = CommonPage.MyEncodingGB2312.GetString (backBytes, 0, 32).Trim ('\0');
-                                    if (enable || backIDStr == UserConfig.Instance.CurrentRegion.RegionID || string.IsNullOrEmpty (backIDStr)) {
-                                        goNext = true;
-                                    } else {
-                                        //#if DEBUG
-                                        //                                    Control.ControlBytesSendHasReturn (Command.Write_APP_Data_STORE_1D5E_CMD, common.SubnetID, common.DeviceID, new byte [] { 0, 0, 0, 0 });
-                                        //#endif
-                                        Application.RunOnMainThread (() => {
-                                            new Alert ("", "This gateway has been bound to a residence, please reset it before binding to another residence.", Language.StringByID (R.MyInternationalizationString.Close)).Show ();
-                                        });
-                                    }
-
-
                                 } else {
                                     Application.RunOnMainThread (() => {
-                                        new Alert ("", "缃戝叧鍥轰欢鐗堟湰杩囦綆锛岃鍏堝崌绾э紒", Language.StringByID (R.MyInternationalizationString.Close)).Show ();
+                                        new Alert ("", ErrorCode.GatewayVersionLow, Language.StringByID (R.MyInternationalizationString.Close)).Show ();
                                     });
                                     //goNext = true;
                                 }

--
Gitblit v1.8.0