wei
2020-12-23 271faaf6664166dc368639b9f2e577f63f901be5
HDL_ON/UI/UI2/4-PersonalCenter/RoomListManage/AddRoom/RoomBinglingFloorPage.cs
@@ -92,22 +92,54 @@
        void RefreshFloorsListView(string floorName)
        {
            try
            var waitPage = new Loading();
            MainPage.BaseView.AddChidren(waitPage);
            waitPage.Start(Language.StringByID(StringId.PleaseWait));
            new System.Threading.Thread(() =>
            {
                var f = new SpatialInfo("FLOOR") { roomName = floorName, parentId = DB_ResidenceData.Instance.CurrentRegion.RegionID };
                var addResult = SpatialInfo.CurrentSpatial.AddFloor(f,out f);
                if (addResult == DAL.Server.StateCode.SUCCESS)
                try
                {
                    LoadFloorRow(f);
                    var f = new SpatialInfo("FLOOR") { roomName = floorName, parentId = DB_ResidenceData.Instance.CurrentRegion.RegionID };
                    var addResult = SpatialInfo.CurrentSpatial.AddFloor(f, out f);
                    if (addResult == DAL.Server.StateCode.SUCCESS)
                    {
                        Application.RunOnMainThread(() =>
                        {
                            LoadFloorRow(f);
                        });
                    }
                }
            }
            catch (Exception ex)
            {
                MainPage.Log("add floor eroor : " + ex.Message);
            }
            int count = SpatialInfo.CurrentSpatial.FloorList.Count > 10 ? 10 : SpatialInfo.CurrentSpatial.FloorList.Count;
            floorsListView.Height = Application.GetRealHeight(50 * count);
            contentView.Height = Application.GetRealHeight(50 * (count + 1));
                catch { }
                finally
                {
                    Application.RunOnMainThread(() => {
                        waitPage.Hide();
                        waitPage.RemoveFromParent();
                        int count = SpatialInfo.CurrentSpatial.FloorList.Count > 10 ? 10 : SpatialInfo.CurrentSpatial.FloorList.Count;
                        floorsListView.Height = Application.GetRealHeight(50 * count);
                        contentView.Height = Application.GetRealHeight(50 * (count + 1));
                    });
                }
            })
            { IsBackground = true }.Start();
            //try
            //{
            //    var f = new SpatialInfo("FLOOR") { roomName = floorName, parentId = DB_ResidenceData.Instance.CurrentRegion.RegionID };
            //    var addResult = SpatialInfo.CurrentSpatial.AddFloor(f,out f);
            //    if (addResult == DAL.Server.StateCode.SUCCESS)
            //    {
            //        LoadFloorRow(f);
            //    }
            //}
            //catch (Exception ex)
            //{
            //    MainPage.Log("add floor eroor : " + ex.Message);
            //}
            //int count = SpatialInfo.CurrentSpatial.FloorList.Count > 10 ? 10 : SpatialInfo.CurrentSpatial.FloorList.Count;
            //floorsListView.Height = Application.GetRealHeight(50 * count);
            //contentView.Height = Application.GetRealHeight(50 * (count + 1));
        }
        public void LoadPage()