// ////////////////////////////////////////////////////////////////////////
        // AUXILIAR EVENTS
        //
        protected void ddlClient_SelectedIndexChanged(object sender, EventArgs e)
        {
            ProjectList projectList = new ProjectList();
            projectList.LoadProjectsAndAddItem(-1, "(All)", int.Parse(ddlClient.SelectedValue));
            ddlProject.DataSource = projectList.Table;
            ddlProject.DataValueField = "ProjectID";
            ddlProject.DataTextField = "Name";
            ddlProject.DataBind();
            ddlProject.SelectedIndex = 0;

            AssetSewerMHList assetSewerMHList = new AssetSewerMHList();
            assetSewerMHList.LoadAndAddItem(0, "-1", "", Int32.Parse(hdfCompanyId.Value));
            cbxlMhId.DataSource = assetSewerMHList.Table;
            cbxlMhId.DataValueField = "AssetID";
            cbxlMhId.DataTextField = "MHID";
            cbxlMhId.DataBind();

            if (cbxlMhId.Items.Count > 1)
            {
                foreach (ListItem lst in cbxlMhId.Items)
                {
                    lst.Selected = true;
                }
            }

            upnlMhId.Update();
        }
        // ////////////////////////////////////////////////////////////////////////
        // EVENTS
        //
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                // Access to this page
                if (!Convert.ToBoolean(Session["sgLFS_CWP_MANHOLEREHABILITATION_VIEW"]))
                {
                    Response.Redirect("./../../error_page.aspx?error=" + "You are not authorized to view this page. Contact your system administrator.");
                }

                // Validate query string
                if (((string)Request.QueryString["client_id"] == null) || ((string)Request.QueryString["project_id"] == null) || ((string)Request.QueryString["work_type"] == null))
                {
                    Response.Redirect("./../../error_page.aspx?error=" + "Invalid query string in mr_summary_report.aspx");
                }

                // Prepare initial data
                hdfCompanyId.Value = Session["companyID"].ToString();
                hdfCurrentClientId.Value = Request.QueryString["client_id"].ToString();
                hdfCurrentProjectId.Value = Request.QueryString["project_id"].ToString();
                hdfWorkType.Value = Request.QueryString["work_type"].ToString();

                int companyId = Int32.Parse(hdfCompanyId.Value);
                CompaniesList companiesList = new CompaniesList();
                companiesList.LoadAndAddItem(-1, "(All)", companyId);
                ddlClient.DataSource = companiesList.Table;
                ddlClient.DataValueField = "COMPANIES_ID";
                ddlClient.DataTextField = "Name";
                ddlClient.DataBind();

                if (Request.QueryString["client_id"] != null)
                {
                    ddlClient.SelectedValue = Request.QueryString["client_id"];

                    // ... for project
                    ProjectList projectList = new ProjectList();
                    projectList.LoadProjectsAndAddItem(-1, "(All)", int.Parse(ddlClient.SelectedValue));
                    ddlProject.DataSource = projectList.Table;
                    ddlProject.DataValueField = "ProjectID";
                    ddlProject.DataTextField = "Name";
                    ddlProject.DataBind();
                    ddlProject.SelectedValue = Request.QueryString["project_id"];
                }
                else
                {
                    ddlClient.SelectedValue = "-1";

                    // ... for project
                    ProjectList projectList = new ProjectList();
                    projectList.LoadProjectsAndAddItem(-1, "(All)", -1);
                    ddlProject.DataSource = projectList.Table;
                    ddlProject.DataValueField = "ProjectID";
                    ddlProject.DataTextField = "Name";
                    ddlProject.DataBind();
                    ddlProject.SelectedValue = Request.QueryString["project_id"];
                }

                //  Select mhsId
                AssetSewerMHList ssetSewerMHList = new AssetSewerMHList();
                ssetSewerMHList.LoadAndAddItem(Int32.Parse(hdfCurrentProjectId.Value), "-1", "(All)", Int32.Parse(hdfCompanyId.Value));
                cbxlMhId.DataSource = ssetSewerMHList.Table;
                cbxlMhId.DataValueField = "AssetID";
                cbxlMhId.DataTextField = "MHID";
                cbxlMhId.DataBind();

                cbxMhId.Checked = true;

                // ... ... if comming from lm
                if (Request.QueryString["source_page"].ToString() == "lm")
                {
                    if (Session["mhIdSelected"] != null)
                    {

                        ArrayList mhIdSelected = (ArrayList)Session["mhIdSelected"];
                        foreach (string mhId in mhIdSelected)
                        {
                            cbxlMhId.Items.FindByValue(mhId).Selected = true;
                        }
                    }
                    else
                    {
                        foreach (ListItem lst in cbxlMhId.Items)
                        {
                            lst.Selected = true;
                        }
                    }
                }
                else
                {
                    // ... ... if comming from mr_edit
                    string mhId = Request.QueryString["asset_id"].ToString();
                    cbxlMhId.Items.FindByValue(mhId).Selected = true;
                }

                // Remove session for free resources
                Session.Remove("mhIdSelected");

                // Register delegates
                this.RegisterDelegates();
            }
            else
            {
                // Register delegates
                this.RegisterDelegates();
            }
        }