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 FormCategory_Edit : Form
    {
        public FormCategory_Edit()
        {
            InitializeComponent();
        }

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

        private void btnok_Click(object sender, EventArgs e)
        {
            DataAccess da = new DataAccess();
            da.Connect();
            string sql = "update category set catname=N'{0}' where catid={1}";
            sql = string.Format(sql,txtname.Text,txtid.Text);
            da.DoCommand(sql);
            da.DisConnect();
            this.Close();
        }
    }
}
