| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using HDL_ON.Entity; |
| | | using HDL_ON.UI.CSS; |
| | | using Shared; |
| | |
| | | |
| | | #region 区域变量 |
| | | int showdFunctionCount = 0; |
| | | string roomId; |
| | | Room room; |
| | | string showedFunctionRoomId = "0"; |
| | | List<Function> unallocatedList = new List<Function>(); |
| | | List<Function> allocatedList = new List<Function>(); |
| | | #endregion |
| | | |
| | | public RoomEditFunctionPage(string rId) |
| | | public RoomEditFunctionPage(Room r) |
| | | { |
| | | bodyView = this; |
| | | roomId = rId; |
| | | room = r; |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | }; |
| | | bodyView.AddChidren(functionListView); |
| | | |
| | | LoadFunctionListRow(true); |
| | | foreach (var function in DB_ResidenceData.residenceData.functionList.functions) |
| | | { |
| | | function.roomIdList.Remove(null); |
| | | if (function.roomIdList.Count > 0 ) |
| | | { |
| | | allocatedList.Add(function); |
| | | } |
| | | else |
| | | { |
| | | unallocatedList.Add(function); |
| | | } |
| | | } |
| | | |
| | | LoadFunctionListRow(unallocatedList); |
| | | |
| | | |
| | | btnConfrim = new Button() |
| | |
| | | /// 显示功能Row |
| | | /// </summary> |
| | | /// <param name="showUnallocated">是否是显示未分配</param> |
| | | void LoadFunctionListRow(bool showUnallocated) |
| | | void LoadFunctionListRow(List<Function> functions) |
| | | { |
| | | showdFunctionCount = 0; |
| | | functionListView.RemoveAll(); |
| | | |
| | | foreach (var function in DB_ResidenceData.residenceData.functionList.functions) |
| | | foreach (var function in functions) |
| | | { |
| | | if (function.roomIdList.Count > 0 && !function.roomIdList.Contains(roomId) && showUnallocated) |
| | | { |
| | | continue; |
| | | } |
| | | if (!showUnallocated && showedFunctionRoomId != null)//如果需要显示已经分配的功能,并且指定显示分到的房间 |
| | | { |
| | | if (!function.roomIdList.Contains(showedFunctionRoomId))//如果当前功能不是需要显示的 |
| | | { |
| | | continue; |
| | | } |
| | | } |
| | | functionListView.AddChidren(new Button() |
| | | { |
| | | Gravity = Gravity.CenterHorizontal, |
| | |
| | | break; |
| | | } |
| | | |
| | | if (showUnallocated) |
| | | if (!btnAllocated.IsSelected) |
| | | { |
| | | var btnFunctionName = new Button() |
| | | { |
| | |
| | | Height = Application.GetRealWidth(28), |
| | | SelectedImagePath = "Public/SelectionIcon.png", |
| | | UnSelectedImagePath = "Public/UnSelectionIcon.png", |
| | | IsSelected = function.roomIdList.Contains(roomId) |
| | | IsSelected = function.roomIdList.Contains(room.sid) |
| | | }; |
| | | functionRow.AddChidren(btnChooseIcon); |
| | | LoadEvent_ChangeRoomFunctionList(functionRow, btnChooseIcon, function); |
| | |
| | | if (showdFunctionCount < 9) |
| | | { |
| | | functionListView.Height = Application.GetRealHeight(51 * showdFunctionCount); |
| | | }else |
| | | { |
| | | functionListView.Height = Application.GetRealHeight(518 - 40 - 62); |
| | | } |
| | | |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 显示房间选中弹窗 |
| | | /// 显示房间选选择弹窗 |
| | | /// </summary> |
| | | void LoadPage_LoadChooseRoomDialog() |
| | | { |