From 25429f085093d89d543a0b90e30d0d62d1b7dac9 Mon Sep 17 00:00:00 2001 From: hxb <hxb@hdlchina.com.cn> Date: 星期二, 30 八月 2022 09:37:38 +0800 Subject: [PATCH] 合并了IOS的代码 --- ZigbeeApp/Shared/Phone/UserCenter/Gateway/Manage/GatewayBackUpListForm.cs | 67 ++++++++++++++++++--------------- 1 files changed, 36 insertions(+), 31 deletions(-) diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Gateway/Manage/GatewayBackUpListForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Gateway/Manage/GatewayBackUpListForm.cs index 6eb6dbc..3b83ece 100755 --- a/ZigbeeApp/Shared/Phone/UserCenter/Gateway/Manage/GatewayBackUpListForm.cs +++ b/ZigbeeApp/Shared/Phone/UserCenter/Gateway/Manage/GatewayBackUpListForm.cs @@ -85,7 +85,7 @@ /// <summary> /// 浠庝簯绔幏鍙栨暟鎹� /// </summary> - private async void SetBackupInfoToForm() + private void SetBackupInfoToForm() { this.nowSelectBackId = string.Empty; this.nowbtnSelect = null; @@ -94,7 +94,7 @@ this.ShowProgressBar(); //鑾峰彇鑷姩澶囦唤鐨勬暟鎹� - var pageAuto = await HdlBackupLogic.Current.GetBackupListNameFromDB(3, HdlGatewayLogic.Current.GetGatewayId(realGateway)); + var pageAuto = HdlBackupLogic.Current.GetBackupListNameFromDB(3, realGateway.GwId); if (pageAuto == null) { //鍏抽棴杩涘害鏉� @@ -103,7 +103,7 @@ } //浠庝簯绔幏鍙栨暟鎹� - var pageData = await HdlBackupLogic.Current.GetBackupListNameFromDB(2, HdlGatewayLogic.Current.GetGatewayId(realGateway)); + var pageData = HdlBackupLogic.Current.GetBackupListNameFromDB(2, realGateway.GwId); if (pageData == null) { //鍏抽棴杩涘害鏉� @@ -156,6 +156,10 @@ bool result = HdlGatewayBackupLogic.Current.RecoverGateway(this.realGateway, this.nowSelectBackId, autoID == this.nowSelectBackId ? 1 : 0); if (result == true) { + //缃戝叧鏁版嵁鎭㈠鎴愬姛! + msg = Language.StringByID(R.MyInternationalizationString.uRestoreGatewayDataSuccess); + this.ShowMassage(ShowMsgType.Tip, msg); + HdlThreadLogic.Current.RunMain(() => { //鍏抽棴杩欎釜鐣岄潰 @@ -187,24 +191,17 @@ listView.AddChidren(rowLayout); //澶囦唤鍚嶅瓧 - var txtText = rowLayout.frameTable.AddLeftCaption(fileInfo.BackupName, 700, 60); - txtText.TextSize = 15; - txtText.Y = Application.GetRealHeight(12) + rowLayout.chidrenYaxis; - rowLayout.frameTable.AddChidren(txtText, ChidrenBindMode.BindEventOnly); + var txtText = rowLayout.frameTable.AddTopView(fileInfo.BackupName, 700); if (isAuto == true) { txtText.TextID = R.MyInternationalizationString.uAutoBackup; } //鏃堕棿 2019-11-11T11:31:01 - var btnTime = rowLayout.frameTable.AddLeftCaption("", 600, 50, true); - btnTime.Y = Application.GetRealHeight(72) + rowLayout.chidrenYaxis; - btnTime.TextSize = 12; - btnTime.TextColor = UserCenterColor.Current.TextGrayColor1; - rowLayout.frameTable.AddChidren(btnTime, ChidrenBindMode.BindEventOnly); + var btnTime = rowLayout.frameTable.AddBottomView("", 600); if (fileInfo.CreatedOnUtc.Length >= 19) { - btnTime.Text = fileInfo.CreatedOnUtc.Replace("-", ".").Replace("T", " "); + btnTime.Text = UserCenterLogic.ConvertUtcTimeToLocalTime(fileInfo.CreatedOnUtc).ToString("yyyy.MM.dd HH:mm:ss"); } //搴曠嚎 if (addLine == true) @@ -245,20 +242,20 @@ //鏄剧ず缂栬緫澶囪�冨悕鐢婚潰 this.ShowEditorBackupForm(fileInfo); }; - } - //鍒犻櫎 - var btnDelete = rowLayout.AddDeleteControl(); - btnDelete.ButtonClickEvent += (sender, e) => - { - //纭鍒犻櫎璇ュ浠芥暟鎹�? - string msg = Language.StringByID(R.MyInternationalizationString.uDoDeleteBackupMsg); - this.ShowMassage(ShowMsgType.Confirm, msg, () => + //鍒犻櫎 + var btnDelete = rowLayout.AddDeleteControl(); + btnDelete.ButtonClickEvent += (sender, e) => { - //鍒犻櫎澶囦唤鏂囨。 - this.DeleteBackInfo(fileInfo.Id); - }); - }; + //纭鍒犻櫎璇ュ浠芥暟鎹�? + string msg = Language.StringByID(R.MyInternationalizationString.uDoDeleteBackupMsg); + this.ShowMassage(ShowMsgType.Confirm, msg, () => + { + //鍒犻櫎澶囦唤鏂囨。 + this.DeleteBackInfo(fileInfo.Id); + }); + }; + } } #endregion @@ -270,7 +267,7 @@ /// </summary> /// <param name="BackupClassId"></param> /// <param name="backName"></param> - private async void EditorBackInfo(string BackupClassId, string backName) + private void EditorBackInfo(string BackupClassId, string backName) { var Pra = new EditorBackUpNamePra(); Pra.BackupClassId = BackupClassId; @@ -278,13 +275,17 @@ //鑾峰彇鎺у埗涓讳汉璐﹀彿鐨凾oken Pra.LoginAccessToken = UserCenterLogic.GetConnectMainToken(); - bool result = await UserCenterLogic.GetResultStatuByRequestHttps("App/UpdateHomeAppGatewayName", true, Pra); + bool result = UserCenterLogic.GetResultStatuByRequestHttps("App/UpdateHomeAppGatewayName", true, Pra); if (result == false) { return; } - this.SetBackupInfoToForm(); + HdlThreadLogic.Current.RunThread(() => + { + //浠庝簯绔幏鍙栨暟鎹� + this.SetBackupInfoToForm(); + }); } #endregion @@ -295,9 +296,9 @@ /// 鍒犻櫎澶囦唤鏂囨。 /// </summary> /// <param name="BackupClassId"></param> - private async void DeleteBackInfo(string BackupClassId) + private void DeleteBackInfo(string BackupClassId) { - bool success = await HdlBackupLogic.Current.DeleteDbBackupData(BackupClassId); + bool success = HdlBackupLogic.Current.DeleteDbBackupData(BackupClassId); if (success == false) { return; @@ -307,7 +308,11 @@ this.nowSelectBackId = string.Empty; this.nowbtnSelect = null; } - this.SetBackupInfoToForm(); + HdlThreadLogic.Current.RunThread(() => + { + //浠庝簯绔幏鍙栨暟鎹� + this.SetBackupInfoToForm(); + }); } #endregion -- Gitblit v1.8.0