| | |
| | | |
| | | namespace HDL_ON.UI |
| | | { |
| | | /// <summary> |
| | | /// 使用权限页面 |
| | | /// </summary> |
| | | public partial class MemberPermissionPage : FrameLayout |
| | | { |
| | | MemberPermissionPage bodyView; |
| | | Button btnDelMember; |
| | | VerticalScrolViewLayout roomListView; |
| | | |
| | | ResidenceMemberInfo memberInfo; |
| | | |
| | |
| | | headPortraitView.AddChidren(btnMemberName); |
| | | |
| | | #region RoomList |
| | | VerticalScrolViewLayout roomListView = new VerticalScrolViewLayout() |
| | | roomListView = new VerticalScrolViewLayout() |
| | | { |
| | | Y = Application.GetRealHeight(138), |
| | | Height = Application.GetRealHeight(471), |
| | | //BackgroundColor = CSS_Color.MainBackgroundColor, |
| | | }; |
| | | bodyView.AddChidren(roomListView); |
| | | #endregion |
| | | |
| | | btnDelMember = new Button() |
| | | { |
| | | Y = Application.GetRealHeight(617), |
| | | //Height = MainPage.Increase ? Application.GetRealHeight(70) : Application.GetRealHeight(50), |
| | | Height = Application.GetRealHeight(50), |
| | | TextAlignment = TextAlignment.Center, |
| | | TextSize = CSS_FontSize.SubheadingFontSize, |
| | | TextColor = CSS_Color.WarningColor, |
| | | TextID = StringId.RemoveTheMember, |
| | | BackgroundColor = CSS_Color.MainBackgroundColor, |
| | | }; |
| | | bodyView.AddChidren(btnDelMember); |
| | | |
| | | LoadEventList(); |
| | | |
| | | GetShareDataByAccount(); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 加载房间列表,统计分享的数据 |
| | | /// </summary> |
| | | void ShowRoomListView() |
| | | { |
| | | roomListView.RemoveAll(); |
| | | |
| | | var titleView = new FrameLayout() |
| | | { |
| | |
| | | int addCount = 0; |
| | | foreach (var sd in memberInfo.CurResidenceShareDate) |
| | | { |
| | | if (room.GetRoomFunctions(false).Find((obj) => obj.sid == sd.fileName) != null) |
| | | if (room.GetRoomFunctions(false).Find((obj) => obj.deviceId == sd.shareTypeId) != null) |
| | | { |
| | | addCount++; |
| | | } |
| | | } |
| | | //移除当前住宅已经不存在的功能 |
| | | for(int i= 0;i< memberInfo.CurResidenceShareDate.Count;) |
| | | for (int i = 0; i < memberInfo.CurResidenceShareDate.Count;) |
| | | { |
| | | var sd = memberInfo.CurResidenceShareDate[i]; |
| | | if (DB_ResidenceData.functionList.GetAllFunction().Find((obj) => obj.sid == sd.fileName) == null) |
| | | if (DB_ResidenceData.functionList.GetAllFunction().Find((obj) => obj.deviceId == sd.shareTypeId) == null) |
| | | { |
| | | new DAL.Server.HttpServerRequest().DeleteShareData(sd); |
| | | //new DAL.Server.HttpServerRequest().DeleteShareData(sd); |
| | | memberInfo.CurResidenceShareDate.Remove(sd); |
| | | } |
| | | else |
| | |
| | | Action<string> refreshFunctionCount = (newCount) => { |
| | | btnFunctionCount.Text = newCount + "/" + room.GetRoomFunctions(false).Count.ToString(); |
| | | }; |
| | | var mmp = new MemberFunctionPermissionPage(memberInfo, room,refreshFunctionCount); |
| | | var mmp = new MemberFunctionPermissionPage(memberInfo, room, refreshFunctionCount); |
| | | MainPage.BasePageView.AddChidren(mmp); |
| | | mmp.LoadPage(StringId.PermissionToUse); |
| | | MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; |
| | |
| | | // BackgroundColor = CSS_Color.BackgroundColor, |
| | | // }); |
| | | //} |
| | | #endregion |
| | | |
| | | btnDelMember = new Button() |
| | | { |
| | | Y = Application.GetRealHeight(617), |
| | | //Height = MainPage.Increase ? Application.GetRealHeight(70) : Application.GetRealHeight(50), |
| | | Height = Application.GetRealHeight(50), |
| | | TextAlignment = TextAlignment.Center, |
| | | TextSize = CSS_FontSize.SubheadingFontSize, |
| | | TextColor = CSS_Color.WarningColor, |
| | | TextID = StringId.RemoveTheMember, |
| | | BackgroundColor = CSS_Color.MainBackgroundColor, |
| | | }; |
| | | bodyView.AddChidren(btnDelMember); |
| | | |
| | | LoadEventList(); |
| | | } |
| | | } |
| | | } |