Example #1
0
 public void RemoveFromLoggedInUsers(LoggedInUser user)
 {
     db.LoggedInUsers.DeleteOnSubmit(user);
 }
Example #2
0
 partial void DeleteLoggedInUser(LoggedInUser instance);
Example #3
0
 partial void UpdateLoggedInUser(LoggedInUser instance);
Example #4
0
 partial void InsertLoggedInUser(LoggedInUser instance);
Example #5
0
		private void detach_LoggedInUsers(LoggedInUser entity)
		{
			this.SendPropertyChanging();
			entity.ChatRoom = null;
		}
Example #6
0
        public ActionResult Join(int id)
        {
            ChatRoom room = roomRepository.GetChatRoom(id);

            if (room == null)
                return RedirectToAction("NotFound", "ChatRooms");
            try
            {
                LoggedInUser user = new LoggedInUser();
                user.UserName = User.Identity.Name;
                user.LastMessageTimeStamp = DateTime.Now;
                user.LoginTimeStamp = DateTime.Now;
                room.LoggedInUsers.Add(user);
                roomRepository.Save();

                AddMessage(id, User.Identity.Name, " has joined the chat");

            }
            catch
            {
                RedirectToAction("Error", "ChatRooms");
            }

            return RedirectToAction("Room", "ChatRooms", new { id = room.ChatRoomID });
        }