From e87985ec1dcb69beedaf9f95e8e7aba14b7c08d6 Mon Sep 17 00:00:00 2001
From: JLChen <551775569@qq.com>
Date: 星期三, 09 十二月 2020 18:50:14 +0800
Subject: [PATCH] 2020-12-09 1.信息中心,增加下划线和点击Alter提醒详情。
---
HDL_ON/Entity/Room.cs | 45 ++++++++++++++++++++++++++++++---------------
1 files changed, 30 insertions(+), 15 deletions(-)
diff --git a/HDL_ON/Entity/Room.cs b/HDL_ON/Entity/Room.cs
index 389c764..82f16c8 100644
--- a/HDL_ON/Entity/Room.cs
+++ b/HDL_ON/Entity/Room.cs
@@ -208,10 +208,10 @@
var floorsDataString = System.Text.Encoding.UTF8.GetString(floorsDataBytes);
MainPage.Log(floorsDataString);
floors = Newtonsoft.Json.JsonConvert.DeserializeObject<List<SpatialInfo>>(floorsDataString);
- if (floors == null)
- {
- floors = new List<SpatialInfo>();
- }
+ }
+ if (floors == null)
+ {
+ floors = new List<SpatialInfo>();
}
}
catch (Exception ex)
@@ -252,6 +252,9 @@
if (floor.SaveFloorData() == StateCode.SUCCESS)
{
FloorList.Add(floor);
+ var ssd = System.Text.Encoding.UTF8.GetBytes(Newtonsoft.Json.JsonConvert.SerializeObject(FloorList));
+ FileUtils.WriteFileByBytes(dataSavePath, ssd);
+ MainPage.Log($"Save floor Data");
}
}
/// <summary>
@@ -260,7 +263,12 @@
/// <param name="floor"></param>
public void UpdateFloor()
{
- SaveFloorData();
+ if(SaveFloorData() == StateCode.SUCCESS)
+ {
+ var ssd = System.Text.Encoding.UTF8.GetBytes(Newtonsoft.Json.JsonConvert.SerializeObject(FloorList));
+ FileUtils.WriteFileByBytes(dataSavePath, ssd);
+ MainPage.Log($"Save floor Data");
+ }
}
/// <summary>
/// 鍒犻櫎妤煎眰
@@ -274,7 +282,7 @@
var code = pm.DeleteRoom(new List<string>() { floor.roomId }).Code;
if (code == StateCode.SUCCESS)
{
- var tRoom = FloorList.Find((obj) => obj.uid == floor.uid);
+ var tRoom = FloorList.Find((obj) => obj.roomId == floor.roomId);
if (tRoom != null)
{
FloorList.Remove(floor);
@@ -297,9 +305,6 @@
var pack = SaveSpatialInfo();
if (pack.Code == StateCode.SUCCESS)
{
- var ssd = System.Text.Encoding.UTF8.GetBytes(Newtonsoft.Json.JsonConvert.SerializeObject(FloorList));
- FileUtils.WriteFileByBytes(dataSavePath, ssd);
- MainPage.Log($"Save floor Data");
}
else
{
@@ -375,7 +380,7 @@
var pack = pm.DeleteRoom(new List<string>() { room.roomId });
if (pack.Code == StateCode.SUCCESS)
{
- var tRoom = RoomList.Find((obj) => obj.uid == room.uid);
+ var tRoom = RoomList.Find((obj) => obj.roomId == room.roomId);
if (tRoom != null)
{
RoomList.Remove(room);
@@ -435,7 +440,7 @@
{
var ssd = System.Text.Encoding.UTF8.GetBytes(Newtonsoft.Json.JsonConvert.SerializeObject(this));
FileUtils.WriteFileByBytes(dataSavePath, ssd);
- MainPage.Log($"Save Room Data {roomName} : {uid}");
+ MainPage.Log($"Save Room Data {dataSavePath}");
}
return packCode;
}
@@ -482,12 +487,22 @@
{
get
{
- if (FloorList.Count > 0)
+ if (CurrentSpatial.FloorList.Count > 0)
{
- var f = FloorList.Find((obj) => obj.uid == parentId);
+ var f = CurrentSpatial.FloorList.Find((obj) => obj.uid == parentId);
if (f != null)
{
return f.roomName + " ";
+ }
+ else
+ {
+ foreach(var f1 in CurrentSpatial.FloorList)
+ {
+ if(f1.uid == parentId)
+ {
+ return f.roomName + " ";
+ }
+ }
}
}
return "";
@@ -511,7 +526,7 @@
{
foreach (var f in DB_ResidenceData.functionList.GetAllFunction())
{
- if (f.roomIds.Contains(uid) && uid != null)
+ if (f.roomIds.Contains(roomId) && roomId != null)
{
functions.Add(f);
}
@@ -553,7 +568,7 @@
{
foreach (var s in DB_ResidenceData.functionList.scenes)
{
- if (s.roomIds.Contains(uid) && uid != null)
+ if (s.roomIds.Contains(roomId) && roomId != null)
{
scenes.Add(s);
}
--
Gitblit v1.8.0