Example #1
0
 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/>";
     }
 }
Example #2
0
    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";
        }
    }