示例#1
0
        public ActionResult OwlReply(Conversation_VM viewModel)
        {
            viewModel.Conversation = Lib.DatabaseManager.OwlManager.Current.GetConversation(viewModel.Conversation.Id);

            if (!string.IsNullOrWhiteSpace(viewModel.ReplyContent))
            {
                Owl owl = new Owl();
                owl.OwlConversationId = viewModel.Conversation.Id;
                owl.UserId            = int.Parse(User.Identity.Name);
                owl.Content           = viewModel.ReplyContent.Replace(System.Environment.NewLine, "<br>");
                Lib.DatabaseManager.OwlManager.Current.CreateOwl(owl, viewModel.Conversation);
                viewModel.ReplyContent = "";
            }

            return(PartialView("_OwlConversation", viewModel));
        }
示例#2
0
        public ActionResult OpenConversation(int conversationId)
        {
            int userId = int.Parse(User.Identity.Name);

            OwlConversation conversation = Lib.DatabaseManager.OwlManager.Current.GetConversation(conversationId);

            Conversation_VM viewModel = new Conversation_VM();

            viewModel.Conversation = conversation;

            // Mark conversation as read!
            Lib.DatabaseManager.OwlManager.Current.MarkAsRead(conversationId, userId);

            ViewData["OwlsCount"] = Lib.DatabaseManager.OwlManager.Current.MustReadCount(userId);

            return(PartialView("_OwlConversation", viewModel));
        }