Esempio n. 1
0
        private void timer1_Tick(object sender, EventArgs e)
        {
            DateTime now = DateTime.Now;

            ClientChatMsgList msgList = new ClientChatMsgList();

            msgList.Init(context);
            if (msgList.MsgList.Count > 0)
            {
                msgList.MsgList.ForEach(item =>
                {
                    this.allMessages.Add(item);
                    sb.Insert(0, item);
                    this.ReceivedCount++;
                });
                this.lblDelay.Text = msgList.MaxDelay.ToString();
            }
            if (msgList.Status == -1)
            {
                enableSendMsg  = false;
                timer1.Enabled = false;
                timer1.Stop();
            }

            this.lblS.Text = this.SendCount.ToString();
            this.lblR.Text = this.ReceivedCount.ToString();
            this.webBrowser1.DocumentText = sb.ToString();
            this.Refresh();
        }
Esempio n. 2
0
        /// <summary>
        /// 获取信息
        /// </summary>
        /// <returns></returns>
        public JsonResult GetInfo_wap(string sessionID)
        {
            ClientChatMsgList msgList = new ClientChatMsgList();

            if (!IsUserAgent() || !IsXMLRequest())
            {
                return(Json(msgList, JsonRequestBehavior.AllowGet));
            }
            try
            {
                CustomerChatContext context = new CustomerChatContext(sessionID);
                msgList.Init(context, true);
            }
            catch (Exception ex)
            {
                ChatLog.GetInstance().LogException(ex);
            }
            return(Json(msgList, JsonRequestBehavior.AllowGet));
        }