/// <summary>
        /// 获取未读的消息,定期获取,给客户端一个是否有未读消息的信息
        /// </summary>
        /// <returns>返回消息的属性</returns>
        public string GetUnreadMessage(string data, Client client, Server server)
        {
            List <string> list = null;

            list = messageDAO.GetUnreadMessage(client.MySqlConnection, int.Parse(data));
            if (list != null)
            {
                string resData = "";
                foreach (var item in list)
                {
                    resData += item + "-"; // 使用“-”将不同信息分割
                }

                return(((int)ReturnCode.Success).ToString() + "," + resData);
            }
            else
            {
                return(((int)ReturnCode.Fail).ToString());
            }
        }
示例#2
0
        /// <summary>
        /// 获取未读的消息,定期获取,给客户端一个是否有未读消息的信息
        /// </summary>
        /// <returns>返回消息的属性</returns>
        public string GetUnreadMessage(string data, Client client, Server server)
        {
            Dictionary <int, string> dict = null;

            dict = messageDAO.GetUnreadMessage(client.MySqlConnection, int.Parse(data));
            if (dict != null && dict.Count != 0)
            {
                string resData = "";
                foreach (var item in dict)
                {
                    resData += item.Key;
                    resData += "_" + item.Value;
                    resData += "-"; // 使用“-”将不同信息分割
                }

                return(((int)ReturnCode.Success).ToString() + "," + resData);
            }
            else
            {
                return(((int)ReturnCode.Fail).ToString());
            }
        }