wxr
2020-04-21 f718d23a262a5a8e1241fdeaeb4153399f95e79d
HDL_ON/UI/UI2/4-PersonalCenter/ResidentialManage/RoomEditFunctionPage.cs
@@ -1,4 +1,5 @@
using System;
using System.Collections.Generic;
using HDL_ON.Entity;
using HDL_ON.UI.CSS;
using Shared;
@@ -44,14 +45,16 @@
        #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>
@@ -134,7 +137,20 @@
            };
            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()
@@ -161,24 +177,13 @@
        /// 显示功能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,
@@ -223,7 +228,7 @@
                        break;
                }
                if (showUnallocated)
                if (!btnAllocated.IsSelected)
                {
                    var btnFunctionName = new Button()
                    {
@@ -273,7 +278,7 @@
                    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);
@@ -284,12 +289,15 @@
            if (showdFunctionCount < 9)
            {
                functionListView.Height = Application.GetRealHeight(51 * showdFunctionCount);
            }else
            {
                functionListView.Height = Application.GetRealHeight(518 - 40 - 62);
            }
        }
        /// <summary>
        /// 显示房间选中弹窗
        /// 显示房间选选择弹窗
        /// </summary>
        void LoadPage_LoadChooseRoomDialog()
        {