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_Red_Diamonds
{
    public partial class listcategory : Form
    {
        public listcategory()
        {
            InitializeComponent();
        }

        DataTable dt1 = new DataTable();
        DataBase db1 = new DataBase();

        private void listcategory_Load(object sender, EventArgs e)
        {
            dt1 = db1.MySelect("select * from category");
            dgv_category_list.DataSource = dt1;
        }

        private void dgv_category_list_MouseDoubleClick(object sender, MouseEventArgs e)
        {
            book book = (book)Application.OpenForms["book"];
            book.GetCategoryName(dgv_category_list.CurrentRow.Cells[1].Value.ToString());
            this.Close();
        }
    }
}
