コード例 #1
0
        /// <summary>
        /// 判断有无重名
        /// </summary>
        /// <param name="ID">姓名</param>
        /// <returns></returns>
        public static bool ExistUser(string ID)
        {
            FindClass Fc = new FindClass();

            Fc.UserId = ID;
            return(ListClass.Engin_UserList.Exists(Fc.PredicateUser));
        }
コード例 #2
0
        /*三种模式 1群聊,多对多 2单对多 3单对单
         * 1聊天室效果时
         * 2管理员回答问题时
         * 3客户问问题咨询时
         */
        /// <summary>
        /// 读取记录
        /// </summary>
        /// <param name="ID">接收者ID</param>
        /// <returns></returns>
        public static List <ChatInfo> ReadChatInfo(string ID, PowerTalkBoxEnum.Enum.SystemMode MsnMd)
        {
            List <ChatInfo> ChatInfoArray = new List <ChatInfo>();
            bool            IsHaveMsg     = false;

            if (HttpRuntime.Cache[ID] != null)
            {
                if (bool.TryParse(HttpRuntime.Cache[ID].ToString(), out IsHaveMsg))
                {
                    if (IsHaveMsg)
                    {
                        FindClass Fc = new FindClass();
                        Fc.UserId     = ID;
                        ChatInfoArray = ListClass.Engin_ChatList.FindAll(Fc.PredicateChat);

                        foreach (ChatInfo Cif in ChatInfoArray)
                        {
                            ListClass.Engin_ChatList.Remove(Cif);
                        }
                        HttpRuntime.Cache[ID] = false;
                    }
                }
            }

            return(ChatInfoArray);
        }
コード例 #3
0
        /// <summary>
        /// 用户List列表
        /// </summary>
        /// <returns></returns>
        public static List <UserInfo> UserInfos(string ID)
        {
            FindClass Fc = new FindClass();

            Fc.UserId = ID;
            return(ListClass.Engin_UserList.FindAll(Fc.PredicateUserList));
        }
コード例 #4
0
        /// <summary>
        /// 查找用户名
        /// </summary>
        /// <param name="ID">用户ID</param>
        /// <returns></returns>
        public static UserInfo FindUserInfo(string ID)
        {
            FindClass Fc = new FindClass();

            Fc.UserId = ID;
            UserInfo Ui = ListClass.Engin_UserList.Find(Fc.PredicateUser);

            return(Ui);
        }
コード例 #5
0
        /// <summary>
        /// 删除记录
        /// </summary>
        /// <param name="ID">接收ID</param>
        /// <returns></returns>
        public static bool DeleteChatInfo(string ID)
        {
            FindClass Fc = new FindClass();

            Fc.UserId = ID;
            List <ChatInfo> ChatInfoArray = ListClass.Engin_ChatList.FindAll(Fc.PredicateChat);

            foreach (ChatInfo Cif in ChatInfoArray)
            {
                ListClass.Engin_ChatList.Remove(Cif);
            }
            return(true);
        }
コード例 #6
0
 /// <summary>
 /// 判断有无重名
 /// </summary>
 /// <param name="ID">姓名</param>
 /// <returns></returns>
 public static bool ExistUser(string ID)
 {
     FindClass Fc = new FindClass();
     Fc.UserId = ID;
     return ListClass.Engin_UserList.Exists(Fc.PredicateUser);
 }
コード例 #7
0
 /// <summary>
 /// 删除记录
 /// </summary>
 /// <param name="ID">接收ID</param>
 /// <returns></returns>
 public static bool DeleteChatInfo(string ID)
 {
     FindClass Fc = new FindClass();
     Fc.UserId = ID;
     List<ChatInfo> ChatInfoArray = ListClass.Engin_ChatList.FindAll(Fc.PredicateChat);
     foreach (ChatInfo Cif in ChatInfoArray)
     {
         ListClass.Engin_ChatList.Remove(Cif);
     }
     return true;
 }
コード例 #8
0
    /*三种模式 1群聊,多对多 2单对多 3单对单 
     *1聊天室效果时
     *2管理员回答问题时
     *3客户问问题咨询时
     */
    /// <summary>
    /// 读取记录
    /// </summary>
    /// <param name="ID">接收者ID</param>
    /// <returns></returns>
    public static List<ChatInfo> ReadChatInfo(string ID,PowerTalkBoxEnum.Enum.SystemMode MsnMd)
    {
        List<ChatInfo> ChatInfoArray = new List<ChatInfo>();
        bool IsHaveMsg = false;
        if (HttpRuntime.Cache[ID] != null)
        {
            if (bool.TryParse(HttpRuntime.Cache[ID].ToString(), out IsHaveMsg))
            {
                if (IsHaveMsg)
                {
    
 
     
            FindClass Fc = new FindClass();
            Fc.UserId = ID;
            ChatInfoArray = ListClass.Engin_ChatList.FindAll(Fc.PredicateChat);
  
                        foreach (ChatInfo Cif in ChatInfoArray)
                        {
                            ListClass.Engin_ChatList.Remove(Cif);
                        }
                        HttpRuntime.Cache[ID] = false;
                    }
                }
            }
    
        return ChatInfoArray;
    }
コード例 #9
0
 /// <summary>
 /// 查找用户名
 /// </summary>
 /// <param name="ID">用户ID</param>
 /// <returns></returns>
 public static UserInfo FindUserInfo(string ID)
 {
     FindClass Fc = new FindClass();
     Fc.UserId = ID;
     UserInfo Ui = ListClass.Engin_UserList.Find(Fc.PredicateUser);
     return Ui;
 }
コード例 #10
0
 /// <summary>
 /// 用户List列表
 /// </summary>
 /// <returns></returns>
 public static List<UserInfo> UserInfos(string ID)
 {
     FindClass Fc = new FindClass();
     Fc.UserId = ID;
     return ListClass.Engin_UserList.FindAll(Fc.PredicateUserList);
 }