From 52c84c10c3f77156f73566cb9793616e2a25dddd Mon Sep 17 00:00:00 2001
From: 陈嘉乐 <cjl@hdlchina.com.cn>
Date: 星期二, 08 十二月 2020 16:08:55 +0800
Subject: [PATCH] 2020-12-08-001

---
 HDL_ON/Entity/DB_ResidenceData.cs |   33 ++++++++++++++++++++++++++++++++-
 1 files changed, 32 insertions(+), 1 deletions(-)

diff --git a/HDL_ON/Entity/DB_ResidenceData.cs b/HDL_ON/Entity/DB_ResidenceData.cs
index 5410f8b..d9e454b 100644
--- a/HDL_ON/Entity/DB_ResidenceData.cs
+++ b/HDL_ON/Entity/DB_ResidenceData.cs
@@ -30,6 +30,22 @@
                 else
                 {
                     var curRegion = UserInfo.Current.regionList.Find((obj) => obj.RegionID == CurReginID);
+                    if (curRegion == null)
+                    {
+                        if (UserInfo.Current.regionList != null && UserInfo.Current.regionList.Count > 0)
+                        {
+                            CurReginID = UserInfo.Current.regionList[0].RegionID;
+                            //鎭㈠澶囦唤
+                            HDLCommon.Current.RestoreHomeBackup(CurReginID);
+
+                            return UserInfo.Current.regionList[0];
+                        }
+                        else
+                        {
+                            return new RegionInfoRes();
+                        }
+                    }
+
                     //if (curRegion == null)
                     //{
                     //    CurReginID =  UserInfo.Current.regionList[0].RegionID;
@@ -271,7 +287,22 @@
         public List<Room> Rooms = SpatialInfo.CurrentSpatial.RoomList;
 
         #region 鍔熻兘鏁版嵁
-        public static FunctionList functionList = FunctionList.List;
+        static FunctionList _functionList;
+        public static FunctionList functionList
+        {
+            get
+            {
+                if (_functionList == null)
+                {
+                    _functionList = FunctionList.List;
+                }
+                return _functionList;
+            }
+            set
+            {
+                _functionList = value;
+            }
+        }
 
         /// <summary>
         /// 鍒锋柊浣忓畢閲岄潰鐨勬悳绱㈣澶囩姸鎬�

--
Gitblit v1.8.0