Пример #1
0
        public ActionResult GetChatRoomMessagesTable()
        {
            int chatRoomId;

            int.TryParse(Request.UrlReferrer.Segments.Last().ToString(), out chatRoomId);

            var messages = ChatRoomConversionHelper.ChatRoomMessagesToViewModel(chatRoomLogic.GetChatRoom(chatRoomId, GetLoginName()).Messages);

            return(PartialView("~/Views/Shared/MessagesTable.cshtml", messages));
        }
Пример #2
0
        [OutputCache(NoStore = true, Duration = 0, VaryByParam = "None")] //by history back dzialalo poprawnie
        public ActionResult Chat(int id)
        {
            var room = chatRoomLogic.GetChatRoom(id, GetLoginName());

            if (room == null)
            {
                return(Redirect("/Home/index"));
            }
            var result = ChatRoomConversionHelper.ChatRoomMessagesToViewModel(room.Messages);

            return(View(result));
        }