Exemple #1
0
        public User_Info User_Login(string p_UserName, string p_PassWord)
        {
            try
            {
                User_Info _User_Info = DBMemory.Get_User_Info(p_UserName, p_PassWord);
                if (_User_Info == null)
                {
                    return(new User_Info());
                }
                else
                {
                    Subscribe(_User_Info.User_Name);
                    Auto_Push_Data.Broadcast_Session(new Session_Info(_User_Info.User_Name, (int)Enum_Session_Status.LogIn));

                    return(_User_Info);
                }
            }
            catch (Exception ex)
            {
                NaviCommon.Common.log.Error(ex.ToString());
                return(new User_Info());
            }
        }
Exemple #2
0
        public void UnSubscribe(string p_id)
        {
            try
            {
                lock (DBMemory.c_object_lock)
                {
                    DBMemory.c_dic_identifi_callback_client.Remove(p_id);

                    NaviCommon.Common.log.Error("Client " + p_id + " UnSubscribe");
                }

                Auto_Push_Data.Broadcast_Session(new Session_Info(p_id, (int)Enum_Session_Status.LogOut));

                if (DBMemory.c_dic_User_Interface.ContainsKey(p_id))
                {
                    DBMemory.c_dic_User_Interface[p_id].c_User_Info.Online_Status = (int)Enum_Session_Status.LogOut;
                }
            }
            catch (Exception ex)
            {
                NaviCommon.Common.log.Error(ex.ToString());
            }
        }