protected void btnChatTodos_Click(object sender, EventArgs e) { lblChat2.Text = ""; ChatNovo chat = new ChatNovo(); List<ChatUsers> lst = chat.Lista(); foreach (ChatUsers element in lst) { lblChat2.Text += " ID: " + element.userId + " NAME: " + element.userName + "<br/>"; } }
private void StatusChat(Usuario usr) { bool conectado = false; ChatNovo chat = new ChatNovo(); List <ChatUsers> lst = chat.Lista(); foreach (ChatUsers element in lst) { if (element.userId == usr.IdUsuario) { conectado = true; } } if (conectado) { imgStatusChat.ImageUrl = "~/img/chatOn.png"; } else { imgStatusChat.ImageUrl = "~/img/chatOff.png"; } }