From b8e94316e41eba72d927d5ca7d931b26139ee8ff Mon Sep 17 00:00:00 2001 From: wxr <464027401@qq.com> Date: 星期一, 15 六月 2020 09:12:53 +0800 Subject: [PATCH] 20200612 --- HDL_ON/Entity/Room.cs | 42 +++++++++++++++++++++++++++++++----------- 1 files changed, 31 insertions(+), 11 deletions(-) diff --git a/HDL_ON/Entity/Room.cs b/HDL_ON/Entity/Room.cs index 7884d78..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> /// 鎴块棿鍔熻兘鍒楄〃 @@ -64,4 +84,4 @@ functions = funcList; } } -} +} \ No newline at end of file -- Gitblit v1.8.0