From 99253403b560f761d5f9af8b4f5140496996433a Mon Sep 17 00:00:00 2001 From: 黄学彪 <hxb@hdlchina.com.cn> Date: 星期五, 20 十一月 2020 16:49:50 +0800 Subject: [PATCH] 新云端的代码Ver1.0 --- ZigbeeApp/Shared/Phone/UserCenter/Gateway/Manage/GatewayBackUpListForm.cs | 188 +++++++++++++++++++++++----------------------- 1 files changed, 95 insertions(+), 93 deletions(-) diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Gateway/Manage/GatewayBackUpListForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Gateway/Manage/GatewayBackUpListForm.cs index 3b8829a..505b884 100755 --- a/ZigbeeApp/Shared/Phone/UserCenter/Gateway/Manage/GatewayBackUpListForm.cs +++ b/ZigbeeApp/Shared/Phone/UserCenter/Gateway/Manage/GatewayBackUpListForm.cs @@ -90,85 +90,86 @@ this.nowSelectBackId = string.Empty; this.nowbtnSelect = null; - //杩涘害鏉� - this.ShowProgressBar(); + //鈽嗐優銉笺偗鈽� + ////杩涘害鏉� + //this.ShowProgressBar(); - //鑾峰彇鑷姩澶囦唤鐨勬暟鎹� - var pageAuto = HdlBackupLogic.Current.GetBackupListNameFromDB(3, realGateway.GwId); - if (pageAuto == null) - { - //鍏抽棴杩涘害鏉� - this.CloseProgressBar(ShowReLoadMode.YES); - return; - } + ////鑾峰彇鑷姩澶囦唤鐨勬暟鎹� + //var pageAuto = HdlBackupLogic.Current.GetBackupListNameFromDB(3, realGateway.GwId); + //if (pageAuto == null) + //{ + // //鍏抽棴杩涘害鏉� + // this.CloseProgressBar(ShowReLoadMode.YES); + // return; + //} - //浠庝簯绔幏鍙栨暟鎹� - var pageData = HdlBackupLogic.Current.GetBackupListNameFromDB(2, realGateway.GwId); - if (pageData == null) - { - //鍏抽棴杩涘害鏉� - this.CloseProgressBar(ShowReLoadMode.YES); - return; - } - //鍏抽棴杩涘害鏉� - this.CloseProgressBar(); + ////浠庝簯绔幏鍙栨暟鎹� + //var pageData = HdlBackupLogic.Current.GetBackupListNameFromDB(2, realGateway.GwId); + //if (pageData == null) + //{ + // //鍏抽棴杩涘害鏉� + // this.CloseProgressBar(ShowReLoadMode.YES); + // return; + //} + ////鍏抽棴杩涘害鏉� + //this.CloseProgressBar(); - HdlThreadLogic.Current.RunMain(() => - { - listView.RemoveAll(); - listView.RecoverHeight(); + //HdlThreadLogic.Current.RunMain(() => + //{ + // listView.RemoveAll(); + // listView.RecoverHeight(); - //鑷姩澶囦唤鐨処D - string autoID = string.Empty; - if (pageAuto.Count > 0) - { - autoID = pageAuto[0].Id; - //娣诲姞鑷姩澶囦唤琛� - this.AddRowlayout(pageAuto[0], pageData.Count > 0, true); - } + // //鑷姩澶囦唤鐨処D + // string autoID = string.Empty; + // if (pageAuto.Count > 0) + // { + // autoID = pageAuto[0].Id; + // //娣诲姞鑷姩澶囦唤琛� + // this.AddRowlayout(pageAuto[0], pageData.Count > 0, true); + // } - for (int i = 0; i < pageData.Count; i++) - { - //娣诲姞澶囦唤琛� - this.AddRowlayout(pageData[i], i != pageData.Count - 1, false); - } + // for (int i = 0; i < pageData.Count; i++) + // { + // //娣诲姞澶囦唤琛� + // this.AddRowlayout(pageData[i], i != pageData.Count - 1, false); + // } - this.btnDownload?.RemoveFromParent(); - if (pageData.Count > 0 || pageAuto.Count > 0) - { - //涓嬭浇 - this.btnDownload = new BottomClickButton(); - btnDownload.TextID = R.MyInternationalizationString.uDownLoad; - bodyFrameLayout.AddChidren(btnDownload); - btnDownload.ButtonClickEvent += (sender, e) => - { - if (this.nowSelectBackId == string.Empty) - { - return; - } - //鏄惁瑕佷笅杞藉苟鎭㈠鏁版嵁锛� - string msg = Language.StringByID(R.MyInternationalizationString.uDownLoadAndRecoverMsg); - this.ShowMassage(ShowMsgType.Confirm, msg, () => - { - HdlThreadLogic.Current.RunThread(() => - { - //璇诲彇澶囦唤鏂囨。 - bool result = HdlGatewayBackupLogic.Current.RecoverGateway(this.realGateway, this.nowSelectBackId, autoID == this.nowSelectBackId ? 1 : 0); - if (result == true) - { - HdlThreadLogic.Current.RunMain(() => - { - //鍏抽棴杩欎釜鐣岄潰 - this.CloseForm(); - }); - } - }); - }); - }; - //璋冩暣鐪熷疄楂樺害 - listView.AdjustRealHeightByBottomButton(Application.GetRealHeight(23)); - } - }); + // this.btnDownload?.RemoveFromParent(); + // if (pageData.Count > 0 || pageAuto.Count > 0) + // { + // //涓嬭浇 + // this.btnDownload = new BottomClickButton(); + // btnDownload.TextID = R.MyInternationalizationString.uDownLoad; + // bodyFrameLayout.AddChidren(btnDownload); + // btnDownload.ButtonClickEvent += (sender, e) => + // { + // if (this.nowSelectBackId == string.Empty) + // { + // return; + // } + // //鏄惁瑕佷笅杞藉苟鎭㈠鏁版嵁锛� + // string msg = Language.StringByID(R.MyInternationalizationString.uDownLoadAndRecoverMsg); + // this.ShowMassage(ShowMsgType.Confirm, msg, () => + // { + // HdlThreadLogic.Current.RunThread(() => + // { + // //璇诲彇澶囦唤鏂囨。 + // bool result = HdlGatewayBackupLogic.Current.RecoverGateway(this.realGateway, this.nowSelectBackId, autoID == this.nowSelectBackId ? 1 : 0); + // if (result == true) + // { + // HdlThreadLogic.Current.RunMain(() => + // { + // //鍏抽棴杩欎釜鐣岄潰 + // this.CloseForm(); + // }); + // } + // }); + // }); + // }; + // //璋冩暣鐪熷疄楂樺害 + // listView.AdjustRealHeightByBottomButton(Application.GetRealHeight(23)); + // } + //}); } #endregion @@ -187,7 +188,7 @@ listView.AddChidren(rowLayout); //澶囦唤鍚嶅瓧 - var txtText = rowLayout.frameTable.AddTopView(fileInfo.BackupName, 700); + var txtText = rowLayout.frameTable.AddTopView(fileInfo.FolderName, 700); if (isAuto == true) { txtText.TextID = R.MyInternationalizationString.uAutoBackup; @@ -195,9 +196,9 @@ //鏃堕棿 2019-11-11T11:31:01 var btnTime = rowLayout.frameTable.AddBottomView("", 600); - if (fileInfo.CreatedOnUtc.Length >= 19) + if (fileInfo.ModifyTime.Length >= 13) { - btnTime.Text = UserCenterLogic.ConvertUtcTimeToLocalTime(fileInfo.CreatedOnUtc).ToString("yyyy.MM.dd HH:mm:ss"); + btnTime.Text = HdlCommonLogic.Current.ConvertUtcTimeToLocalTime2(fileInfo.ModifyTime).ToString("yyyy.MM.dd HH:mm:ss"); } //搴曠嚎 if (addLine == true) @@ -265,23 +266,24 @@ /// <param name="backName"></param> private void EditorBackInfo(string BackupClassId, string backName) { - var Pra = new EditorBackUpNamePra(); - Pra.BackupClassId = BackupClassId; - Pra.BackupName = backName; - //鑾峰彇鎺у埗涓讳汉璐﹀彿鐨凾oken - Pra.LoginAccessToken = UserCenterLogic.GetConnectMainToken(); + //鈽嗐優銉笺偗鈽� + //var Pra = new EditorBackUpNamePra(); + //Pra.BackupClassId = BackupClassId; + //Pra.BackupName = backName; + ////鑾峰彇鎺у埗涓讳汉璐﹀彿鐨凾oken + //Pra.LoginAccessToken = HdlUserCenterLogic.GetConnectMainToken(); - bool result = UserCenterLogic.GetResultStatuByRequestHttps("App/UpdateHomeAppGatewayName", true, Pra); - if (result == false) - { - return; - } + //bool result = HdlUserCenterLogic.GetResultStatuByRequestHttps("App/UpdateHomeAppGatewayName", true, Pra); + //if (result == false) + //{ + // return; + //} - HdlThreadLogic.Current.RunThread(() => - { - //浠庝簯绔幏鍙栨暟鎹� - this.SetBackupInfoToForm(); - }); + //HdlThreadLogic.Current.RunThread(() => + //{ + // //浠庝簯绔幏鍙栨暟鎹� + // this.SetBackupInfoToForm(); + //}); } #endregion @@ -329,7 +331,7 @@ dialogForm.SetTitleText(Language.StringByID(R.MyInternationalizationString.uEditorBackup)); //璇疯緭鍏ュ浠藉悕绉� dialogForm.SetTipText(Language.StringByID(R.MyInternationalizationString.uPleaseInpuBackupName)); - dialogForm.Text = fileInfo.BackupName; + dialogForm.Text = fileInfo.FolderName; //鎸変笅纭鎸夐挳 dialogForm.ComfirmClickEvent += ((txtvalue) => @@ -337,7 +339,7 @@ //鐢婚潰鍏抽棴 dialogForm.CloseDialog(); //鍚嶅瓧涓�鏍锋椂锛屼笉澶勭悊 - if (txtvalue != fileInfo.BackupName) + if (txtvalue != fileInfo.FolderName) { //缂栬緫澶囦唤鍚嶇О this.EditorBackInfo(fileInfo.Id, txtvalue); -- Gitblit v1.8.0