protected void btnSubmit_Click(object sender, EventArgs e)
        {
            try
            {
                if (hid.Value == "Update")
                {
                    Directorate mak = null; bool rst = false;
                    mak = DepartmentBLL.GetDirectorate(Convert.ToInt32(txtID.Text));
                    if (mak != null)
                    {
                        mak.Name = txtDept.Text.ToUpper();;
                        rst      = DepartmentBLL.UpdateDir(mak);
                        if (rst != false)
                        {
                            BindGrid();
                            success.Visible   = true;
                            success.InnerHtml = " <button type='button' class='close' data-dismiss='alert'>&times;</button> Record updated successfully!!.";
                            return;
                        }
                    }

                    else
                    {
                        error.Visible   = true;
                        error.InnerHtml = " <button type='button' class='close' data-dismiss='alert'>&times;</button>Record could Not updated. Kindly try again. If error persist contact Administrator!!.";
                    }
                }
                else
                {
                    string mak = "";
                    mak = txtDept.Text;

                    bool        result = false;
                    Directorate dir    = new Directorate();
                    dir.Name = mak.ToUpper();
                    result   = DepartmentBLL.AddDirectorate(dir);
                    if (result)
                    {
                        BindGrid();
                        txtDept.Text = "";

                        success.Visible   = true;
                        success.InnerHtml = " <button type='button' class='close' data-dismiss='alert'>&times;</button> Record added successfully!!.";
                        return;
                    }
                    else
                    {
                        error.Visible   = true;
                        error.InnerHtml = " <button type='button' class='close' data-dismiss='alert'>&times;</button>Record could Not added. Kindly try again. If error persist contact Administrator!!.";
                    }
                }
            }
            catch (Exception ex)
            {
                error.Visible   = true;
                error.InnerHtml = "<button type='button' class='close' data-dismiss='alert'>&times;</button> An error occurred. kindly try again!!!";
                Utility.WriteError("Error: " + ex.Message);
            }
        }