/// <summary> /// InitData /// </summary> protected override void InitData() { _data = new PointRepairsTDS(); }
// //////////////////////////////////////////////////////////////////////// // EVENTS // protected void Page_Load(object sender, EventArgs e) { // Register client scripts this.RegisterClientScripts(); if (!IsPostBack) { // Security check if (!(Convert.ToBoolean(Session["sgLFS_CWP_POINTREPAIRS_VIEW"]) && Convert.ToBoolean(Session["sgLFS_CWP_POINTREPAIRS_DELETE"]))) { 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["source_page"] == null) || ((string)Request.QueryString["client_id"] == null) || ((string)Request.QueryString["project_id"] == null) || ((string)Request.QueryString["asset_id"] == null)) { Response.Redirect("./../../error_page.aspx?error=" + "Invalid query string in pr_delete.aspx"); } // Tag Page TagPage(); // Prepare initial data // ... for client int companyId = Int32.Parse(hdfCompanyId.Value); int currentClientId = Int32.Parse(hdfCurrentClientId.Value.ToString()); CompaniesGateway companiesGateway = new CompaniesGateway(); companiesGateway.LoadByCompaniesId(currentClientId, companyId); lblTitleClientName.Text = "Client: " + companiesGateway.GetName(currentClientId); // ... for project int currentProjectId = Int32.Parse(hdfCurrentProjectId.Value.ToString()); ProjectGateway projectGateway = new ProjectGateway(); projectGateway.LoadByProjectId(currentProjectId); string name = projectGateway.GetName(currentProjectId); if (name.Length > 23) name = name.Substring(0, 20) + "..."; lblTitleProjectName.Text = " > Project: " + name + " (" + projectGateway.GetProjectNumber(currentProjectId) + ") > Selected Section"; // If coming from // ... pr_navigator2.aspx if (Request.QueryString["source_page"] == "pr_navigator2.aspx") { StoreNavigatorState(); ViewState["update"] = "no"; pointRepairsTDS = new PointRepairsTDS(); int workId = Int32.Parse(hdfWorkId.Value); int assetId = Int32.Parse(hdfAssetId.Value); PointRepairsSectionDetails pointRepairsSectionDetails = new PointRepairsSectionDetails(pointRepairsTDS); pointRepairsSectionDetails.LoadByWorkId(workId, companyId); PointRepairsWorkDetails pointRepairsWorkDetails = new PointRepairsWorkDetails(pointRepairsTDS); pointRepairsWorkDetails.LoadByWorkIdAssetId(workId, assetId, companyId); PointRepairsRepairDetails pointRepairsRepairDetails = new PointRepairsRepairDetails(pointRepairsTDS); pointRepairsRepairDetails.LoadAllByWorkId(workId, companyId); // Store dataset Session["pointRepairsTDS"] = pointRepairsTDS; } // ... pr_summary.aspx if (Request.QueryString["source_page"] == "pr_summary.aspx") { StoreNavigatorState(); ViewState["update"] = Request.QueryString["update"]; // Restore dataset pointRepairsTDS = (PointRepairsTDS)Session["pointRepairsTDS"]; } } else { // Restore datasets pointRepairsTDS = (PointRepairsTDS)Session["pointRepairsTDS"]; } }
// //////////////////////////////////////////////////////////////////////// // EVENTS // protected void Page_Load(object sender, EventArgs e) { // Register client scripts this.RegisterClientScripts(); if (!IsPostBack) { // Security check if (!(Convert.ToBoolean(Session["sgLFS_CWP_POINTREPAIRS_VIEW"]) && Convert.ToBoolean(Session["sgLFS_CWP_POINTREPAIRS_EDIT"]))) { 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["source_page"] == null) || ((string)Request.QueryString["client_id"] == null) || ((string)Request.QueryString["project_id"] == null) || ((string)Request.QueryString["asset_id"] == null) || ((string)Request.QueryString["active_tab"] == null)) { Response.Redirect("./../../error_page.aspx?error=" + "Invalid query string in pr_summary.aspx"); } // Tag Page TagPage(); // If coming from int companyId = Int32.Parse(hdfCompanyId.Value.Trim()); int currentProjectId = Int32.Parse(hdfCurrentProjectId.Value.ToString()); int assetId = Int32.Parse(hdfAssetId.Value.Trim()); int workId = Int32.Parse(hdfWorkId.Value); Session.Remove("pointRepairsRepairsTempDummy"); Session.Remove("pointRepairsCommentsTempDummy"); // ... pr_navigator2.aspx if (Request.QueryString["source_page"] == "pr_navigator2.aspx") { StoreNavigatorState(); ViewState["update"] = "no"; // ... Set initial tab if ((string)Session["dialogOpenedPr"] != "1") { hdfActiveTab.Value = Request.QueryString["active_tab"]; pointRepairsTDS = new PointRepairsTDS(); pointRepairsRepairsTemp = new PointRepairsTDS.RepairDetailsDataTable(); pointRepairsCommentsTemp = new PointRepairsTDS.CommentDetailsDataTable(); PointRepairsSectionDetails pointRepairsSectionDetails = new PointRepairsSectionDetails(pointRepairsTDS); pointRepairsSectionDetails.LoadByWorkId(workId, companyId); PointRepairsWorkDetails pointRepairsWorkDetails = new PointRepairsWorkDetails(pointRepairsTDS); pointRepairsWorkDetails.LoadByWorkIdAssetId(workId, assetId, companyId); PointRepairsRepairDetails pointRepairsRepairDetails = new PointRepairsRepairDetails(pointRepairsTDS); pointRepairsRepairDetails.LoadAllByWorkId(workId, companyId); PointRepairsCommentDetails pointRepairsCommentDetails = new PointRepairsCommentDetails(pointRepairsTDS); pointRepairsCommentDetails.LoadAllByWorkIdWorkType(workId, companyId, "Point Repairs"); } else { hdfActiveTab.Value = (string)Session["activeTabPr"]; // Restore datasets pointRepairsTDS = (PointRepairsTDS)Session["pointRepairsTDS"]; pointRepairsRepairsTemp = (PointRepairsTDS.RepairDetailsDataTable)Session["pointRepairsRepairsTemp"]; pointRepairsCommentsTemp = (PointRepairsTDS.CommentDetailsDataTable)Session["pointRepairsCommentsTemp"]; } tcPrDetails.ActiveTabIndex = Int32.Parse(hdfActiveTab.Value); Session["filterExpression"] = "Deleted = 0"; // Store dataset Session["pointRepairsTDS"] = pointRepairsTDS; Session["pointRepairsRepairsTemp"] = pointRepairsRepairsTemp; Session["pointRepairsCommentsTemp"] = pointRepairsCommentsTemp; } // ... pr_delete.aspx or pr_edit.aspx if ((Request.QueryString["source_page"] == "pr_delete.aspx") || (Request.QueryString["source_page"] == "pr_edit.aspx")) { StoreNavigatorState(); ViewState["update"] = Request.QueryString["update"]; // Restore dataset pointRepairsTDS = (PointRepairsTDS)Session["pointRepairsTDS"]; pointRepairsRepairsTemp = (PointRepairsTDS.RepairDetailsDataTable)Session["pointRepairsRepairsTemp"]; pointRepairsCommentsTemp = (PointRepairsTDS.CommentDetailsDataTable)Session["pointRepairsCommentsTemp"]; // ... Set initial tab if ((string)Session["dialogOpenedPr"] != "1") { hdfActiveTab.Value = Request.QueryString["active_tab"]; } else { hdfActiveTab.Value = (string)Session["activeTabPr"]; } tcPrDetails.ActiveTabIndex = Int32.Parse(hdfActiveTab.Value); ApplyFilter(); switch ((string)Session["filterExpression"]) { case "Deleted = 0": ddlFilter.SelectedIndex = 0; break; case "Type='Robotic Reaming' AND Deleted = 0": ddlFilter.SelectedIndex = 1; break; case "Type='Point Lining' AND Deleted = 0": ddlFilter.SelectedIndex = 2; break; case "Type='Grouting' AND Deleted = 0": ddlFilter.SelectedIndex = 3; break; default: ddlFilter.SelectedIndex = 0; break; } } // Prepare initial data // ... for client int currentClientId = Int32.Parse(hdfCurrentClientId.Value.ToString()); CompaniesGateway companiesGateway = new CompaniesGateway(); companiesGateway.LoadByCompaniesId(currentClientId, companyId); lblTitleClientName.Text = "Client: " + companiesGateway.GetName(currentClientId); // ... for project ProjectGateway projectGateway = new ProjectGateway(); projectGateway.LoadByProjectId(currentProjectId); string name = projectGateway.GetName(currentProjectId); if (name.Length > 23) name = name.Substring(0, 20) + "..."; lblTitleProjectName.Text = " > Project: " + name + " (" + projectGateway.GetProjectNumber(currentProjectId) + ") > Selected Section"; // ... Data for current point repairs work LoadPointRepairsData(currentProjectId, assetId, companyId); } else { // Restore datasets pointRepairsTDS = (PointRepairsTDS)Session["pointRepairsTDS"]; pointRepairsRepairsTemp = (PointRepairsTDS.RepairDetailsDataTable)Session["pointRepairsRepairsTemp"]; pointRepairsCommentsTemp = (PointRepairsTDS.CommentDetailsDataTable)Session["pointRepairsCommentsTemp"]; // Set initial tab int activeTab = Int32.Parse(hdfActiveTab.Value); tcPrDetails.ActiveTabIndex = activeTab; ApplyFilter(); } }
// //////////////////////////////////////////////////////////////////////// // EVENTS // protected void Page_Load(object sender, EventArgs e) { // Register client scripts this.RegisterClientScripts(); if (!IsPostBack) { // Security check if (!(Convert.ToBoolean(Session["sgLFS_CWP_POINTREPAIRS_VIEW"]) && Convert.ToBoolean(Session["sgLFS_CWP_POINTREPAIRS_EDIT"]))) { 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["source_page"] == null) || ((string)Request.QueryString["repair_point_id"] == null) || ((string)Request.QueryString["work_id"] == null)) { Response.Redirect("./../../error_page.aspx?error=" + "Invalid query string in pr_size.aspx"); } // Tag Page hdfCompanyId.Value = Session["companyID"].ToString(); hdfRepairPointId.Value = Convert.ToString(Request.QueryString["repair_point_id"]); hdfWorkId.Value = Convert.ToString(Request.QueryString["work_id"]); hdfUpdate.Value = "yes"; Session.Remove("sizeInformationNewDummy"); Session.Remove("sizeInformation"); // If comming from // ... pr_edit.aspx if (Request.QueryString["source_page"] == "pr_edit.aspx") { StoreNavigatorState(); ViewState["update"] = Request.QueryString["update"]; // ... Load size to edit pointRepairsTDS = (PointRepairsTDS)Session["pointRepairsTDS"]; sizeInformationTDS = new SizeInformationTDS(); SizeInformationGateway sizeInformationGateway = new SizeInformationGateway(sizeInformationTDS); sizeInformationGateway.Load(Int32.Parse(hdfCompanyId.Value.Trim())); // ... Store datasets Session["sizeInformationTDS"] = sizeInformationTDS; Session["sizeInformation"] = sizeInformationTDS.SizeInformation; } } else { // Restore datasets pointRepairsTDS = (PointRepairsTDS)Session["pointRepairsTDS"]; sizeInformationTDS = (SizeInformationTDS)Session["sizeInformationTDS"]; sizeInformation = sizeInformationTDS.SizeInformation; } }