| | |
| | | /// 楼层的主键
|
| | | /// </summary>
|
| | | private string floorKeys = string.Empty;
|
| | | /// <summary>
|
| | | /// 房间顺序
|
| | | /// </summary>
|
| | | private List<string> listRoomSort = new List<string>();
|
| | |
|
| | | #endregion
|
| | |
|
| | |
| | | //主人或者管理员才会出现这个菜单
|
| | | if (UserCenterResourse.UserInfo.AuthorityNo == 1 || UserCenterResourse.UserInfo.AuthorityNo == 2)
|
| | | {
|
| | | var btnIcon = new MostRightIconControl(69, 69);
|
| | | btnIcon.UnSelectedImagePath = "Item/Add.png";
|
| | | topFrameLayout.AddChidren(btnIcon);
|
| | | btnIcon.InitControl();
|
| | | btnIcon.ButtonClickEvent += ((sender, e) =>
|
| | | //查看模板时,不允许编辑
|
| | | if (Common.Config.Instance.Home.IsShowTemplate == false)
|
| | | {
|
| | | var form = new AddNewRoomForm();
|
| | | form.AddForm(i_floor);
|
| | | });
|
| | | var btnIcon = new MostRightIconControl(69, 69);
|
| | | btnIcon.UnSelectedImagePath = "Item/Add.png";
|
| | | topFrameLayout.AddChidren(btnIcon);
|
| | | btnIcon.InitControl();
|
| | | btnIcon.ButtonClickEvent += ((sender, e) =>
|
| | | {
|
| | | var form = new AddNewRoomForm();
|
| | | form.AddForm(i_floor);
|
| | | });
|
| | | }
|
| | | }
|
| | |
|
| | | //初始化中部信息
|
| | |
| | | {
|
| | | //获取楼层的房间
|
| | | var listRoom = HdlRoomLogic.Current.GetFloorSortRoom(this.floorKeys);
|
| | | this.listRoomSort.Clear();
|
| | | for (int i = 0; i < listRoom.Count; i++)
|
| | | {
|
| | | this.listRoomSort.Add(listRoom[i].Id);
|
| | | }
|
| | |
|
| | | this.listView.RemoveAll();
|
| | | listView.Height = bodyFrameLayout.Height + Application.GetRealHeight(6);
|
| | |
| | | var form = new EditorRoomInforForm();
|
| | | form.AddForm(room);
|
| | | };
|
| | | //查看模板时,不允许编辑
|
| | | if (Common.Config.Instance.Home.IsShowTemplate == true)
|
| | | {
|
| | | btnEditor.Text = Language.StringByID(R.MyInternationalizationString.uSearch1);
|
| | | return;
|
| | | }
|
| | |
|
| | | //删除
|
| | | var btnDelete = frameRow.AddDeleteControl();
|
| | |
| | | //确认删除房间?
|
| | | this.ShowMassage(ShowMsgType.Confirm, Language.StringByID(R.MyInternationalizationString.uDeleteRoomMsg), () =>
|
| | | {
|
| | | if (HdlRoomLogic.Current.CurrentRoom.Id == room.Id)
|
| | | {
|
| | | //如果删除的是当前房间的话
|
| | | HdlRoomLogic.Current.CurrentRoom = HdlRoomLogic.Current.GetLoveRoom();
|
| | | }
|
| | | HdlRoomLogic.Current.RemoveRoom(room.Id);
|
| | | //调整高度
|
| | | frameRow.RemoveFromParent();
|
| | | listView.AdjustRealHeight(Application.GetRealHeight(23));
|
| | | //保存顺序
|
| | | this.listRoomSort.Remove(room.Id);
|
| | | HdlRoomLogic.Current.SaveRoomSort(floorKeys, this.listRoomSort);
|
| | |
|
| | | if (room.ListDevice.Count > 0)
|
| | | {
|
| | | //上传空间区域信息
|
| | | HdlRoomLogic.Current.SetRoomInfoToGateway();
|
| | | }
|
| | | });
|
| | | };
|
| | | }
|