private void ExecuteSearch(bool button)
        {
            Utilities.DataIO data = new Profiles.Edit.Utilities.DataIO();

            if (drpDepartment.SelectedItem.Text != "--Select--")
            {
                this.Department = drpDepartment.SelectedItem.Value;
            }
            else
            {
                this.Department = string.Empty;
            }

            if (drpInstitution.SelectedItem.Text != "--Select--")
            {
                this.Institution = drpInstitution.SelectedItem.Value;
            }
            else
            {
                this.Institution = string.Empty;
            }

            this.Fname = txtFirstName.Text;
            this.Lname = txtLastName.Text;



            if (this.TotalPages == 0)
            {
                MyDataSet          = data.SearchPeople(Lname, Fname, Institution, Department, isManagerPage, 0, 1000000);
                this.TotalRowCount = MyDataSet.Tables[0].Rows.Count;
            }

            gridSearchResults.DataSource = MyDataSet;
            gridSearchResults.DataBind();


            pnlProxySearchResults.Visible = true;
        }
        private void ExecuteSearch(bool button)
        {
            Utilities.DataIO data = new Profiles.Edit.Utilities.DataIO();


            Int32 totalpageremainder = 0;

            if (drpDepartment.SelectedItem.Text != "--Select--")
            {
                this.Department = drpDepartment.SelectedItem.Value;
            }
            else
            {
                this.Department = string.Empty;
            }

            if (drpInstitution.SelectedItem.Text != "--Select--")
            {
                this.Institution = drpInstitution.SelectedItem.Value;
            }
            else
            {
                this.Institution = string.Empty;
            }

            this.Fname = txtFirstName.Text;
            this.Lname = txtLastName.Text;

            if (!button)
            {
                if (Request.QueryString["offset"] != null)
                {
                    this.Offset = Convert.ToInt32(Request.QueryString["offset"]);
                }

                if (Request.QueryString["totalrows"] != null)
                {
                    this.TotalRowCount = Convert.ToInt32(Request.QueryString["totalrows"]);
                }

                if (Request.QueryString["CurrentPage"] != null)
                {
                    this.CurrentPage = Convert.ToInt32(Request.QueryString["CurrentPage"]);
                }

                if (Request.QueryString["TotalPages"] != null)
                {
                    this.TotalPages = Convert.ToInt32(Request.QueryString["TotalPages"]);
                }
            }

            if (this.TotalPages == 0)
            {
                MyDataSet          = data.SearchPeople(Lname, Fname, Institution, Department, 0, 1000000);
                this.TotalRowCount = MyDataSet.Tables[0].Rows.Count;
            }

            if (this.CurrentPage <= 0)
            {
                this.CurrentPage = 1;
            }

            this.TotalPages = Math.DivRem(this.TotalRowCount, 25, out totalpageremainder);

            if (totalpageremainder > 0)
            {
                this.TotalPages = this.TotalPages + 1;
            }

            if (this.CurrentPage > this.TotalPages)
            {
                this.CurrentPage = this.TotalPages;
            }

            this.Offset = ((Convert.ToInt32(this.CurrentPage) * 25) + 1) - 25;

            if (this.Offset < 0)
            {
                this.Offset = 0;
            }


            MyDataSet = data.SearchPeople(Lname, Fname, Institution, Department, this.Offset - 1, 100);

            gridSearchResults.PageIndex  = 0;
            gridSearchResults.DataSource = MyDataSet;
            gridSearchResults.DataBind();

            if (MyDataSet.Tables[0].Rows.Count > 0)
            {
                gridSearchResults.BottomPagerRow.Visible = true;
            }

            pnlProxySearchResults.Visible = true;


            litPagination.Text = "<script type='text/javascript'>" +
                                 "_page = " + this.CurrentPage + ";" +
                                 "_offset = " + this.Offset + ";" +
                                 "_totalrows = " + this.TotalRowCount + ";" +
                                 "_totalpages =" + this.TotalPages + ";" +
                                 "_root = '" + Root.Domain + "';" +
                                 "_subject = '" + Subject + "';" +
                                 "_fname = '" + this.Fname + "';" +
                                 "_lname = '" + this.Lname.Replace("'", "\\'") + "';" +
                                 "_department = '" + this.Department.Replace("'", "\\'") + "';" +
                                 "_institution = '" + this.Institution.Replace("'", "\\'") + "';" +

                                 "</script>";

            //pnlProxySearchResults.Update();
        }