public void PostChildChat(string value, string to) { if (!Cs_CommonFunction.IsUserLoggedIn()) { return; } lock (ThisLock) { Cs_Chat cs_Chat = new Cs_Chat() { From = HttpContext.Current.Session["UserID"].ToString(), FromName = Session["UserName"].ToString(), To = to, Message = value, Status = 0 }; cs_Chat.ChatId = cs_Chat.SaveUserChat(); List <Cs_OnlineUser> list_User = GetOnlineUsers(); List <Cs_OnlineUser> user = (from p in list_User where p.UserID == to select p).ToList(); if (user.Count != 0) { if (HttpContext.Current.Application["ChildChat"] != null) { List <Cs_Chat> list_Chat = (List <Cs_Chat>)HttpContext.Current.Application["ChildChat"]; list_Chat.Add(cs_Chat); HttpContext.Current.Application["ChildChat"] = list_Chat; } } } }
public void ReplyMessage(string to, string message) { Cs_Chat cs_Chat = new Cs_Chat() { From = HttpContext.Current.Session["UserID"].ToString(), FromName = Session["UserName"].ToString(), To = to, Message = message, Status = 0 }; cs_Chat.ChatId = cs_Chat.SaveUserChat(); }