HDL Home App 第二版本 旧平台金堂用 正在使用
hxb
2022-08-30 25429f085093d89d543a0b90e30d0d62d1b7dac9
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 @@
            //获取控制主人账号的Token
            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
@@ -326,8 +331,8 @@
            //编辑备份
            dialogForm.SetTitleText(Language.StringByID(R.MyInternationalizationString.uEditorBackup));
            //请输入备注名称
            dialogForm.SetTipText(Language.StringByID(R.MyInternationalizationString.uPleaseInpuBackup));
            //请输入备份名称
            dialogForm.SetTipText(Language.StringByID(R.MyInternationalizationString.uPleaseInpuBackupName));
            dialogForm.Text = fileInfo.BackupName;
            //按下确认按钮