From 73cd2b147d98acb3a945b7b5daad39103fd4377d Mon Sep 17 00:00:00 2001 From: wei <kaede@kaededeMacBook-Air.local> Date: 星期六, 12 十二月 2020 19:07:38 +0800 Subject: [PATCH] 20201212-1 --- HDL_ON/Entity/DB_ResidenceData.cs | 56 ++++++++++++++++++++++++++++---------------------------- 1 files changed, 28 insertions(+), 28 deletions(-) diff --git a/HDL_ON/Entity/DB_ResidenceData.cs b/HDL_ON/Entity/DB_ResidenceData.cs index ed3d96a..4cdf89b 100644 --- a/HDL_ON/Entity/DB_ResidenceData.cs +++ b/HDL_ON/Entity/DB_ResidenceData.cs @@ -25,7 +25,7 @@ { if (MainPage.NoLoginMode) { - return new RegionInfoRes() { Name = "鏈湴妯″紡" }; + return new RegionInfoRes() { Name = "鏈湴妯″紡" , }; } else { @@ -127,6 +127,8 @@ catch (Exception ex) { MainPage.Log($"浣忓畢鏁版嵁鍒濆鍖栧け璐ワ細{ex.Message}"); + instance = new DB_ResidenceData { }; + return instance; } instance.residenceImage = "Classification/Room/Roombg.png"; //鍒濆鍖栦綇瀹呭姛鑳芥暟鎹� @@ -142,10 +144,10 @@ public void EixtAccount() { instance = null; - Rooms = null; ins_OidList = null; - functionList = null; HomeGateway = null; + SpatialInfo.CurrentSpatial.ClearRooms(); + FunctionList.List.Clear(); if (MainPage.IsRemote) { DAL.Mqtt.MqttClient.DisConnectRemote("閫�鍑虹櫥褰曪紝鎴栬�呭垏鎹綇瀹�"); @@ -180,6 +182,24 @@ } } } + + /// <summary> + /// 妫�娴嬩綇瀹呮槸鍚︾粦瀹氫簡缃戝叧 + /// gatewayId 鍒ょ┖ + /// </summary> + /// <returns></returns> + public bool CheckWhetherGatewayIdIsNull() + { + if (HomeGateway != null && !string.IsNullOrEmpty(HomeGateway.gatewayId)) + { + return true; + } + else + { + return false; + } + } + /// <summary> /// 妫�娴嬩綇瀹呮槸鍚︾粦瀹氫簡缃戝叧 /// </summary> @@ -243,7 +263,6 @@ return; var ssd = System.Text.Encoding.UTF8.GetBytes(Newtonsoft.Json.JsonConvert.SerializeObject(this)); Common.FileUtlis.Files.WriteFileByBytes("DB_ResidenceData", ssd); - MainPage.Log("Save DB_ResidenceData"); } /// <summary> @@ -251,30 +270,11 @@ /// </summary> public string CurFoor = Language.StringByID(StringId.All); - /// <summary> - /// 鎴块棿鍒楄〃 - /// </summary> - public List<Room> Rooms = SpatialInfo.CurrentSpatial.RoomList; - - #region 鍔熻兘鏁版嵁 - static FunctionList _functionList; - public static FunctionList functionList - { - get - { - if (_functionList == null) - { - _functionList = FunctionList.List; - } - return _functionList; - } - set - { - _functionList = value; - } - } - - #endregion + ///// <summary> + ///// 鎴块棿鍒楄〃 + ///// </summary> + //[Newtonsoft.Json.JsonIgnore] + //public List<Room> Rooms = SpatialInfo.CurrentSpatial.RoomList; #region oid鍒楄〃 a鍗忚杞琤us鍗忚鎺у埗浣跨敤 /// <summary> -- Gitblit v1.8.0