Ejemplo n.º 1
0
 public ActionResult AddNewMessage(UserChatPage CurrentUserPage)
 {
     AccessorToApplicationForChat CurrentAccessorToApplicationForChat = new AccessorToApplicationForChat();
     CurrentAccessorToApplicationForChat.AddNewMessageToChat(CurrentUserPage.UserMessage, CurrentUserPage.UserName);
     CurrentUserPage.LastMessages = CurrentAccessorToApplicationForChat.GetMessages();
     AccessorToUserSession CurrentAccessorToUserSession = new AccessorToUserSession(Session);
     CurrentAccessorToUserSession.AddNewMessage(CurrentUserPage.UserMessage, CurrentUserPage.UserName);
     ModelState.Clear();
     return View("Index", CurrentUserPage);
 }
Ejemplo n.º 2
0
 public ActionResult RefreshMessagesOnUserPage(UserChatPage CurrentUserPage)
 {
     if (CurrentUserPage.ReceiveOnlyMessagesCreatedByCurrentUser)
     {
         AccessorToUserSession CurrentAccessorToUserSession = new AccessorToUserSession(Session);
         CurrentUserPage.LastMessages = CurrentAccessorToUserSession.GetMessages();
     }
     else
     {
         AccessorToApplicationForChat CurrentAccessorToApplicationForChat = new AccessorToApplicationForChat();
         CurrentUserPage.LastMessages = CurrentAccessorToApplicationForChat.GetMessages();
     }
     ModelState.Clear();
     return View("Index", CurrentUserPage);
 }