using System;
using HDL_ON.Entity;
using Shared;
namespace HDL_ON.UI
{
public partial class RoomsManagementPage
{
///
/// 进入编辑房间之后的回调
///
Action editBackAction;
///
/// 加载事件列表
///
void LoadEventList()
{
}
///
/// 跳转到增加房间的界面
///
void LoadEvent_SkipAddRoomPage()
{
skipAddRoomAction = (type, floor) =>
{
Room newRoom = new Room();
editBackAction = () => {
LoadRoomRow(newRoom);
};
var skipPage = new RoomEditPage(newRoom, StringId.AddRoom,editBackAction);
MainPage.BasePageView.AddChidren(skipPage);
skipPage.LoadPage();
MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
};
}
///
/// 跳转到编辑房间的界面
///
void LoadEvent_SkipEditRoomPage(Room r,Button btnRoomName)
{
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;
}
};
var skipPage = new RoomEditPage(r, StringId.EditRoomInfo,editBackAction);
MainPage.BasePageView.AddChidren(skipPage);
skipPage.LoadPage();
MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
}
}
}