using System;
|
using HDL_ON.Entity;
|
using Shared;
|
|
namespace HDL_ON.UI
|
{
|
public partial class RoomsManagementPage
|
{
|
/// <summary>
|
/// 进入编辑房间之后的回调
|
/// </summary>
|
Action editBackAction;
|
|
/// <summary>
|
/// 加载事件列表
|
/// </summary>
|
void LoadEventList()
|
{
|
|
}
|
|
/// <summary>
|
/// 跳转到增加房间的界面
|
/// </summary>
|
void LoadEvent_SkipAddRoomPage()
|
{
|
skipAddRoomAction = (type, floor) =>
|
{
|
Room newRoom = new Room() {
|
sid = Guid.NewGuid().ToString(),
|
};
|
editBackAction = () => {
|
LoadRoomRow(newRoom);
|
};
|
|
var skipPage = new RoomEditPage(newRoom, StringId.AddRoom,editBackAction);
|
MainPage.BasePageView.AddChidren(skipPage);
|
skipPage.LoadPage();
|
MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
|
};
|
}
|
|
/// <summary>
|
/// 跳转到编辑房间的界面
|
/// </summary>
|
void LoadEvent_SkipEditRoomPage(Room r,Button btnRoomName,Button btnBg)
|
{
|
editBackAction = () =>
|
{
|
if (string.IsNullOrEmpty(r.sid))
|
{
|
for (int i = 0; i < roomsListView.ChildrenCount; )
|
{
|
if (roomsListView.GetChildren(i).Tag.ToString() == r.name + "line" || roomsListView.GetChildren(i).Tag.ToString() == r.name + "row")
|
{
|
roomsListView.GetChildren(i).RemoveFromParent();
|
}
|
else
|
{
|
i++;
|
}
|
}
|
}
|
else
|
{
|
btnRoomName.Text = r.floor + " " + r.name;
|
btnBg.UnSelectedImagePath = r.backgroundImage;
|
}
|
};
|
var skipPage = new RoomEditPage(r, StringId.EditRoomInfo,editBackAction);
|
MainPage.BasePageView.AddChidren(skipPage);
|
skipPage.LoadPage();
|
MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
|
}
|
}
|
}
|