| | |
| | | using System; |
| | | using HDL_ON.DAL.Server; |
| | | using HDL_ON.Entity; |
| | | using Shared; |
| | | |
| | |
| | | }; |
| | | dispalyView.AddChidren(contentView); |
| | | |
| | | if (MainPage.LoginUser.regionList.Count < 3) |
| | | if (UserInfo.Current.regionList.Count < 2) |
| | | { |
| | | |
| | | } |
| | | else if (MainPage.LoginUser.regionList.Count < 4) |
| | | else if (UserInfo.Current.regionList.Count < 3) |
| | | { |
| | | dispalyView = new FrameLayout() |
| | | { |
| | | X = Application.GetRealWidth(10), |
| | | Y = Application.GetRealHeight(268), |
| | | Width = Application.GetRealWidth(160), |
| | | Height = Application.GetRealHeight(105), |
| | | BackgroundImagePath = "PersonalCenter/HomeList1bg.png", |
| | | }; |
| | | dialogBody.AddChidren(dispalyView); |
| | | |
| | | contentView.Height = Application.GetRealHeight(45 * 2); |
| | | dispalyView.AddChidren(contentView); |
| | | } |
| | | else if (UserInfo.Current.regionList.Count < 4) |
| | | { |
| | | dispalyView = new FrameLayout() |
| | | { |
| | |
| | | contentView.Height = Application.GetRealHeight(45 * 3); |
| | | dispalyView.AddChidren(contentView); |
| | | } |
| | | else if (MainPage.LoginUser.regionList.Count < 5) |
| | | else if (UserInfo.Current.regionList.Count < 5) |
| | | { |
| | | dispalyView = new FrameLayout() |
| | | { |
| | |
| | | |
| | | |
| | | |
| | | foreach (var home in MainPage.LoginUser.regionList) |
| | | foreach (var home in UserInfo.Current.regionList) |
| | | { |
| | | var btnHomeName = new Button() |
| | | { |
| | |
| | | }; |
| | | contentView.AddChidren(btnHomeName); |
| | | |
| | | if (MainPage.LoginUser.regionList.IndexOf(home) < MainPage.LoginUser.regionList.Count - 1) |
| | | if (UserInfo.Current.regionList.IndexOf(home) < UserInfo.Current.regionList.Count - 1) |
| | | { |
| | | contentView.AddChidren(new Button() |
| | | { |
| | |
| | | { |
| | | var regionId = (string)btnHomeName.Tag; |
| | | dialog.Close(); |
| | | //DB_ResidenceData.residenceData.CurReginID = regionId; |
| | | LoadEvent_ChangeCurHome(MainPage.LoginUser.regionList.Find((obj) => obj.RegionID == regionId)); |
| | | LoadEvent_ChangeCurHome(UserInfo.Current.regionList.Find((obj) => obj.RegionID == regionId)); |
| | | LoadContentView(); |
| | | }; |
| | | } |
| | |
| | | DB_ResidenceData.residenceData.CurReginID = homeTemp.RegionID; |
| | | DB_ResidenceData.residenceData.SaveResidenceData(); |
| | | var waitPage = new Loading(); |
| | | bodyView.AddChidren(waitPage); |
| | | waitPage.Start(Language.StringByID(StringId.PleaseWait)); |
| | | new System.Threading.Thread(() => |
| | | { |
| | | try |
| | |
| | | foreach (var fileName in backuplist) |
| | | { |
| | | System.IO.FileInfo fileInfo = new System.IO.FileInfo(FileUtils.RootPath + fileName); |
| | | if (fileName == "headImage.png") |
| | | if (fileName.Contains(ImageUtlis.HEADIMAGE) || fileName == OnAppConfig.ConfigFile) |
| | | { |
| | | continue; |
| | | } |
| | |
| | | //删除本地文件 |
| | | foreach (var fileName in backuplist) |
| | | { |
| | | if (fileName == "headImage.png") |
| | | if (fileName.Contains(ImageUtlis.HEADIMAGE)) |
| | | { |
| | | continue; |
| | | } |
| | |
| | | } |
| | | //倒出新住宅数据 |
| | | FileUtils.RestoreRegionFiles(newRegionRootPath); |
| | | MainPage.LoginUser.SaveUserInfo(); |
| | | UserInfo.Current.SaveUserInfo(); |
| | | DB_ResidenceData.residenceData.EixtAccount(); |
| | | DB_ResidenceData.residenceData.CurReginID = homeTemp.RegionID; |
| | | OnAppConfig.Instance.SaveUserConfig(); |
| | | DB_ResidenceData.InitRoomFunction(); |
| | | SpatialInfo.CurrentSpatial.InitRoomFunction(); |
| | | DB_ResidenceData.residenceData.SaveResidenceData(); |
| | | //刷新一次住宅网关 |
| | | new HttpServerRequest().GetHomeGatewayList(); |
| | | |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | btnCurResidenceName.Text = DB_ResidenceData.residenceData.residecenInfo.Name; |
| | | }); |
| | | |
| | | //搜索网关 |
| | | DriverLayer.Control.Ins.SearchLoaclGateway(); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | |
| | | { |
| | | waitPage.Hide(); |
| | | waitPage.RemoveFromParent(); |
| | | MainPage.InitializationData(); |
| | | }); |
| | | } |
| | | }) |
| | |
| | | { |
| | | Action updataHeadImage = () => |
| | | { |
| | | userHeadImageView.ImagePath = MainPage.LoginUser.headImagePagePath; |
| | | userHeadImageView.ImagePath = UserInfo.Current.headImagePagePath; |
| | | }; |
| | | Action updataUserName = () => |
| | | { |
| | | btnUserName.Text = MainPage.LoginUser.userName; |
| | | btnUserName.Text = UserInfo.Current.userName; |
| | | }; |
| | | |
| | | var personalDataView = new PersonalDataPage(updataHeadImage, updataUserName); |
| | |
| | | #region 成员管理 |
| | | void LoadEvent_GoMemberManagement() |
| | | { |
| | | EventHandler<MouseEventArgs> eHandler = (sender, e) => { |
| | | EventHandler<MouseEventArgs> eHandler = (sender, e) => |
| | | { |
| | | var mmp = new MemberManagementPage(); |
| | | MainPage.BasePageView.AddChidren(mmp); |
| | | mmp.LoadPage(); |
| | |
| | | #region 添加设备 |
| | | void LoadEvent_SkipbtnAddFunctionPage() |
| | | { |
| | | EventHandler<MouseEventArgs> eventHandler = (sender, e) => { |
| | | EventHandler<MouseEventArgs> eventHandler = (sender, e) => |
| | | { |
| | | var page = new SearchDevicePage(); |
| | | MainPage.BasePageView.AddChidren(page); |
| | | page.LoadPage(); |
| | |
| | | { |
| | | btnSupportText.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | var getsupportPage = new GetSupportPage(); |
| | | //var getsupportPage = new GetSupportPage(); |
| | | //MainPage.BasePageView.AddChidren(getsupportPage); |
| | | //getsupportPage.LoadPage(); |
| | | //MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; |
| | | |
| | | |
| | | var getsupportPage = new FAQHelpPage(); |
| | | MainPage.BasePageView.AddChidren(getsupportPage); |
| | | getsupportPage.LoadPage(); |
| | | MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; |