public static LoggedInUseId CreateLoggedInUseId(string loggedInUserId) { LoggedInUseId loggedInUseId = new LoggedInUseId(); loggedInUseId.LoggedInUserId = loggedInUserId; return(loggedInUseId); }
public void AddToLoggedInUseIds(LoggedInUseId loggedInUseId) { base.AddObject("LoggedInUseIds", loggedInUseId); }
public static LoggedInUseId CreateLoggedInUseId(string loggedInUserId) { LoggedInUseId loggedInUseId = new LoggedInUseId(); loggedInUseId.LoggedInUserId = loggedInUserId; return loggedInUseId; }
private void GetLoggenInUser() { try { string chatUserID = Session["ChatUserID"].ToString(); ChatAppDemoEntities dbChatAppDemoEntities = new ChatAppDemoEntities(); var gg = lblRoomID.Text; var user = (from u in dbChatAppDemoEntities.LoggedInUseIds where u.UserId == chatUserID && u.RoomId == lblRoomID.Text select u).First(); if (user == null) { LoggedInUseId LoggedInUseIds = new LoggedInUseId(); LoggedInUseIds.UserId = Session["ChatUserID"].ToString(); LoggedInUseIds.RoomId = lblRoomID.Text; LoggedInUseIds.LoggedInUserId = Session["ChatUserID"].ToString(); dbChatAppDemoEntities.AddToLoggedInUseIds(LoggedInUseIds); dbChatAppDemoEntities.SaveChanges(); } StringBuilder sb = new StringBuilder(); var loggedInUsers = from logInUser in dbChatAppDemoEntities.LoggedInUseIds where logInUser.RoomId == lblRoomID.Text select logInUser; int check = 0; foreach (var loggedInUser in loggedInUsers) { //sb.Append("<a href='#'>" + loggedInUser.UserId + "</a><br>"); for (int i = 0; i < litUsers.Items.Count; i++) { if (litUsers.Items[i].ToString() == loggedInUser.UserId) { check = 1; } } if (check == 0) { litUsers.Items.Add(loggedInUser.UserId); } } //litUsers.Items.Add(sb.ToString()); } catch (Exception ex) { Console.WriteLine(ex); } }
public void AddToLoggedInUseIds(LoggedInUseId loggedInUseId) { base.AddObject("LoggedInUseIds", loggedInUseId); }