| | |
| | | /// </summary> |
| | | void LoadEvent_SwitchHome() |
| | | { |
| | | #if DEBUG111 |
| | | btnUserTypeName.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | var pm = new DAL.Server.HttpServerRequest(); |
| | | var iddd = pm.GetRegionLastBackupId(); |
| | | Dialog dialog = new Dialog(); |
| | | |
| | | FrameLayout bodyView = new FrameLayout(); |
| | | dialog.AddChidren(bodyView); |
| | | bodyView.MouseUpEventHandler = (sender3, e3) => { |
| | | dialog.Close(); |
| | | }; |
| | | |
| | | FrameLayout frame = new FrameLayout() |
| | | { |
| | | Gravity = Gravity.Center, |
| | | Width = Application.GetRealWidth(280), |
| | | Height =Application.GetRealHeight(300), |
| | | BackgroundColor = CSS.CSS_Color.MainBackgroundColor, |
| | | Radius = (uint)Application.GetRealWidth(16), |
| | | }; |
| | | dialog.AddChidren(frame); |
| | | |
| | | Button btnTitleDialog = new Button() |
| | | { |
| | | Height = Application.GetRealHeight(60), |
| | | TextAlignment = TextAlignment.Center, |
| | | Text = "数据恢复", |
| | | TextSize = CSS.CSS_FontSize.SubheadingFontSize, |
| | | TextColor = CSS.CSS_Color.SecondLevelTitleColor, |
| | | BackgroundColor = CSS.CSS_Color.PromptingColor2, |
| | | }; |
| | | frame.AddChidren(btnTitleDialog); |
| | | |
| | | VerticalScrolViewLayout view = new VerticalScrolViewLayout() |
| | | { |
| | | Y = Application.GetRealHeight(60), |
| | | Height = Application.GetRealHeight(240), |
| | | }; |
| | | frame.AddChidren(view); |
| | | |
| | | foreach(var dd in iddd) |
| | | { |
| | | Button btn = new Button() |
| | | { |
| | | Height = Application.GetRealHeight(50), |
| | | TextAlignment = TextAlignment.Center, |
| | | TextSize = CSS.CSS_FontSize.TextFontSize, |
| | | TextColor = CSS.CSS_Color.TextualColor, |
| | | Text = dd.Value, |
| | | }; |
| | | view.AddChidren(btn); |
| | | |
| | | btn.MouseUpEventHandler = (sender1, e1) => |
| | | { |
| | | dialog.Close(); |
| | | pm.GetBackupFileList(dd.Key); |
| | | }; |
| | | |
| | | view.AddChidren(new Button() |
| | | { |
| | | Gravity = Gravity.CenterHorizontal, |
| | | Height = Application.GetRealHeight(1), |
| | | BackgroundColor = CSS.CSS_Color.BackgroundColor |
| | | }); |
| | | } |
| | | dialog.Show(); |
| | | btnAboutOnText.MouseUpEventHandler = (sender, e) => { |
| | | DAL.Net.Mqtt_Cloud.StartCloudMqtt(); |
| | | }; |
| | | #endif |
| | | |
| | | EventHandler<MouseEventArgs> eventHandler = (sender, e) => { |
| | | var dialog = new Dialog(); |
| | | var dialogBody = new FrameLayout(); |
| | |
| | | { |
| | | var regionId = (string)btnHomeName.Tag; |
| | | dialog.Close(); |
| | | //DB_ResidenceData.residenceData.CurReginID = regionId; |
| | | LoadEvent_ChangeCurHome(MainPage.LoginUser.regionList.Find((obj) => obj.RegionID == regionId)); |
| | | LoadContentView(); |
| | | }; |
| | |
| | | { |
| | | return; |
| | | } |
| | | string oldRegionRootPath = FileUtils.CreateRegionBackup(DB_ResidenceData.residenceData.CurReginID.ToString()); |
| | | string newRegionRootPath = FileUtils.CreateRegionBackup(homeTemp.RegionID.ToString()); |
| | | DB_ResidenceData.residenceData.CurReginID = homeTemp.RegionID; |
| | | DB_ResidenceData.residenceData.SaveResidenceData(); |
| | | var waitPage = new Loading(); |
| | | new System.Threading.Thread(() => |
| | | { |
| | |
| | | { |
| | | var backuplist = FileUtils.ReadFiles(); |
| | | int index = 0; |
| | | string oldRegionRootPath = FileUtils.CreateRegionBackup(DB_ResidenceData.residenceData.CurReginID.ToString()); |
| | | FileUtils.DeleteRegionFiles(oldRegionRootPath); |
| | | //移动文件 |
| | | foreach (var fileName in backuplist) |
| | |
| | | FileUtils.DeleteFile(fileName); |
| | | } |
| | | //倒出新住宅数据 |
| | | string newRegionRootPath = FileUtils.CreateRegionBackup(homeTemp.RegionID.ToString()); |
| | | FileUtils.RestoreRegionFiles(newRegionRootPath); |
| | | MainPage.LoginUser.SaveUserInfo(); |
| | | DB_ResidenceData.residenceData.EixtAccount(); |