From 20f70e3446df19bf5d0faaae9f7bd58fd0fc4bcc Mon Sep 17 00:00:00 2001
From: wxr <464027401@qq.com>
Date: 星期五, 04 八月 2023 12:06:51 +0800
Subject: [PATCH] 轮询备份

---
 Crabtree/SmartHome/UI/SimpleControl/Phone/Register/AccountView.cs |  228 +++++++++++++-------------------------------------------
 1 files changed, 53 insertions(+), 175 deletions(-)

diff --git a/Crabtree/SmartHome/UI/SimpleControl/Phone/Register/AccountView.cs b/Crabtree/SmartHome/UI/SimpleControl/Phone/Register/AccountView.cs
index dcf7a5e..45d3d68 100644
--- a/Crabtree/SmartHome/UI/SimpleControl/Phone/Register/AccountView.cs
+++ b/Crabtree/SmartHome/UI/SimpleControl/Phone/Register/AccountView.cs
@@ -1,5 +1,7 @@
 锘縰sing System;
 using System.Collections.Generic;
+using System.IO;
+using System.Text;
 using service.hdlcontrol.com_push;
 
 namespace Shared.SimpleControl.Phone
@@ -9,6 +11,7 @@
         public AccountView ()
         {
         }
+
 
         public void ShouwAccountView ()
         {
@@ -181,7 +184,7 @@
 
             Button btnTitle = new Button () {
                 X = Application.GetRealWidth (40),
-                TextID = R.MyInternationalizationString.ModifyPasswrod,
+                Text = "Platform migration",
                 TextAlignment = TextAlignment.CenterLeft,
                 TextColor = SkinStyle.Current.TextColor1,
             };
@@ -198,182 +201,13 @@
             moveToNewCloudView.AddChidren (btnRight);
 
             EventHandler<MouseEventArgs> eHandler = (sender, e) => {
-                //1.妫�娴嬩竴绔彛鍥轰欢
-
-                var localFileList = IO.FileUtils.ReadFiles ();
-                var gateWayList = localFileList.FindAll ((obj) => {
-                    return (obj.StartsWith ("Equipment_")) && (
-                     obj.Split ('_') [1].ToString () == DeviceType.OnePortBus.ToString () ||
-                        obj.Split ('_') [1].ToString () == DeviceType.RCU.ToString () ||
-                        obj.Split ('_') [1].ToString () == DeviceType.OnePortWirelessFR.ToString ());
-                });
-                List<string> linkList = new List<string> ();
-                GatewayBase common = null;
-                string gateWayString = "";
-                if (gateWayList.Count > 0) {
-                    foreach (var gatewayFileName in gateWayList) {
-                        var tempStrings = gatewayFileName.Split ('_');
-                        if (tempStrings [1].ToString () == DeviceType.OnePortBus.ToString () || tempStrings [1].ToString () == DeviceType.RCU.ToString () ||
-                            tempStrings [1].ToString () == DeviceType.OnePortWirelessFR.ToString ()) {
-                            gateWayString = CommonPage.MyEncodingUTF8.GetString (IO.FileUtils.ReadFile (gatewayFileName));
-                            common = Newtonsoft.Json.JsonConvert.DeserializeObject<GatewayBase> (gateWayString);
-
-                            for (int i = 0; i < 7; i++) {
-                                Control.ControlBytesSend (Command.enjoyUpgrade, common.SubnetID, common.DeviceID, new byte [] { });
-                            }
-                            break;//鍙崌绾т竴涓�
-                        }
-                    }
-                } else {
-                    //娌℃湁缃戝叧
-                    return;
-                }
-
-                Control.ControlBytesSend (Command.enjoyUpgrade2, common.SubnetID, common.DeviceID, new byte [] { });
-
-
-
-
-                //2.杩涘叆缃戝叧鍗囩骇妯″紡
-                //3.鎺ユ敹鍗囩骇鏂囦欢鑾峰彇璇锋眰
-                //杩佺Щ璐﹀彿
-
-                #region 寮圭獥杈撳叆瀵嗙爜纭杩佺Щ
-                Dialog dialog = new Dialog ();
-
-                FrameLayout dialogBodyView = new FrameLayout () {
-                    Gravity = Gravity.Center,
-                    Width = Application.GetRealWidth (500),
-                    Height = Application.GetRealHeight (500),
-                    BackgroundColor = SkinStyle.Current.DialogColor,
-                    Radius = 5,
-                    BorderColor = SkinStyle.Current.Transparent,
-                    BorderWidth = 0,
-                };
-                dialog.AddChidren (dialogBodyView);
-
-                Button btnTitle = new Button () {
-                    Height = Application.GetRealHeight (80),
-                    BackgroundColor = SkinStyle.Current.DialogTitle,
-                    TextAlignment = TextAlignment.Center,
-                    TextID = R.MyInternationalizationString.Tip,
-                    TextColor = SkinStyle.Current.DialogTextColor
-                };
-                dialogBodyView.AddChidren (btnTitle);
-
-                Button btnackupRemark = new Button () {
-                    Gravity = Gravity.CenterHorizontal,
-                    Y = Application.GetRealHeight (100),
-                    Width = Application.GetRealWidth (400),
-                    Height = Application.GetRealHeight (80),
-                    Text = "璇疯緭鍏ュ瘑鐮侊紝纭杩佺Щ",
-                    TextAlignment = TextAlignment.CenterLeft,
-                    TextColor = SkinStyle.Current.TextColor,
-                };
-                dialogBodyView.AddChidren (btnackupRemark);
-
-                EditText etBackupRemark = new EditText () {
-                    Gravity = Gravity.CenterHorizontal,
-                    Y = btnackupRemark.Bottom,
-                    Width = Application.GetRealWidth (400),
-                    Height = Application.GetRealHeight (80),
-                    TextAlignment = TextAlignment.Center,
-                    Radius = 5,
-                    BorderColor = SkinStyle.Current.BorderColor,
-                    BorderWidth = 1,
-                    TextColor = SkinStyle.Current.TextColor,
-                    SecureTextEntry = true
-                };
-                dialogBodyView.AddChidren (etBackupRemark);
-                etBackupRemark.EditorEnterAction += (obj) => {
-                    Application.HideSoftInput ();
-                };
-
-                var btnTipMsg = new Button () {
-                    Gravity = Gravity.CenterHorizontal,
-                    Y = etBackupRemark.Bottom ,
-                    Width = Application.GetRealWidth (400),
-                    Height = Application.GetRealHeight (80),
-                    TextAlignment = TextAlignment.CenterLeft,
-                    TextColor = SkinStyle.Current.DelColor,
-                };
-                dialogBodyView.AddChidren (btnTipMsg);
-
-                FrameLayout bottomView = new FrameLayout () {
-                    Y = Application.GetRealHeight (420),
-                    Height = Application.GetRealHeight (85),
-                    BackgroundColor = SkinStyle.Current.DialogTitle
-                };
-                dialogBodyView.AddChidren (bottomView);
-
-                Button btnClose = new Button () {
-                    Width = Application.GetRealWidth (249),
-                    TextID = R.MyInternationalizationString.Close,
-                    TextAlignment = TextAlignment.Center
-                };
-                bottomView.AddChidren (btnClose);
-                btnClose.MouseUpEventHandler += (send2er, e2) => {
-                    dialog.Close ();
-                };
-
-                Button btnBottomLine = new Button () {
-                    X = btnClose.Right,
-                    Width = 1,
-                    BackgroundColor = SkinStyle.Current.Black50Transparent,
-                };
-                bottomView.AddChidren (btnBottomLine);
-
-                Button btnSave = new Button () {
-                    X = btnBottomLine.Right,
-                    Width = Application.GetRealWidth (249),
-                    TextID = R.MyInternationalizationString.Confrim,
-                    TextAlignment = TextAlignment.Center
-                };
-                bottomView.AddChidren (btnSave);
-
-                btnSave.MouseUpEventHandler += (sender2, e2) => {
-                    var requestObj = new LoginObj () { Account = MainPage.LoginUser.AccountString, Password = etBackupRemark.Text.Trim(), Company = MainPage.SoftSmsType };
-                    var requestJson = Newtonsoft.Json.JsonConvert.SerializeObject (requestObj);
-                    var revertObj = MainPage.RequestHttps ("Login", requestJson, false);
-                    if (revertObj.StateCode == "SUCCESS") {
-                        //var responseDataObj = Newtonsoft.Json.JsonConvert.DeserializeObject<UserLoginRes> (revertObj.ResponseData.ToString ());
-                        //var revertData = responseDataObj;
-                        //MainPage.LoginUser = new UserInfo {
-                        //    ID = revertData.UserId, MasterID = revertData.MainUserId, AccountType = revertData.UserType, AccountString = account, Password = password, LastTime = DateTime.Now,
-                        //    AllVisionRegisterDevUserNameGuid = revertData.AllVisionRegisterDevUserNameGuid, Name = revertData.Contact
-                        //};
-
-
-
-                        Dictionary<string, object> dicAccount = new Dictionary<string, object> ();
-                        dicAccount.Add ("email", MainPage.LoginUser.AccountString);
-                        dicAccount.Add ("language", "ENGLISH");
-                        dicAccount.Add ("appCode", "HDL-HOME-IND-APP");
-                        dicAccount.Add ("pwd", etBackupRemark.Text.Trim());
-                        dicAccount.Add ("tenantId", "202106");
-                        var revertObj = MainPage.RequestHttps ("/home-wisdom/data/move/home/save", requestJson, false,false, $"https://test-gz.hdlcontrol.com");
-                    } else {
-
-                    }
-                };
-                dialog.Show ();
-
-                #endregion
-
-    
-
-
-                Dictionary<string, object> dic = new Dictionary<string, object> ();
-                dic.Add ("homeName", UserConfig.Instance.CurrentRegion.RegionName);
-                dic.Add ("userId", MainPage.LoginUser.ID);
-                dic.Add ("homeType", "BUSPRO");
-                dic.Add ("tenantId", "202106");
-                requestJson = Newtonsoft.Json.JsonConvert.SerializeObject (dic);
-                revertObj = MainPage.RequestHttps ("/home-wisdom/data/move/home/save", requestJson, false,false, $"https://test-gz.hdlcontrol.com");
-
-
+                var bean = new MigrationServer ();
+                bean.ShowDialog ();
             };
 
+            moveToNewCloudView.MouseUpEventHandler += eHandler;
+            btnTitle.MouseUpEventHandler += eHandler;
+            btnRight.MouseUpEventHandler += eHandler;
 
             Button btnLine = new Button () {
                 Height = Application.GetRealHeight (5),
@@ -384,6 +218,50 @@
 
 
 
+            #region 鎵嬪姩鍗囩骇
+
+            var manualUpgradeView = new FrameLayout () {
+                Height = Application.GetRealHeight (100),
+            };
+            contentView.AddChidren (manualUpgradeView);
+
+            Button btnmanualUpgradeTitle = new Button () {
+                X = Application.GetRealWidth (40),
+                Text = "Manual upgrade",
+                TextAlignment = TextAlignment.CenterLeft,
+                TextColor = SkinStyle.Current.TextColor1,
+            };
+            manualUpgradeView.AddChidren (btnmanualUpgradeTitle);
+
+            Button btnmanualUpgradeRight = new Button () {
+                X = Application.GetRealWidth (580),
+                Width = Application.GetRealWidth (28),
+                Height = Application.GetRealHeight (40),
+                Gravity = Gravity.CenterVertical,
+                UnSelectedImagePath = "Item/Right.png",
+                SelectedImagePath = "Item/RightSelected.png",
+            };
+            manualUpgradeView.AddChidren (btnmanualUpgradeRight);
+
+            EventHandler<MouseEventArgs> manualUpgradeHandler = (sender, e) => {
+                var bean = new ManualUpgradeDialog ();
+                bean.ShowDialog ();
+            };
+
+            manualUpgradeView.MouseUpEventHandler += manualUpgradeHandler;
+            btnmanualUpgradeTitle.MouseUpEventHandler += manualUpgradeHandler;
+            btnmanualUpgradeRight.MouseUpEventHandler += manualUpgradeHandler;
+
+            Button btnLine2 = new Button () {
+                Height = Application.GetRealHeight (5),
+                BackgroundColor = SkinStyle.Current.MainColor,
+            };
+            contentView.AddChidren (btnLine2);
+            #endregion
+
+
+
+
 
 
 

--
Gitblit v1.8.0