private void dataGridView1_RowHeaderMouseClick(object sender, DataGridViewCellMouseEventArgs e)
        {
            DataGridViewRow dr = dataGridView1.SelectedRows[0];

            this.Hide();
            frmDepartment frm = new frmDepartment();

            // or simply use column name instead of index
            //dr.Cells["id"].Value.ToString();
            frm.Show();
            frm.txtDepartmentID.Text   = dr.Cells[0].Value.ToString();
            frm.txtDepartmentName.Text = dr.Cells[1].Value.ToString();

            if (label1.Text == "Admin")
            {
                frm.btnDelete.Enabled        = true;
                frm.btnUpdate_record.Enabled = true;
                frm.txtDepartmentName.Focus();
                frm.label1.Text     = label1.Text;
                frm.btnSave.Enabled = false;
            }
            else
            {
                frm.btnDelete.Enabled        = false;
                frm.btnUpdate_record.Enabled = false;
                frm.txtDepartmentName.Focus();
                frm.label1.Text     = label1.Text;
                frm.btnSave.Enabled = false;
            }
        }
        private void departmentToolStripMenuItem_Click(object sender, EventArgs e)
        {
            frmDepartment frm = new frmDepartment();

            if (UserType.Text == "Admin")
            {
                frm.label1.Text = UserType.Text;
                frm.Show();
            }
            else
            {
                frm.label1.Text = UserType.Text;
                frm.Show();
            }
        }