| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using HDL_ON.Entity; |
| | | |
| | | namespace HDL_ON.UI |
| | |
| | | void LoadEvent_BackEvent() |
| | | { |
| | | btnBack.MouseUpEventHandler = (sender, e) => { |
| | | if (backAction != null) |
| | | { |
| | | backAction(); |
| | | } |
| | | backAction?.Invoke(); |
| | | if (baseView != null) |
| | | { |
| | | baseView.RemoveFromParent(); |
| | |
| | | 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 < DB_ResidenceData.residenceData.floors.Count + 1; ) |
| | | { |
| | | newFloorName = ++i + "F"; |
| | | if (null == DB_ResidenceData.residenceData.floors.Find((obj)=>obj.name == newFloorName)) |
| | | { |
| | | break; |
| | | } |
| | | } |
| | | var fs = new List<string>(); |
| | | foreach(var f in DB_ResidenceData.residenceData.floors) |
| | | { |
| | | fs.Add(f.name); |
| | | } |
| | | new PublicAssmebly().LoadDialog_EditParater(StringId.AddFloors,newFloorName , callBackAction,StringId.FloorNameCannotBeEmpty, |
| | | StringId.AddFloorFailed_FloorAlreadyExist,fs); |
| | | break; |
| | | case "rooms": |
| | | callBack("", ""); |
| | | break; |
| | | case "Member": |
| | | callBack("",""); |
| | | break; |
| | | |
| | | } |
| | | } |
| | | |