From 9d65c293924e4edbbc8c6c6091f55d7fc49c23eb Mon Sep 17 00:00:00 2001
From: wei <kaede@kaededeMacBook-Air.local>
Date: 星期二, 06 七月 2021 13:15:46 +0800
Subject: [PATCH] 乐橙子账号token
---
HDL_ON/UI/UI2/4-PersonalCenter/RoomListManage/FloorsManagementPageBLL.cs | 111 +++++++++++++++++++++++++++++--------------------------
1 files changed, 58 insertions(+), 53 deletions(-)
diff --git a/HDL_ON/UI/UI2/4-PersonalCenter/RoomListManage/FloorsManagementPageBLL.cs b/HDL_ON/UI/UI2/4-PersonalCenter/RoomListManage/FloorsManagementPageBLL.cs
index fe66aaa..de7355a 100644
--- a/HDL_ON/UI/UI2/4-PersonalCenter/RoomListManage/FloorsManagementPageBLL.cs
+++ b/HDL_ON/UI/UI2/4-PersonalCenter/RoomListManage/FloorsManagementPageBLL.cs
@@ -10,7 +10,7 @@
/// <summary>
/// 妤煎眰鎸夐挳淇敼鍚嶇О鐐瑰嚮浜嬩欢
/// </summary>
- void LoadEvent_FloorNamgeChange(Button btn,Button btnDel,RowLayout row,Floor floor)
+ void LoadEvent_FloorNamgeChange(Button btn,SpatialInfo floor)
{
btn.MouseUpEventHandler = (sender, e) =>
{
@@ -27,48 +27,48 @@
}.Show(bodyView);
return;
}
- if (DB_ResidenceData.residenceData.floors.Find((obj) => obj.name == newName) != null)
+ if (SpatialInfo.CurrentSpatial.FloorList.Find((obj) => obj.roomName == newName) != null)
{
return;
}
else
{
- floor.name = newName;
- DB_ResidenceData.residenceData.SaveResidenceData();
- btn.Text = newName;
- btnDel.Tag = newName;
- row.Tag = newName;
+ var waitPage = new Loading();
+ MainPage.BaseView.AddChidren(waitPage);
+ waitPage.Start(Language.StringByID(StringId.PleaseWait));
+ new System.Threading.Thread(() =>
+ {
+ try
+ {
+ var editResult = SpatialInfo.CurrentSpatial.UpdateFloor(floor);
+ Application.RunOnMainThread(() =>
+ {
+ if (editResult == DAL.Server.StateCode.SUCCESS)
+ {
+ floor.roomName = newName;
+ btn.Text = newName;
+ }
+ });
+ }
+ catch { }
+ finally
+ {
+ Application.RunOnMainThread(() => {
+ waitPage.Hide();
+ waitPage.RemoveFromParent();
+ });
+ }
+ })
+ { IsBackground = true }.Start();
}
};
var floors = new List<string>();
- foreach (var f in DB_ResidenceData.residenceData.floors)
+ foreach (var f in SpatialInfo.CurrentSpatial.FloorList)
{
- floors.Add(f.name);
+ floors.Add(f.roomName);
}
new PublicAssmebly().LoadDialog_EditParater(StringId.EditFloorName, btn.Text, editCallBack,StringId.FloorNameCannotBeEmpty,
StringId.EditFloorFailed_FloorAlreadyExist,floors);
- };
- }
-
-
- /// <summary>
- /// 鎴块棿缁戝畾妤煎眰锛屾ゼ灞傞�変腑浜嬩欢
- /// </summary>
- void LoadEvent_FloorChoose(Button btn)
- {
- btn.MouseUpEventHandler = (sender, e) => {
- if (lastButton != null)
- {
- lastButton.IsSelected = false;
- if (lastButton.Text == btn.Text)
- {
- lastButton = null;
- }
- //btn.IsBold = false;
- }
- btn.IsSelected = true;
- //btn.IsBold = true;
- lastButton = btn;
};
}
@@ -81,30 +81,35 @@
{
Action action = () =>
{
- refreshFloorList("del", btn.Tag.ToString());
+ //璇ユゼ灞傚垹闄や箣鍚庯紝缁戝畾璇ユゼ灞傜殑鎴块棿瑕侀噸缃粦瀹氱殑妤煎眰
+ foreach (var r in SpatialInfo.CurrentSpatial.RoomList)
+ {
+ if (r.parentId == btn.Tag.ToString())
+ {
+ r.parentId = "";
+ }
+ }
+ SpatialInfo.CurrentSpatial.DelFloor(btn.Tag.ToString());
+ for (int i = 0; i < floorsListView.ChildrenCount; i++)
+ {
+ if (floorsListView.GetChildren(i).GetType() == typeof(RowLayout))
+ {
+ RowLayout row = floorsListView.GetChildren(i) as RowLayout;
+ if (row.Tag == null)
+ continue;
+ if (row.Tag.ToString() == btn.Tag.ToString())
+ {
+ row.RemoveFromParent();
+ int count = SpatialInfo.CurrentSpatial.FloorList.Count > 8 ? 8 : SpatialInfo.CurrentSpatial.FloorList.Count;
+ var contentViewHeight = (count + 1) * Application.GetRealHeight(50);
+ contentView.Height = contentViewHeight;
+ floorsListView.Height = count * Application.GetRealHeight(50);
+ }
+ }
+ }
};
- new PublicAssmebly().TipMsg(StringId.Tip, StringId.DelFloorTip, action);
+ new PublicAssmebly().TipOptionMsg(StringId.Tip, StringId.DelFloorTip, action);
};
}
-
- /// <summary>
- /// 鎴块棿缁戝畾妤煎眰浜嬩欢
- /// </summary>
- void LoadEvent_BindFloor()
- {
- btnConfrim.MouseUpEventHandler = (sender, e) =>
- {
- if (lastButton == null)
- {
- return;
- }
- room.floorId = lastButton.Tag.ToString();
- room.floorId = lastButton.Tag.ToString();
- backAction?.Invoke();
- bodyView.RemoveFromParent();
- DB_ResidenceData.residenceData.SaveResidenceData();
- };
- }
-
}
}
--
Gitblit v1.8.0