private void btnadd_Click(object sender, EventArgs e)
        {
            frmaddaccount addaccount = new frmaddaccount("", "", "", "", "add", user);

            addaccount.UpdateEventHandler += F2_UpdateEventHandler1;
            addaccount.Show();
        }
        private void btnedit_Click(object sender, EventArgs e)
        {
            try
            {
                string username, password, usertype, department;
                username   = dataGridView1.Rows[selectedrow].Cells[0].Value.ToString();
                password   = dataGridView1.Rows[selectedrow].Cells[1].Value.ToString();
                usertype   = dataGridView1.Rows[selectedrow].Cells[2].Value.ToString();
                department = dataGridView1.Rows[selectedrow].Cells[3].Value.ToString();
                frmaddaccount edit = new frmaddaccount(username, password, usertype, department, "edit", user);
                edit.UpdateEventHandler += F2_UpdateEventHandler1;
                edit.Text = "Edit Account";
                edit.Show();

                //DataTable dt = Account.GetData("select * from tblaccounts order by username");
                //dataGridView1.DataSource = dt;
                //dataGridView1.Refresh();
                // LoadDataGrid();
            }

            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "error", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
        }