/// <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(); }