| | |
| | | #if DEBUG |
| | | btnUserTypeName.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | var pm = new HDL_ON.DAL.Server.HttpServerRequest(); |
| | | var pm = new DAL.Server.HttpServerRequest(); |
| | | var iddd = pm.GetRegionLastBackupId(); |
| | | Dialog dialog = new Dialog(); |
| | | |
| | |
| | | BackgroundColor = CSS.CSS_Color.BackgroundColor |
| | | }); |
| | | } |
| | | |
| | | dialog.Show(); |
| | | |
| | | }; |
| | | #endif |
| | | EventHandler<MouseEventArgs> eventHandler = (sender, e) => { |
| | |
| | | Tag = home.RegionID |
| | | }; |
| | | contentView.AddChidren(btnHomeName); |
| | | //if(btnHomeName) |
| | | |
| | | if (MainPage.LoginUser.regionList.IndexOf(home) < MainPage.LoginUser.regionList.Count - 1) |
| | | { |
| | |
| | | |
| | | }; |
| | | } |
| | | |
| | | dialog.Show(); |
| | | }; |
| | | |
| | | btnResidenceDownIcon.MouseUpEventHandler = eventHandler; |
| | | btnCurResidenceName.MouseUpEventHandler = eventHandler; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 更换当前选中住宅 |
| | | /// </summary> |
| | | /// <param name="homeTemp"></param> |
| | | void LoadEvent_ChangeCurHome(RegionInfoRes homeTemp) |
| | | { |
| | | if (DB_ResidenceData.residenceData.CurReginID == homeTemp.RegionID) |
| | |
| | | int index = 0; |
| | | string oldRegionRootPath = FileUtils.CreateRegionBackup(DB_ResidenceData.residenceData.CurReginID.ToString()); |
| | | FileUtils.DeleteRegionFiles(oldRegionRootPath); |
| | | //移动文件 |
| | | foreach (var fileName in backuplist) |
| | | { |
| | | System.IO.FileInfo fileInfo = new System.IO.FileInfo(FileUtils.RootPath + fileName); |
| | | if(fileName == "headImage.png") |
| | | { |
| | | continue; |
| | | } |
| | | if (fileInfo.Exists) |
| | | { |
| | | fileInfo.MoveTo(oldRegionRootPath + fileName); |
| | |
| | | waitPage.Text = pro.ToString() + "%"; |
| | | }); |
| | | } |
| | | FileUtils.DeleteAllFile(); |
| | | //删除本地文件 |
| | | foreach (var fileName in backuplist) |
| | | { |
| | | if (fileName == "headImage.png") |
| | | { |
| | | continue; |
| | | } |
| | | FileUtils.DeleteFile(fileName); |
| | | } |
| | | //倒出新住宅数据 |
| | | string newRegionRootPath = FileUtils.CreateRegionBackup(homeTemp.RegionID.ToString()); |
| | | FileUtils.RestoreRegionFiles(newRegionRootPath); |
| | |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | btnCurResidenceName.Text = DB_ResidenceData.residenceData.residecenInfo.Name; |
| | | //new Alert(Language.StringByID(StringId.Tip), Language.StringByID(StringId.SwitchRegionSuccessfully), |
| | | // Language.StringByID(StringId.Close)).Show(); |
| | | }); |
| | | } |
| | | catch (Exception ex) |
| | |
| | | }) |
| | | { IsBackground = true }.Start(); |
| | | } |
| | | |
| | | #endregion |
| | | |
| | | #region 住宅管理 |