From 9cc3de82145b405a76d7219084d3fa181f0eca4d Mon Sep 17 00:00:00 2001
From: wei <kaede@kaededeMacBook-Air.local>
Date: 星期五, 11 十二月 2020 17:06:47 +0800
Subject: [PATCH] 20201210

---
 HDL_ON/Common/HDLCommon.cs           |    3 
 .vs/HDL_APP_Project/xs/UserPrefs.xml |   17 ++++
 HDL_ON/HDL_ON.projitems              |    1 
 HDL_ON/Common/DB_AccountList.cs      |  203 ++++++++++++++++++++++++++++++++++++++++++++++++++
 HDL_ON/Entity/UserInfo.cs            |    9 ++
 5 files changed, 229 insertions(+), 4 deletions(-)

diff --git a/.vs/HDL_APP_Project/xs/UserPrefs.xml b/.vs/HDL_APP_Project/xs/UserPrefs.xml
index e3e0fee..f15acea 100644
--- a/.vs/HDL_APP_Project/xs/UserPrefs.xml
+++ b/.vs/HDL_APP_Project/xs/UserPrefs.xml
@@ -1,4 +1,5 @@
 锘�<Properties StartupConfiguration="{D998E133-F0DD-4760-BE3C-461632F54DA4}|Default">
+<<<<<<< Updated upstream
   <MonoDevelop.Ide.ItemProperties.HDL-ON__iOS PreferredExecutionTarget="MonoDevelop.IPhone.IPhoneSimulatorTarget.94B44E9C-E1BC-4BF7-812E-FC71E9B623B2" />
   <MonoDevelop.Ide.Workbench ActiveDocument="HDL_ON/UI/UI2/3-Intelligence/Scene/NewSceneMenuListPage.cs">
     <Files>
@@ -9,6 +10,18 @@
       <File FileName="HDL_ON/Entity/UserInfo.cs" Line="97" Column="25" />
       <File FileName="HDL_ON/UI/UI2/3-Intelligence/Scene/SceneEditPage.cs" Line="1" Column="1" />
       <File FileName="HDL_ON/UI/UI2/3-Intelligence/Scene/NewSceneMenuListPage.cs" Line="1" Column="1" />
+=======
+  <MonoDevelop.Ide.ItemProperties.HDL-ON__iOS PreferredExecutionTarget="MonoDevelop.IPhone.IPhoneDeviceTarget.6242be7109c740c6cb8999a8904b6e0ea8d45192" />
+  <MonoDevelop.Ide.Workbench ActiveDocument="HDL_ON/Entity/UserInfo.cs">
+    <Files>
+      <File FileName="HDL_ON/UI/MainPage.cs" Line="137" Column="10" />
+      <File FileName="HDL_ON/Entity/DB_ResidenceData.cs" Line="148" Column="23" />
+      <File FileName="HDL_ON/Common/HDLCommon.cs" Line="281" Column="7" />
+      <File FileName="HDL_ON/Common/DB_AccountList.cs" Line="22" Column="44" />
+      <File FileName="HDL-ON_iOS/AppDelegate.cs" Line="104" Column="33" />
+      <File FileName="HDL_ON/DAL/Server/HttpServerRequest.cs" Line="1" Column="1" />
+      <File FileName="HDL_ON/Entity/UserInfo.cs" Line="90" Column="19" />
+>>>>>>> Stashed changes
     </Files>
     <Pads>
       <Pad Id="ProjectPad">
@@ -17,11 +30,15 @@
             <Node name="HDL_ON" expanded="True">
               <Node name="Common" expanded="True" />
               <Node name="DAL" expanded="True">
+<<<<<<< Updated upstream
                 <Node name="DriverLayer" expanded="True" />
+=======
+>>>>>>> Stashed changes
                 <Node name="Server" expanded="True" />
               </Node>
               <Node name="Entity" expanded="True">
                 <Node name="Function" expanded="True" />
+                <Node name="UserInfo.cs" selected="True" />
               </Node>
               <Node name="UI" expanded="True">
                 <Node name="UI0-Public" expanded="True" />
diff --git a/HDL_ON/Common/DB_AccountList.cs b/HDL_ON/Common/DB_AccountList.cs
new file mode 100644
index 0000000..24be3cd
--- /dev/null
+++ b/HDL_ON/Common/DB_AccountList.cs
@@ -0,0 +1,203 @@
+锘�//using System;
+//using System.Collections.Generic;
+//using System.IO;
+//using HDL_ON.DAL.Server;
+
+//namespace HDL_ON.Common
+//{
+//    public class DB_AccountList
+//    {
+
+//        static DB_AccountList _AccountList;
+
+//        public static DB_AccountList Accounts
+//        {
+//            get
+//            {
+//                if (_AccountList == null)
+//                {
+//                    try
+//                    {
+//                        DB_AccountList temp = Newtonsoft.Json.JsonConvert.DeserializeObject<DB_AccountList>(System.Text.Encoding.UTF8.GetString(Common.FileUtlis.Files.ReadUserInfo()));
+//                        if (temp == null)
+//                        {
+//                            _AccountList = new DB_AccountList() { };
+//                            Utlis.WriteLine("UserInfo null");
+//                        }
+//                        else
+//                        {
+//                            _AccountList = temp;
+//                            Utlis.WriteLine("UserInfo Current");
+//                        }
+//                    }
+//                    catch
+//                    {
+//                        _AccountList = new DB_AccountList() { };
+//                        Utlis.WriteLine("UserInfo null");
+//                    }
+//                }
+//                return _AccountList;
+//            }
+//        }
+
+//        public List<DB_Account> List = new List<DB_Account>();
+
+//        public DB_Account CurAccount
+//        {
+//            get
+//            {
+//                var temp = List.Find((obj) => obj.UserId == UserInfo.Current.ID);
+//                if (temp == null)
+//                {
+//                    temp = new DB_Account();
+//                }
+//                return temp;
+//            }
+//        }
+
+//        /// <summary>
+//        /// 鏍圭洰褰�
+//        /// </summary>
+//        string RootPath = Environment.GetFolderPath(Environment.SpecialFolder.Personal) + "/";
+//        /// <summary>
+//        /// 璇诲彇userInfo鏂囦欢
+//        /// </summary>
+//        /// <returns></returns>
+//        public byte[] ReadUserInfo()
+//        {
+//            var fileName = "UserInfo_File";
+//            FileStream fs = null;
+//            try
+//            {
+//                if (File.Exists(Path.Combine(RootPath, fileName)))
+//                {
+//                    fs = new FileStream(Path.Combine(RootPath, fileName), FileMode.Open, FileAccess.Read);
+//                }
+//                else if (File.Exists(fileName))
+//                {
+//                    fs = new FileStream(fileName, FileMode.Open, FileAccess.Read);
+//                }
+//                else
+//                {
+//                    return new byte[0];
+//                }
+//                byte[] bytes = new byte[fs.Length];
+//                fs.Read(bytes, 0, bytes.Length);
+//                return bytes;
+//            }
+//            catch
+//            {
+//                return new byte[0];
+//            }
+//            finally
+//            {
+//                try
+//                {
+//                    if (fs != null)
+//                    {
+//                        fs.Close();
+//                    }
+//                }
+//                catch
+//                {
+
+//                }
+//            }
+
+//        }
+//        /// <summary>
+//        /// 淇濆瓨userInfo
+//        /// </summary>
+//        /// <param name="bytes"></param>
+//        /// <returns></returns>
+//        public bool WirteUserinfo(byte[] bytes)
+//        {
+//            var fileName = "UserInfo_File";
+//            FileStream fs = null;
+
+//            try
+//            {
+//                fs = new FileStream(Path.Combine(RootPath, fileName), FileMode.Create, FileAccess.Write);
+//                fs.Write(bytes, 0, bytes.Length);
+//                fs.Flush();
+//                MainPage.Log("SaveFile:" + fileName);
+//                return true;
+//            }
+//            catch (Exception ex)
+//            {
+//                MainPage.Log("FileUtiles Code 113:" + ex.ToString());
+//                return false;
+//            }
+//            finally
+//            {
+//                try
+//                {
+//                    if (fs != null)
+//                    {
+//                        fs.Close();
+//                    }
+//                }
+//                catch (Exception ex)
+//                {
+//                    MainPage.Log("FileUtils Code 121 :" + ex.ToString());
+//                }
+//            }
+//        }
+//    }
+
+//    public class DB_Account
+//    {
+//        /// <summary>
+//        /// 鐢ㄦ埛ID
+//        /// </summary>
+//        public string UserId = "";
+//        /// <summary>
+//        /// 鐢ㄦ埛鎵嬫満鍙风爜
+//        /// </summary>
+//        public string userMobileInfo = "";
+//        /// <summary>
+//        /// 鐢ㄦ埛閭淇℃伅
+//        /// </summary>
+//        public string userEmailInfo = "";
+
+//        public DateTime lastLogin = DateTime.Now;
+
+//        public bool ConsentAgreement = false;
+
+
+//        #region 鏂板淇濆瓨鍙傛暟
+//        /// <summary>
+//        ///  璐﹀彿娉ㄥ唽鏈嶅姟鍣ㄤ俊鎭�
+//        /// </summary>
+//        public string RequestHttpsHost = "https://china.hdlcontrol.com";
+//        /// <summary>
+//        /// 
+//        /// </summary>
+//        public GlobalRegionListRes GlobalRegion;
+
+//        /// <summary>
+//        /// 鏄惁鍚屾剰鍗忚
+//        /// </summary>
+//        public bool isAgreePrivacyPolicy;
+
+//        /// <summary>
+//        /// 蹇界暐鏇存柊鐨勭増鏈彿
+//        /// </summary>
+//        public string IgnoreUpdateVersion = string.Empty;
+
+//        /// <summary>
+//        /// 淇℃伅鎺ㄩ�佹爣璁�
+//        /// </summary>
+//        public string PushDeviceToken;
+//        /// <summary>
+//        /// phoneName
+//        /// </summary>
+//        public string PhoneName;
+//        /// <summary>
+//        /// 娣诲姞鎺ㄩ�乀oken鎴愬姛鏃惰繑鍥炵殑Id
+//        /// </summary>
+//        public string PushId;
+//        #endregion
+
+//    }
+//}
diff --git a/HDL_ON/Common/HDLCommon.cs b/HDL_ON/Common/HDLCommon.cs
index 963549a..da96ab9 100644
--- a/HDL_ON/Common/HDLCommon.cs
+++ b/HDL_ON/Common/HDLCommon.cs
@@ -278,9 +278,6 @@
         /// </summary>
         public void CheckLogout()
         {
-#if DEBUG
-            return;
-#endif
             //鏈櫥褰曚笉鐢ㄥ鐞�
             if (!UserInfo.Current.IsLogin) return;
 
diff --git a/HDL_ON/Entity/UserInfo.cs b/HDL_ON/Entity/UserInfo.cs
index 4077417..8268cd3 100644
--- a/HDL_ON/Entity/UserInfo.cs
+++ b/HDL_ON/Entity/UserInfo.cs
@@ -47,6 +47,13 @@
                 return m_Current;
             }
         }
+        /// <summary>
+        /// 娓呴櫎缂撳瓨鏁版嵁
+        /// </summary>
+        public void ClearUserInfo()
+        {
+            m_Current = null;
+        }
 
         #region 鏂板淇濆瓨鍙傛暟
         /// <summary>
@@ -178,7 +185,7 @@
 
         public void SaveUserInfo()
         {
-            Common.FileUtlis.Files.WirteUserinfo( Encoding.UTF8.GetBytes(Newtonsoft.Json.JsonConvert.SerializeObject(this)));
+            Common.FileUtlis.Files.WirteUserinfo(Encoding.UTF8.GetBytes(Newtonsoft.Json.JsonConvert.SerializeObject(this)));
         }
 
         /// <summary>
diff --git a/HDL_ON/HDL_ON.projitems b/HDL_ON/HDL_ON.projitems
index f5ad128..67e3e2f 100644
--- a/HDL_ON/HDL_ON.projitems
+++ b/HDL_ON/HDL_ON.projitems
@@ -256,6 +256,7 @@
     <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\4-PersonalCenter\RoomListManage\AddRoom\AddRoomPage.cs" />
     <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\4-PersonalCenter\RoomListManage\AddRoom\RoomBinglingFloorPage.cs" />
     <Compile Include="$(MSBuildThisFileDirectory)UI\BindingResidence\BindingResidencePage.cs" />
+    <Compile Include="$(MSBuildThisFileDirectory)Common\DB_AccountList.cs" />
   </ItemGroup>
   <ItemGroup>
     <Folder Include="$(MSBuildThisFileDirectory)UI\" />

--
Gitblit v1.8.0