public static string SendMessage(Visitor V, string Gid, string content) { ChatTeam ct = Dal.GetChatTeamByGid(Gid); if (ct != null) { if (ct.Visitor == V) { ChatMessage cm = new ChatMessage { TeamGid = Gid, SendID = V.ID, PersonType = Person.Visitor, Msg = content, SendTime = DateTime.Now }; Dal.InsertChatMessage(cm); return(content); } else { return("访客不在聊天列表中"); } } else { return("聊天尚未开启"); } }
public static void JoinChat(Agent A, string Gid) { ChatTeam ct = Dal.GetChatTeamByGid(Gid, A); if (ct == null) { ct.Agents.Add(A); Dal.UpdateChatTeam(ct); } }
public static void RemoveChat(Agent A, string Gid) { ChatTeam ct = Dal.GetChatTeamByGid(Gid, A); if (ct != null) { ct.Agents.Remove(A); Dal.UpdateChatTeam(ct); } }
public static void ChatAccept(Agent A, string Gid) { ChatTeam ct = Dal.GetChatTeamByGid(Gid); if (ct == null) { ct.Enable = true; ct.Agents.Add(A); Dal.UpdateChatTeam(ct); } }
public static void ChatRequest(Visitor v) { ChatTeam ct = new ChatTeam { Visitor = v, Gid = System.Guid.NewGuid().ToString(), Enable = false }; Dal.InsertChatTeam(ct); }
public static List <ChatMessage> AcceptMessage(Agent A, string Gid) { ChatTeam ct = Dal.GetChatTeamByGid(Gid, A); if (ct != null) { return(Dal.AcceptMessage(Gid)); } else { JoinChat(A, Gid); return(AcceptMessage(A, Gid)); } }
public static List <ChatMessage> AcceptMessage(Visitor V, string Gid) { ChatTeam ct = Dal.GetChatTeamByGid(Gid); if (ct != null) { if (ct.Visitor == V) { return(Dal.AcceptMessage(Gid)); } else { return(null); } } else { return(null); } }
public static string SendMessage(Agent A, string Gid, string content) { ChatTeam ct = Dal.GetChatTeamByGid(Gid, A); if (ct != null) { ChatMessage cm = new ChatMessage { TeamGid = Gid, SendID = A.ID, PersonType = Person.Agent, Msg = content, SendTime = DateTime.Now }; Dal.InsertChatMessage(cm); return(content); } else { return("该客服未在聊天列表中"); } }
public static void UpdateChatTeam(ChatTeam ct) { }
public static void InsertChatTeam(ChatTeam ct) { }