Exemplo n.º 1
0
        private void Timer_CheckMsg_Tick(object sender, EventArgs e)
        {
            string        sql     = "select DISTINCT send_From from msg where send_To='" + this.account + "' and state='1';";
            SqlDataReader sqlData = DBHelper.GetDataReader(sql);

            sql = "UPDATE msg SET state='0' WHERE send_To='" + this.account + "';";
            DBHelper.GetExcuteNonQuery(sql);
            if (sqlData.HasRows)
            {
                try
                {
                    while (sqlData.Read())
                    {
                        string       tips   = sqlData["send_From"].ToString() + "发来消息,是否查看?";
                        DialogResult result = MessageBox.Show(tips, "提醒", MessageBoxButtons.YesNo, MessageBoxIcon.Information);
                        if (result == DialogResult.Yes)
                        {
                            FrmChat frmChat = new FrmChat(this.account, sqlData["send_From"].ToString());
                            frmChat.Show();
                        }
                    }
                }
                catch { }
            }
        }
Exemplo n.º 2
0
        private void Chat()
        {
            FrmChat frmChat = new FrmChat(this.account, dgvFriendList.CurrentRow.Cells["账号"].Value.ToString());

            frmChat.Show();
        }