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/UI/UI2/4-PersonalCenter/ResidentialManage/RoomEditFunctionPage.cs | 54 ++++++++++++++++++++++++++++++------------------------
1 files changed, 30 insertions(+), 24 deletions(-)
diff --git a/HDL_ON/UI/UI2/4-PersonalCenter/ResidentialManage/RoomEditFunctionPage.cs b/HDL_ON/UI/UI2/4-PersonalCenter/ResidentialManage/RoomEditFunctionPage.cs
index 2753df0..88c6d5b 100644
--- a/HDL_ON/UI/UI2/4-PersonalCenter/ResidentialManage/RoomEditFunctionPage.cs
+++ b/HDL_ON/UI/UI2/4-PersonalCenter/ResidentialManage/RoomEditFunctionPage.cs
@@ -1,4 +1,5 @@
锘縰sing 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()
{
@@ -262,7 +267,6 @@
TextSize = CSS_FontSize.PromptFontSize_SecondaryLevel,
};
functionRow.AddChidren(btnFunctionFloorName);
-
}
Button btnChooseIcon = new Button()
@@ -271,9 +275,9 @@
X = Application.GetRealWidth(335),
Width = Application.GetRealWidth(28),
Height = Application.GetRealWidth(28),
- SelectedImagePath = "Public/SelectionIcon.png",
- UnSelectedImagePath = "Public/UnSelectionIcon.png",
- IsSelected = function.roomIdList.Contains(roomId)
+ UnSelectedImagePath = "Public/ChooseIcon.png",
+ SelectedImagePath = "Public/ChooseOnIcon.png",
+ IsSelected = function.roomIdList.Contains(room.sid)
};
functionRow.AddChidren(btnChooseIcon);
LoadEvent_ChangeRoomFunctionList(functionRow, btnChooseIcon, function);
@@ -284,12 +288,14 @@
if (showdFunctionCount < 9)
{
functionListView.Height = Application.GetRealHeight(51 * showdFunctionCount);
+ }else
+ {
+ functionListView.Height = Application.GetRealHeight(518 - 40 - 62);
}
-
}
/// <summary>
- /// 鏄剧ず鎴块棿閫変腑寮圭獥
+ /// 鏄剧ず鎴块棿閫夐�夋嫨寮圭獥
/// </summary>
void LoadPage_LoadChooseRoomDialog()
{
--
Gitblit v1.8.0