Exemplo n.º 1
0
        public IActionResult MarkAllMessages()
        {
            if (!Validate())
            {
                return(null);
            }

            BLL_Chat bll_chat = new BLL_Chat();

            try
            {
                int result = bll_chat.MarkAllChat();
                return(Json(new
                {
                    code = "200"
                }));
            }
            catch (Exception ex)
            {
                return(Json(new
                {
                    code = "-101",
                    message = ex.Message
                }));
            }
        }
Exemplo n.º 2
0
        private void AddMessage(string line)
        {
            BLL_Chat bll_chat = new BLL_Chat();
            int      pos      = line.IndexOf("> ");
            string   user     = line.Substring(1, pos - 1);
            string   message  = line.Substring(pos + 2, line.Length - user.Length - 3);

            bll_chat.InsertChat(user, message);
            //MessageList.Insert(0, new ServerUser(DateTime.Now, user, message));
        }
Exemplo n.º 3
0
        public IActionResult GetMessages()
        {
            if (!Validate())
            {
                return(null);
            }

            BLL_Chat          bll_chat = new BLL_Chat();
            List <ServerUser> list     = bll_chat.GetChatListOrderByTime(0, 10);

            return(Json(new
            {
                code = "200",
                count = list.Count,
                data = list
            }));
        }