From 23c075a9c27946773feccf05abc90489a6bf5203 Mon Sep 17 00:00:00 2001
From: wxr <464027401@qq.com>
Date: 星期一, 06 七月 2020 15:58:53 +0800
Subject: [PATCH] 20200706
---
HDL_ON/Entity/Room.cs | 44 ++++++++++++++++++++++++++++++++------------
1 files changed, 32 insertions(+), 12 deletions(-)
diff --git a/HDL_ON/Entity/Room.cs b/HDL_ON/Entity/Room.cs
index c7fb302..c128f9e 100644
--- a/HDL_ON/Entity/Room.cs
+++ b/HDL_ON/Entity/Room.cs
@@ -4,11 +4,28 @@
namespace HDL_ON.Entity
{
+
/// <summary>
/// 鎴块棿瀵硅薄
- /// 鎴块棿鍛藉悕瑙勫垯 typeof (Room).Name + "_" + etNameBox.Text.Trim ();
/// </summary>
- [System.Serializable]
+ [Serializable]
+ public class Floor
+ {
+ /// <summary>
+ /// 妤煎眰鍚嶇О
+ /// </summary>
+ public string name = "1 F";
+ /// <summary>
+ /// 妤煎眰ID
+ /// </summary>
+ public string sid;
+ }
+
+
+ /// <summary>
+ /// 鎴块棿瀵硅薄
+ /// </summary>
+ [Serializable]
public class Room
{
/// <summary>
@@ -22,7 +39,7 @@
/// <summary>
/// 妤煎眰绱㈠紩
/// </summary>
- public int floorIndex = -1;
+ public string floorId = "";
/// <summary>
/// 鎴块棿鑳屾櫙
@@ -31,19 +48,22 @@
/// <summary>
/// 妤煎眰
/// </summary>
- public string floor {
+ public string floor
+ {
get
{
- string str = "";
- if (floorIndex != -1)
+ if (DB_ResidenceData.residenceData.floors.Count > 0)
{
- if (floorIndex < DB_ResidenceData.residenceData.floors.Count)
- str = DB_ResidenceData.residenceData.floors[floorIndex];
+ var f = DB_ResidenceData.residenceData.floors.Find((obj) => obj.sid == floorId);
+ if (f != null)
+ {
+ return f.name;
+ }
}
- return str;
+ return "";
}
}
-
+
/// <summary>
/// 鎴块棿鍔熻兘鍒楄〃
@@ -56,7 +76,7 @@
List<Function> funcList = new List<Function>();
foreach (var f in DB_ResidenceData.residenceData.functionList.functions)
{
- if (f.roomIdList.Contains(sid))
+ if (f.roomIdList.Contains(sid) && sid != null)
{
funcList.Add(f);
}
@@ -64,4 +84,4 @@
functions = funcList;
}
}
-}
+}
\ No newline at end of file
--
Gitblit v1.8.0