From bb6ad792b598927a5459a5fb6f6c27fb1aa9e94e Mon Sep 17 00:00:00 2001 From: wei <kaede@kaededeMacBook-Air.local> Date: 星期四, 17 十二月 2020 14:06:36 +0800 Subject: [PATCH] 20201217-1 --- HDL_ON/UI/UI0-Public/TopViewDivBLL.cs | 64 ++++++++++++++++---------------- 1 files changed, 32 insertions(+), 32 deletions(-) diff --git a/HDL_ON/UI/UI0-Public/TopViewDivBLL.cs b/HDL_ON/UI/UI0-Public/TopViewDivBLL.cs index 9ded327..4620b7a 100644 --- a/HDL_ON/UI/UI0-Public/TopViewDivBLL.cs +++ b/HDL_ON/UI/UI0-Public/TopViewDivBLL.cs @@ -1,4 +1,5 @@ 锘縰sing System; +using System.Collections.Generic; using HDL_ON.Entity; namespace HDL_ON.UI @@ -13,32 +14,21 @@ void LoadEvent_BackEvent() { btnBack.MouseUpEventHandler = (sender, e) => { - if (backAction != null) + backAction?.Invoke(); + if (needClose) { - backAction(); - } - if (baseView != null) - { - baseView.RemoveFromParent(); - } - if (baseDialog != null) - { - baseDialog.Close(); + if (baseView != null) + { + baseView.RemoveFromParent(); + } + if (baseDialog != null) + { + baseDialog.Close(); + } } }; } - /// <summary> - /// 椤堕儴鎸夐挳璺宠浆鍔熻兘閰嶇疆椤甸潰 - /// </summary> - /// <param name="function"></param> - void LoadEvent_SkipFunctionSetting(Function function) - { - var infoView = new FunctionBaseInfoSetPage(function,backAction); - MainPage.BasePageView.AddChidren(infoView); - infoView.LoadPage(); - MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; - } /// <summary> /// 椤堕儴娣诲姞鎸夐挳鐐瑰嚮浜嬩欢 @@ -51,22 +41,32 @@ case "floors": Action<string> callBackAction = (floorName) => { - if (DB_ResidenceData.residenceData.floors.Contains(floorName)) - { - return; - } - else - { - DB_ResidenceData.residenceData.floors.Add(floorName); - DB_ResidenceData.residenceData.SaveResidenceData(); - callBack("add", floorName); - } + callBack("add", floorName); }; - new PublicAssmebly().LoadDialog_EditParater(StringId.AddFloors, DB_ResidenceData.residenceData.floors.Count + 1 + " F", callBackAction); + string newFloorName = "1F"; + for (int i = 0; i < SpatialInfo.CurrentSpatial.FloorList.Count + 1; ) + { + newFloorName = ++i + "F"; + if (null == SpatialInfo.CurrentSpatial.FloorList.Find((obj)=>obj.roomName == newFloorName)) + { + break; + } + } + var fs = new List<string>(); + foreach(var f in SpatialInfo.CurrentSpatial.FloorList) + { + fs.Add(f.roomName); + } + new PublicAssmebly().LoadDialog_EditParater(StringId.AddFloors,newFloorName , callBackAction,StringId.FloorNameCannotBeEmpty, + StringId.AddFloorFailed_FloorAlreadyExist,fs); break; case "rooms": callBack("", ""); break; + case "Member": + callBack("",""); + break; + } } -- Gitblit v1.8.0