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

namespace Library
{
    public partial class FormMember_Edit : Form
    {
        public string pic;
        public FormMember_Edit()
        {
            InitializeComponent();
        }

        private void button2_Click(object sender, EventArgs e)
        {
            this.Close();
        }

        private void btnok_Click(object sender, EventArgs e)
        {
            DataAccess da = new DataAccess();
            da.Connect();
            string sql = @"update member set mname=N'{0}',mfamily=N'{1}',mtell=N'{2}',
                        maddress=N'{3}',mpass='{4}',mpic='{5}' where muser={6} and mid={7}";
            sql = string.Format(sql,txtname.Text,txtfamily.Text,txttell.Text,
                                txtaddress.Text,txtpass.Text,this.pic,txtuser.Text,txtmid.Text);
            da.DoCommand(sql);
            da.DisConnect();
            this.Close();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            openFileDialog1.ShowDialog();
            this.pic = openFileDialog1.FileName;
            pictureBox1.Load(this.pic);
        }
    }
}
