using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Data.SqlClient;

namespace MyQQ
{
    public partial class BeizhuForm : Form
    {

        public BeizhuForm()
        {
            InitializeComponent();
        }

        DataBase MyDataBase = new DataBase();

        private void btnOk_Click(object sender, EventArgs e)
        {
            //查询好友是否有备注的Sql语句
            string sql = string.Format("update Friends set Friendbeizhu='{0}' where HostId={1} and FriendId={2}", txtBeizhu.Text.ToString(), UserHelper.Loginld,MainForm.selectId);

            try
            {

                int result = MyDataBase.ExecuteSQL(sql);

                if (result > 0)
                {
                    MessageBox.Show("服务器接受了你的请求！", "提示");
                    this.Close();
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
           
        }

        private void btnClose_Click(object sender, EventArgs e)
        {
            //关闭窗体
            this.Close();
        }
    }
}