Esempio n. 1
0
 public void RemoveFromLoggedInUsers(LoggedInUser user)
 {
     db.LoggedInUsers.DeleteOnSubmit(user);
 }
Esempio n. 2
0
 partial void DeleteLoggedInUser(LoggedInUser instance);
Esempio n. 3
0
 partial void UpdateLoggedInUser(LoggedInUser instance);
Esempio n. 4
0
 partial void InsertLoggedInUser(LoggedInUser instance);
Esempio n. 5
0
		private void detach_LoggedInUsers(LoggedInUser entity)
		{
			this.SendPropertyChanging();
			entity.ChatRoom = null;
		}
Esempio n. 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 });
        }