protected void Page_Load(object sender, EventArgs e) { if (!string.IsNullOrEmpty(Request.QueryString["tableName"]) && !string.IsNullOrEmpty(Request.QueryString["priKey"]) && !string.IsNullOrEmpty(Request.QueryString["projectId"])) { string tableName = Request.QueryString["tableName"]; int priKey = int.Parse(Request.QueryString["priKey"]); projectId = int.Parse(Request.QueryString["projectId"]); string color = Request.QueryString["color"]; // Determine if child gant charts are loaded from parent page function if (!string.IsNullOrEmpty(Request.QueryString["loadFromParent"])) { loadFromParent = Request.QueryString["loadFromParent"]; DynamicGantChart.MarkerCount = 18; } // Determine if a color is used for gant coloring // Else the color box needs to be supressed if (!string.IsNullOrEmpty(color)) { DynamicGantChart.StaticColor = color; GantColorBox.Style["background-color"] = color; } else { GantColorBoxColumn.Visible = false; } // Determine what type of chart needs to be built if (tableName.Equals("Project")) { ProjectMgmtUtil.BuildAdminLevelGantChart(DynamicGantChart, projectId); GantTitle.Text = DynamicGantChart.GantTitle; } else if (tableName.Equals("ProjectOrganization")) { ProjectMgmtUtil.BuildOrganizationLevelGantChart(DynamicGantChart, projectId, priKey); GantTitle.Text = DynamicGantChart.GantTitle; } else if (tableName.Equals("ProjectStage")) { ProjectMgmtUtil.BuildStageLevelGantChart(DynamicGantChart, priKey); GantTitle.Text = DynamicGantChart.GantTitle; } } }
/// <summary> /// Builds checkbox matrix to allow selecting organizations and stages /// </summary> private void BuildCheckBoxMatrix() { LookupCodeDa lookupDa = new LookupCodeDa(); // Set Global Organization List (controls columns) organizationListDataView = da.GetAllOrganizationsByProjectId(projectId).DefaultView; allProjectStageEvents = da.GetStageEventsByProject(projectId).DefaultView; // Determine if we need to filter organization if (!string.IsNullOrEmpty(OrganizationId)) { organizationListDataView.RowFilter = ProjectOrganization.OrganizationId + " = " + OrganizationId; } // Gets all Stage names based on Lookup Codes DataTable stagesLkpCodes = lookupDa.GetLookupsByFieldName("ProjectStages").Tables[0]; // Bind Organization Header Items OrgListRptr.DataSource = organizationListDataView; OrgListRptr.DataBind(); // Bind Stages //ProjectStage projectStages = new ProjectStage(); //projectStages.GetByParent(projectId); //orgStageRecords = projectStages.DataSourceView; orgStageRecords = BusinessObject.GetByParentAsDataView <ProjectStage>(projectId); if (orgStageRecords.Count == 0) { ProjectMgmtUtil.CreateProjectChildRecords(projectId); //projectStages.GetByParent(projectId); //orgStageRecords = projectStages.DataSourceView; orgStageRecords = BusinessObject.GetByParentAsDataView <ProjectStage>(projectId); } orgStageRecords.RowFilter = ProjectStage.OrganizationId + " IS NULL"; //StagesRptr.DataSource = stagesLkpCodes; StagesRptr.DataSource = orgStageRecords; StagesRptr.DataBind(); }
protected override void Page_Load(object sender, EventArgs e) { if (string.IsNullOrEmpty(ProjectId)) { Response.End(); } else { projectId = int.Parse(ProjectId); } if (!Page.IsPostBack) { //ProjectStage stages = new ProjectStage(); //stages.GetByParent(projectId); //if (stages.RecordCount == 0) if (BusinessObject.GetByParent <ProjectStage>(projectId).Count() == 0) { ProjectMgmtUtil.CreateProjectChildRecords(projectId); } BuildCheckBoxMatrix(); } SetContentVisibility(); }