protected void btnSearch_Click(object sender, EventArgs e)
    {
        try
        {
            if (ddlPageSize.SelectedIndex != 0)
            { gvBookings.AllowPaging = true; gvBookings.PageSize = Convert.ToInt32(ddlPageSize.SelectedItem.Text.ToString()); }
            else
            { gvBookings.AllowPaging = false; }

            if (Session["UserID"] != null)
            {
                ClsBAL objManabusBAL = new ClsBAL();
                if (txtfromdate.Text == "") { objManabusBAL.dateOFJourney = null; }
                else { objManabusBAL.dateOFJourney = Convert.ToDateTime(txtfromdate.Text); }
                if (txttodate.Text == "") { objManabusBAL.dateOFBooking = null; }
                else { objManabusBAL.dateOFBooking = Convert.ToDateTime(txttodate.Text); }
                if (ddlSources.SelectedItem.Text != "ALL") { objManabusBAL.sourceName = ddlSources.SelectedItem.Text; }
                if (ddlDestinations.SelectedItem.Text != "ALL") { objManabusBAL.destinationName = ddlDestinations.SelectedItem.Text; }
                if (txtusername.Text != "") { objManabusBAL.fullName = txtusername.Text; }
                if (txtEmailID.Text != "") { objManabusBAL.emailId = txtEmailID.Text; }
                if (txtManabusRefNo.Text != "") { objManabusBAL.manabusRefNo = txtManabusRefNo.Text; }
                // if (ddlOperator.SelectedItem.Text != "ALL") { objManabusBAL.travelName = ddlOperator.SelectedItem.Text; }
                if (txtContact.Text != "") { objManabusBAL.mobileNo = txtContact.Text; }
                if (ddlStatus.SelectedItem.Text != "ALL") { objManabusBAL.status = ddlStatus.SelectedItem.Text; }

                DataSet ObjDataset = (DataSet)objManabusBAL.SearchAgentBookedTickets(Convert.ToInt32(Session["UserID"].ToString()));
                if (ObjDataset != null)
                {
                    if (ObjDataset.Tables.Count > 0)
                    {
                        if (ObjDataset.Tables[0].Rows.Count > 0)
                        {
                            //ddlPageSize.Enabled = true;
                            //lbtnXport2Xcel.Enabled = true;
                            //ImageButton3.Visible = true;
                        }
                        else
                        {
                            //lbtnXport2Xcel.Enabled = false;
                        }
                        gvBookings.PageSize = Convert.ToInt32(ddlPageSize.SelectedValue);
                        gvBookings.DataSource = ObjDataset.Tables[0];
                        gvBookings.DataBind();
                        if (gvBookings.Rows.Count > 0) { btnExport.Visible = true; } else { btnExport.Visible = false; }
                        ViewState["Data"] = ObjDataset.Tables[0];
                    }
                }
            }
        }
        catch (Exception ex)
        {
            lblMsg.InnerHtml = ex.Message;
            throw;
        }
    }