protected void btnSearch_Click(object sender, EventArgs e)
    {
        clearmsgPanel();
        clearControls();

        if (txtEmpID.Text.Trim() == "")
        {
            lblmsg.Visible = true;
            return;
        }

        //get Employee detail.
        Employee emply = new Employee();
        emply.EmpID = txtEmpID.Text.Trim();
        employeeManager = new EmployeeManager(emply);
        employee = employeeManager.getEmployeeJobTitleAndBranchDetailForDistrict();

        if (employee != null)
        {
            EmpID = employee.EmpID;
            fName = employee.FName;
            mName = employee.MName;
            lName = employee.LName;
            sex = employee.Sex;
            JTitle = employee.JobTitle;
            branch = employee.Branch;
            branchID = employee.BranchID;

            txtEmployeeID.Text = EmpID;
            txtFName.Text = fName;
            txtMName.Text = mName;
            if (sex == "M")
            {
                txtSex.Text = "Male";
            }
            else if (sex == "F")
            {
                txtSex.Text = "Female";
            }
            txtLName.Text = lName;
            txtJTittle.Text = JTitle;
            txtBranch.Text = branch;
            txtDateofEmp.Text = employee.Hdate;
            getUserId = employee.UserName;
            UserDetialPanel.Visible = true;
            empRemarkPanel.Visible = true;

            populateManagerialPosition(branchID);

        }
        else
        {
            msgPanel.Visible = true;
            InfoDIV.Visible = true;
            lblInformationMsg.Text = "There is no Employee with the give ID in your district. please check and try again.";
            UserDetialPanel.Visible = false;
            empRemarkPanel.Visible = false;
        }
    }
    protected void btnSearch_Click(object sender, EventArgs e)
    {

        clearmsgPanel();

        if (txtEmpID.Text.Trim() == "")
        {
            lblmsg.Visible = true;
            return;
        }

        //get Employee detail.
        Employee emply = new Employee();
        emply.EmpID = txtEmpID.Text.Trim();
        employeeManager = new EmployeeManager(emply);
        employee = employeeManager.getEmployeeJobTitleAndBranchDetailForDistrict();

        if (employee != null)
        {
            EmpID = employee.EmpID;
            fName = employee.FName + " " + employee.MName + " " + employee.LName;
            sex = employee.Sex;
            JTitle = employee.JobTitle;
            branch = employee.Branch;

            txtEmployeeID.Text = EmpID;
            txtFName.Text = fName;
            if (sex == "M")
            {
                txtSex.Text = "Male";
            }
            else if (sex == "F")
            {
                txtSex.Text = "Female";
            }

            txtJTittle.Text = JTitle;
            txtBranch.Text = branch;
            txtDateofEmp.Text = employee.Hdate;
            UserDetialPanel.Visible = true;

            if (AddRB.SelectedValue == "AddOff")
            {
                AddClerkPanel.Visible = false;
                AddOfficerPanel.Visible = true;
            }
            else if (AddRB.SelectedValue == "AddClerk")
            {
                AddOfficerPanel.Visible = false;
                AddClerkPanel.Visible = true;
            }

        }
        else
        {
            msgPanel.Visible = true;
            InfoDIV.Visible = true;
            lblInformationMsg.Text = "There is no Employee with the give ID in your district. please check and try again.";
            UserDetialPanel.Visible = false;
            AddOfficerPanel.Visible = false;
            AddClerkPanel.Visible = false;
        }
    }