/// <summary>
        /// UpdateFieldsForSections
        /// </summary>
        /// <param name="companyId">companyId</param>
        /// <param name="currentProjectId">currentProjectId</param>
        private void UpdateFieldsForSections(int companyId, int currentProjectId)
        {
            AssetSewerSectionGateway assetSewerFindSectionGateway = new AssetSewerSectionGateway();

            AssetSewerMHGateway assetSewerFindMHGateway = new AssetSewerMHGateway();
            WorkGateway workGateway = new WorkGateway();
            foreach (ProjectSectionsNavigatorTDS.LFS_PROJECT_SECTIONS_NAVIGATORRow row in (ProjectSectionsNavigatorTDS.LFS_PROJECT_SECTIONS_NAVIGATORDataTable)Table)
            {
                //General data for asset
                assetSewerFindSectionGateway.LoadByAssetId(row.AssetID, companyId); //COMPANY_ID

                // ... For usmh
                row.USMHDescription = "";
                if (!row.IsUSMHNull())
                {
                    assetSewerFindMHGateway.LoadByAssetId(row.USMH, companyId);
                    row.USMHDescription = assetSewerFindMHGateway.GetMHID(row.USMH);
                }

                // ... For dsmh
                row.DSMHDescription = "";
                if (!row.IsDSMHNull())
                {
                    assetSewerFindMHGateway.LoadByAssetId(row.DSMH, companyId);
                    row.DSMHDescription = assetSewerFindMHGateway.GetMHID(row.DSMH);
                }

                // ... For Works
                row.RehabAssessment = workGateway.ExistsProjectIdAssetIdWorkTypeCompanyId(row.AssetID, currentProjectId, "Rehab Assessment", companyId);
                row.FullLengthLining = workGateway.ExistsProjectIdAssetIdWorkTypeCompanyId(row.AssetID, currentProjectId, "Full Length Lining", companyId);
                row.JunctionLining = workGateway.ExistsProjectIdAssetIdWorkTypeCompanyId(row.AssetID, currentProjectId, "Junction Lining Section", companyId);

                row.WorksDescription = "";
                if (row.RehabAssessment) row.WorksDescription = row.WorksDescription + "Rehab Assessment";

                if (row.FullLengthLining)
                {
                    if (row.WorksDescription.Trim().Length > 0)
                    {
                        row.WorksDescription = row.WorksDescription + ", Full Length Lining";
                    }
                    else
                    {
                        row.WorksDescription = row.WorksDescription + "Full Length Lining";
                    }
                }
                if (row.JunctionLining)
                {
                    if (row.WorksDescription.Trim().Length > 0)
                    {
                        row.WorksDescription = row.WorksDescription + ", Junction Lining";
                    }
                    else
                    {
                        row.WorksDescription = row.WorksDescription + "Junction Lining";
                    }
                }

                // ... For Laterals
                AssetSewerLateralGateway assetSewerLateralGateway = new AssetSewerLateralGateway();

                assetSewerLateralGateway.LoadBySectionId(row.AssetID, companyId);

                AssetSewerLateral assetSewerLateral = new AssetSewerLateral(assetSewerLateralGateway.Data);
                row.LateralsDescription = assetSewerLateral.GetAllLaterals(row.AssetID, companyId);
            }
        }
        // ////////////////////////////////////////////////////////////////////////
        // EVENTS
        //
        protected void Page_Load(object sender, EventArgs e)
        {
            // Register client scripts
            this.RegisterClientScripts();

            if (!IsPostBack)
            {
                // Security check
                if (!Convert.ToBoolean(Session["sgLFS_PROJECTS_VIEW"]))
                {
                    Response.Redirect("./../../error_page.aspx?error=" + "You are not authorized to view this page. Contact your system administrator.");
                }

                // Validate query string
                if (Request.QueryString["source_page"] == null)
                {
                    Response.Redirect("./../../error_page.aspx?error=" + "Invalid query string in projects2.aspx");
                }

                // Tag page
                hdfCompanyId.Value = Session["companyID"].ToString();
                hdfProjectId.Value = Request.QueryString["project_id"];
                hdfAssetID.Value = Request.QueryString["asset_id"];
                Session.Remove("projectSectionsNavigatorLateralsNewDummy");
                Session.Remove("projectSectionsNavigatorLaterals");

                // Initialize data
                projectTDS = (ProjectTDS)Session["lfsProjectTDS"];
                assetsTDS = new AssetsTDS();
                lfsAssetsTDS = new LfsAssetsTDS();
                workTDS = new WorkTDS();
                projectSectionsNavigatorTDS = new ProjectSectionsNavigatorTDS();

                // Load data
                int companyId = Int32.Parse(hdfCompanyId.Value);
                int assetId = Int32.Parse(hdfAssetID.Value);
                int projectId = Int32.Parse(hdfProjectId.Value);

                AssetSewerSectionGateway assetSewerSectionGateway = new AssetSewerSectionGateway();
                assetSewerSectionGateway.LoadByAssetId(assetId, companyId);

                if (assetSewerSectionGateway.Table.Rows.Count > 0)
                {
                    tbxSectionId.Text = assetSewerSectionGateway.GetFlowOrderID(assetId);
                    tbxStreet.Text = assetSewerSectionGateway.GetStreet(assetId);

                    // ... For usmh
                    if (assetSewerSectionGateway.GetUSMH(assetId).HasValue)
                    {
                        AssetSewerMHGateway assetSewerFindMHGateway = new AssetSewerMHGateway();
                        int USMH = (int)assetSewerSectionGateway.GetUSMH(assetId);

                        assetSewerFindMHGateway.LoadByAssetId(USMH, companyId);
                        tbxUSMH.Text = assetSewerFindMHGateway.GetMHID(USMH);
                    }

                    // ... For usmh
                    if (assetSewerSectionGateway.GetDSMH(assetId).HasValue)
                    {
                        AssetSewerMHGateway assetSewerFindMHGateway = new AssetSewerMHGateway();
                        int DSMH = (int)assetSewerSectionGateway.GetDSMH(assetId);

                        assetSewerFindMHGateway.LoadByAssetId(DSMH, companyId);
                        tbxDSMH.Text = assetSewerFindMHGateway.GetMHID(DSMH);
                    }

                    // ... For Works
                    WorkGateway workGateway = new WorkGateway();
                    if (workGateway.ExistsProjectIdAssetIdWorkTypeCompanyId(assetId, projectId, "Rehab Assessment", companyId))
                        ckbxRehabAssessment.Checked = true;
                    if (workGateway.ExistsProjectIdAssetIdWorkTypeCompanyId(assetId, projectId, "Full Length Lining", companyId))
                        ckbxFullLengthLining.Checked = true;
                    if (workGateway.ExistsProjectIdAssetIdWorkTypeCompanyId(assetId, projectId, "Junction Lining Section", companyId))
                        ckbxJunctionLining.Checked = true;

                    // ... For Laterals
                    if (assetSewerSectionGateway.GetLaterals(int.Parse(hdfAssetID.Value)).HasValue)
                    {
                        tbxTotalLaterals.Text = ((int)assetSewerSectionGateway.GetLaterals(assetId)).ToString();
                    }
                    else
                    {
                        tbxTotalLaterals.Text = "0";
                    }

                    ProjectSectionsNavigatorLateralsGateway projectSectionsNavigatorLateralsGateway = new ProjectSectionsNavigatorLateralsGateway(projectSectionsNavigatorTDS);
                    projectSectionsNavigatorLateralsGateway.LoadBySection_ProjectId(assetId, projectId, companyId);

                    AssetSewerLateralGateway assetSewerLateralGateway = new AssetSewerLateralGateway(assetsTDS);
                    assetSewerLateralGateway.LoadBySectionProjectId(assetId, projectId, companyId);

                    // ... store datasets
                    Session["projectSectionsNavigatorTDS"] = projectSectionsNavigatorTDS;
                    projectSectionsNavigatorLaterals = projectSectionsNavigatorTDS.ProjectSectionNavigatorLaterals;
                    Session["projectSectionsNavigatorLaterals"] = projectSectionsNavigatorLaterals;
                }
            }
            else
            {
                // Restore dataset
                projectTDS = (ProjectTDS)Session["lfsProjectTDS"];
                projectSectionsNavigatorTDS = (ProjectSectionsNavigatorTDS)Session["lfsProjectSectionsNavigatorTDS"];
                projectSectionsNavigatorLaterals = (ProjectSectionsNavigatorTDS.ProjectSectionNavigatorLateralsDataTable)Session["projectSectionsNavigatorLaterals"];
                assetsTDS = (AssetsTDS)Session["assetsTDS"];
                lfsAssetsTDS = (LfsAssetsTDS)Session["lfsAssetsTDS"];
                workTDS = (WorkTDS)Session["workTDS"];
            }
        }