示例#1
0
 private void btnDBUsers_Click(object sender, EventArgs e)
 {
     ChatUser[] dbusers = ChatDAL.GetUsersList();
     if (dbusers == null || dbusers.Length == 0)
     {
         lstStatus.Items.Add("no users in db");
         return;
     }
     for (int i = 0; i < dbusers.Length; i++)
     {
         lstStatus.Items.Add(dbusers[i].UserAd + " - " + dbusers[i].UserHeb);
     }
 }
示例#2
0
        public ChatUser[] GetConnectedUsersList(string asking_clientADName)
        {
            ChatUser[] users = ChatDAL.GetUsersList();
            //List<ChatUser> connectedChatUsers = new List<ChatUser>();
            string[] namesWithMsgs = ChatDAL.UsersADNamesThatHasUnreadMessagesForMe(asking_clientADName);

            foreach (ChatUser u in users)
            {
                /*if (myClients.ContainsKey(u.UserAd))
                 * {
                 *  connectedChatUsers.Add(u);
                 * }*/
                u.IsConnected      = myClients.ContainsKey(u.UserAd);
                u.HasMessageForYou = namesWithMsgs.Contains(u.UserAd);
            }
            ;
            //return connectedChatUsers.ToArray();
            return(users);
        }