old mode 100755
new mode 100644
| | |
| | | /// <summary> |
| | | /// 仅子账号登陆的时候使用,当【IsOthreShare】为"true",并且【AccountType】为"1"时,该账号拥有管理员权限 |
| | | /// </summary> |
| | | public int AccountType; |
| | | public int AccountType;
|
| | | /// <summary>
|
| | | /// 经度
|
| | | /// </summary>
|
| | | public double Longitude = 0;
|
| | | /// <summary>
|
| | | /// 纬度
|
| | | /// </summary>
|
| | | public double Latitude = 0; |
| | | |
| | | /// <summary> |
| | | /// 房间路径列表 |
| | | /// </summary> |
| | | public List<string> RoomFilePathList = new List<string> { }; |
| | | |
| | | /// <summary> |
| | | /// 楼层字典 |
| | | /// key:FloorId |
| | | /// value:FloorName |
| | | /// </summary> |
| | | public Dictionary<string,string> FloorDics = new Dictionary<string,string> { }; |
| | | /// <summary> |
| | | /// 当前楼层 |
| | | /// </summary> |
| | | public string CurrentFloorId; |
| | | |
| | | /// <summary> |
| | | /// 全局场景路径列表---备用 |
| | |
| | | } |
| | | home.Name = houseName; |
| | | home.Save(); |
| | | Config.Instance.Save(); |
| | | } |
| | | |
| | | #endregion |
| | |
| | | /// </summary> |
| | | public static async System.Threading.Tasks.Task<List<string>> GetHomeLists() |
| | | { |
| | | //清空当前住宅列表 |
| | | Config.Instance.HomeFilePathList.Clear(); |
| | | var pageSetting = new SendDataToServer.ResidenceListPageSettingObj() |
| | | { |
| | | PageSize = CommonPage.PageSize |
| | |
| | | if (responseDataObj.TotalCount == 0) |
| | | { |
| | | //当住宅为空时先提示用户新建住宅 |
| | | var alert = new Alert(Language.StringByID(R.MyInternationalizationString.TIP), Language.StringByID(R.MyInternationalizationString.CurrentlyTheUserIshHouseIsEmptyPleaseBuildANewHouseFirst), Language.StringByID(R.MyInternationalizationString.Close), Language.StringByID(R.MyInternationalizationString.OK)); |
| | | var alert = new Alert(Language.StringByID(R.MyInternationalizationString.TIP), Language.StringByID(R.MyInternationalizationString.CurrentlyTheUserIshHouseIsEmptyPleaseBuildANewHouseFirst), Language.StringByID(R.MyInternationalizationString.Close), Language.StringByID(R.MyInternationalizationString.Confrim)); |
| | | alert.Show(); |
| | | alert.ResultEventHandler += (sender, e) => |
| | | { |
| | |
| | | } |
| | | else |
| | | { |
| | | //清空当前住宅列表 |
| | | Config.Instance.HomeFilePathList.Clear(); |
| | | if (Config.Instance.HomeId == string.Empty && responseDataObj.PageData.Count > 0) |
| | | { |
| | | //赋一个初始值 |
| | | Config.Instance.HomeId = responseDataObj.PageData[0].Id; |
| | | } |
| | | foreach (var residence in responseDataObj.PageData) |
| | | { |
| | | Config.Instance.HomeFilePathList.Add($"House_{residence.Id}.json"); |
| | |
| | | Name = residence.Name, |
| | | IsOthreShare = residence.IsOthreShare, |
| | | AccountType = residence.AccountType, |
| | | MainUserDistributedMark = residence.MainUserDistributedMark |
| | | MainUserDistributedMark = residence.MainUserDistributedMark, |
| | | Longitude = residence.Longitude, |
| | | Latitude = residence.Latitude |
| | | }; |
| | | } |
| | | else |
| | |
| | | house.Name = residence.Name; |
| | | house.IsOthreShare = residence.IsOthreShare; |
| | | house.AccountType = residence.AccountType; |
| | | house.MainUserDistributedMark = residence.MainUserDistributedMark; |
| | | house.MainUserDistributedMark = residence.MainUserDistributedMark;
|
| | | house.Longitude = residence.Longitude;
|
| | | house.Latitude = residence.Latitude; |
| | | } |
| | | Global.CreateHomeDirectory(residence.Id); |
| | | house.Save(); |
| | | house.Save(false); |
| | | } |
| | | //匹配当前住宅 |
| | | if (Config.Instance.HomeFilePathList.Find((obj) => obj == $"House_{Config.Instance.HomeId}.json") == null) |
| | |
| | | |
| | | #endregion |
| | | |
| | | #region ◆ 楼层____________________________ |
| | | |
| | | /// <summary> |
| | | /// GetCurrentFloorName |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | public string GetCurrentFloorName |
| | | { |
| | | get |
| | | { |
| | | return GetFloorNameById(CurrentFloorId); |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 获取楼层名称 |
| | | /// </summary> |
| | | /// <param name="floorId"></param> |
| | | /// <returns></returns> |
| | | public string GetFloorNameById(string floorId) |
| | | { |
| | | if (Config.Instance.Home.FloorDics.Count == 0) |
| | | { |
| | | return null; |
| | | } |
| | | |
| | | foreach (var floor in Config.Instance.Home.FloorDics) |
| | | { |
| | | if (floorId == floor.Key) |
| | | { |
| | | return floor.Value; |
| | | } |
| | | } |
| | | return null; |
| | | } |
| | | /// <summary> |
| | | /// InitFloor |
| | | /// </summary> |
| | | public void InitFloor() |
| | | { |
| | | if (Config.Instance.Home.FloorDics.Count > 0 && string.IsNullOrEmpty(CurrentFloorId)) |
| | | { |
| | | foreach (var floor in Config.Instance.Home.FloorDics) |
| | | { |
| | | CurrentFloorId = floor.Key; |
| | | Save(false); |
| | | return; |
| | | } |
| | | } |
| | | } |
| | | |
| | | #endregion |
| | | |
| | | #region ◆ 房间____________________________ |
| | | |
| | | #region ◆ 添加房间路径_________________________ |
| | |
| | | } |
| | | path = System.IO.Path.Combine(path, FileName); |
| | | Shared.IO.FileUtils.WriteFileByBytes(path, System.Text.Encoding.UTF8.GetBytes(Newtonsoft.Json.JsonConvert.SerializeObject(this))); |
| | | if (autoBackup == true && Id == Config.Instance.HomeId) |
| | | { |
| | | HdlAutoBackupLogic.AddOrEditorFile(FileName); |
| | | } |
| | | } |
| | | #endregion |
| | | } |