示例#1
0
        public static void SendMessage(BasketballContext context, int senderId, int recipientId, string content)
        {
            IDataLayer forumConnection = context.ForumConnection;

            DateTime createTime = DateTime.UtcNow;

            if (senderId != recipientId)
            {
                DialogueHlp.InsertMessage(forumConnection, recipientId, senderId, true, content, createTime);
            }
            DialogueHlp.InsertMessage(forumConnection, senderId, recipientId, false, content, createTime);

            if (senderId != recipientId)
            {
                DialogueHlp.UpdateDialog(forumConnection, recipientId, senderId, true, content, createTime);
            }
            DialogueHlp.UpdateDialog(forumConnection, senderId, recipientId, false, content, createTime);

            context.UpdateUnreadDialogs();
        }