From 16604a593202f2f87adf71abd57d036fe7da3b52 Mon Sep 17 00:00:00 2001
From: 黄学彪 <hxb@hdlchina.com.cn>
Date: 星期一, 18 十一月 2019 10:39:42 +0800
Subject: [PATCH] 同步了全部的代码

---
 ZigbeeApp/Shared/Phone/UserCenter/Gateway/Manage/GatewayUploadAndDownLoadForm.cs |   50 ++++++++++++++++++++++++++++++++++++++++++++++++--
 1 files changed, 48 insertions(+), 2 deletions(-)

diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Gateway/Manage/GatewayUploadAndDownLoadForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Gateway/Manage/GatewayUploadAndDownLoadForm.cs
index 3688714..7bb53ef 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/Gateway/Manage/GatewayUploadAndDownLoadForm.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/Gateway/Manage/GatewayUploadAndDownLoadForm.cs
@@ -69,7 +69,11 @@
             var btnSwicth = frameAuto.AddMostRightSwitchIcon();
             btnSwicth.ButtonClickEvent += (sender, e) =>
             {
-                btnSwicth.IsSelected = !btnSwicth.IsSelected;
+                //璁剧疆鐘舵��
+                if (HdlGatewayLogic.Current.SetGatewayAutoBackupStatu(this.realGateway, !btnSwicth.IsSelected) == true)
+                {
+                    btnSwicth.IsSelected = !btnSwicth.IsSelected;
+                }
             };
 
             //涓婁紶鏁版嵁鑷充簯绔�
@@ -114,16 +118,58 @@
             frameDown.AddRightArrow();
             frameDown.ButtonClickEvent += (sender, e) =>
             {
+                if (this.realGateway == null)
+                {
+                    //閿欒:缃戝叧瀵硅薄涓㈠け
+                    string msg = Language.StringByID(R.MyInternationalizationString.uErrorGatewayLostMsg);
+                    this.ShowMassage(ShowMsgType.Error, msg);
+                    return;
+                }
                 var form = new GatewayBackUpListForm();
                 form.AddForm(this.realGateway);
             };
             //璋冩暣鐪熷疄楂樺害
             listView.AdjustRealHeight(Application.GetRealHeight(23));
+
+            HdlThreadLogic.Current.RunThread(() =>
+            {
+                //鑾峰彇缃戝叧鏁版嵁
+                this.GetGatewayData(btnSwicth);
+            });
         }
 
         #endregion
 
-        #region 鈻� 涓�鑸柟娉昣__________________________
+        #region 鈻� 鑾峰彇鏁版嵁___________________________
+
+        /// <summary>
+        /// 鑾峰彇缃戝叧鏁版嵁
+        /// </summary>
+        /// <param name="btnSwitch"></param>
+        private void GetGatewayData(MostRightIconControl btnSwitch)
+        {
+            //鎵撳紑杩涘害鏉�
+            this.ShowProgressBar();
+
+            //鑾峰彇缃戝叧鑷姩璁剧疆鐘舵��
+            var statu = HdlGatewayLogic.Current.GetGatewayAutoBackupStatu(realGateway);
+            if (statu == -1)
+            {
+                //鍏抽棴杩涘害鏉�
+                this.CloseProgressBar(ShowReLoadMode.YES);
+                return;
+            }
+            if (statu == 1)
+            {
+                HdlThreadLogic.Current.RunMain(() =>
+                {
+                    btnSwitch.IsSelected = true;
+                });
+            }
+
+            //鍏抽棴杩涘害鏉�
+            this.CloseProgressBar();
+        }
 
         #endregion
     }

--
Gitblit v1.8.0