Esempio n. 1
0
        private void BindListingsInfo()
        {
            BPCompetencies bp = new BPCompetencies();
            BECompetencies ds = null;

            ds = bp.SelectActiveFRByCompetencyAreaID(CompetencyAreaID);

            ds.tbl_Competencies.DefaultView.Sort = ds.tbl_Competencies.CompetencyOrderColumn.ColumnName;

            rptCompetencies.DataSource = ds.tbl_Competencies.DefaultView;
            rptCompetencies.DataBind();

            plcCompetencies.Visible = (rptCompetencies.Items.Count > 0);
        }
Esempio n. 2
0
        private void BindCompetencyInfo()
        {
            BPCompetencies bp = new BPCompetencies();
            BECompetencies ds = bp.SelectByIDWithROColumns(CompetencyID);

            if (ds.tbl_Competencies.Count > 0)
            {
                BECompetencies.tbl_CompetenciesRow row = ds.tbl_Competencies[0];

                if (!row.CompetencyActive)
                    Redirect();
                else
                {
                    if (!row.IsDisciplineLevelTitleNull() && !row.IsDisciplineLevelIDNull())
                    {
                        lnkGrandParentCrumb.NavigateUrl = "DisciplineLevel.aspx?DisciplineLevelID=" + row.DisciplineLevelID;
                        lnkGrandParentCrumb.Text = row.DisciplineLevelTitle;
                    }

                    if (!row.IsCompetencyAreaTitleNull())
                    {
                        lnkParentCrumb.NavigateUrl = "CompetencyArea.aspx?CompetencyAreaID=" + row.CompetencyAreaID;
                        lnkParentCrumb.Text = row.CompetencyAreaTitle;
                    }

                    PageName = row.CompetencyTitle + " :: " + PageName;

                    lblTitleCrumb.Text = row.CompetencyTitle;

                    lblTitle.Text = row.CompetencyTitle;

                    if (!row.IsCompetencyDescriptionNull())
                    {
                        lblCompetencyDescription.Text = row.CompetencyDescription;
                        plcCompetencyDescription.Visible = true;
                    }
                }
            }
            else
                Redirect();
        }
        private void UpdateAssignedItems()
        {
            //if Competency Area is being deactivated, deactivate all items assigned to the Competency Area
            BPCompetencies bpCompetencies = new BPCompetencies();

            BECompetencies ds = bpCompetencies.SelectByCompetencyAreaID(CompetencyAreaID);

            foreach (BECompetencies.tbl_CompetenciesRow competency in ds.tbl_Competencies)
            {
                competency.CompetencyActive = false;
            }

            bpCompetencies.Update(ds);
        }
        protected void btnDelete_Click(object sender, EventArgs e)
        {
            BPCompetencyAreas bpCompetencyAreas = new BPCompetencyAreas();
            BECompetencies ds = bpCompetencyAreas.SelectByID(CompetencyAreaID);
            BECompetencies.tbl_CompetencyAreasRow competencyArea = ds.tbl_CompetencyAreas.FindByCompetencyAreaID(CompetencyAreaID);

            if (competencyArea != null)
            {
                int disciplineLevelID = competencyArea.DisciplineLevelID;

                BPCompetencies bpCompetencies = new BPCompetencies();
                ds.Merge(bpCompetencies.SelectByCompetencyAreaID(competencyArea.CompetencyAreaID));

                foreach (BECompetencies.tbl_CompetenciesRow competency in ds.tbl_Competencies)
                {
                    competency.Delete();
                }

                competencyArea.Delete();

                bpCompetencies.Update(ds);
                bpCompetencyAreas.Update(ds);

                bpCompetencyAreas.ReOrderCompetencyAreas(disciplineLevelID);
            }

            BrowseRedirect();
        }
Esempio n. 5
0
        private void LoadDataSet()
        {
            BPDisciplineLevels bpDisciplineLevels = new BPDisciplineLevels();
            BPCompetencyAreas bpCompetencyAreas = new BPCompetencyAreas();
            BPCompetencies bpCompetencies = new BPCompetencies();

            dsCompetencies = bpDisciplineLevels.SelectAllActive();
            dsCompetencies.Merge(bpCompetencyAreas.SelectAllActive());
            dsCompetencies.Merge(bpCompetencies.SelectAllActive());
        }
        protected void btnMove_Click(object sender, EventArgs e)
        {
            bool found1 = false, found2 = false;
            int Position = Convert.ToInt32(ddlPosition.SelectedValue);
            int ItemToMove = Convert.ToInt32(ddlItemToMove.SelectedValue);

            BPCompetencies bp = new BPCompetencies();
            BECompetencies ds = bp.SelectByCompetencyAreaID(Convert.ToInt32(FilterCompAreaID));
            BECompetencies.tbl_CompetenciesRow[] competencyrows =
                (BECompetencies.tbl_CompetenciesRow[])ds.tbl_Competencies.Select("", "CompetencyOrder");

            BECompetencies.tbl_CompetenciesRow movecompetency = ds.tbl_Competencies.FindByCompetencyID(ItemToMove);

            foreach (BECompetencies.tbl_CompetenciesRow competency in competencyrows)
            {
                if (found1 && found2)
                    break;

                if (competency.CompetencyID == movecompetency.CompetencyID)
                {
                    found1 = true;

                    if (competency.CompetencyID == Position)
                        found2 = true;

                }
                else if (competency.CompetencyID == Position)
                {
                    found2 = true;

                    if (rblBeforeAfter.SelectedValue == "0")
                    {
                        movecompetency.CompetencyOrder = competency.CompetencyOrder;
                        competency.CompetencyOrder++;
                    }
                    else
                    {
                        if (found1)
                            competency.CompetencyOrder--;

                        movecompetency.CompetencyOrder = competency.CompetencyOrder + 1;
                    }
                }
                else if (found1 && !found2)
                    competency.CompetencyOrder--;

                else if (found2 && !found1)
                    competency.CompetencyOrder++;

            }

            bp.Update(ds);

            dgCompetencies.DataSource = GetData();
            dgCompetencies.DataBind();
        }
        protected DataView GetData()
        {
            BPCompetencies bp = new BPCompetencies();

            if(FilterDisciplineID == "-1" && FilterCompAreaID == "-1")
                DSCompetencies = bp.SelectAllWithROColumns();
            else if (FilterCompAreaID == "-1")
                DSCompetencies = bp.SelectByDisciplineLevelIDWithROColumns(Convert.ToInt32(ddlDisciplineLevels.SelectedValue));
            else
                DSCompetencies = bp.SelectByCompetencyAreaIDWithROColumns(Convert.ToInt32(ddlCompetencyAreas.SelectedValue));


            BindMoveControl(DSCompetencies.tbl_Competencies.DefaultView);

            DSCompetencies.tbl_Competencies.DefaultView.RowFilter = RowFilter("CompetencyTitle", ((LinkButton)rptLetters.Items[0].FindControl("lnkLetter")).CommandName, "CompetencyActive", lstActive.SelectedValue);

            return DSCompetencies.tbl_Competencies.DefaultView;
        }
        protected void btnDelete_Click(object sender, EventArgs e)
        {
            BPDisciplineLevels bpDisciplineLevels = new BPDisciplineLevels();
            BECompetencies ds = bpDisciplineLevels.SelectByID(DisciplineLevelID);
            BECompetencies.tbl_DisciplineLevelsRow discipline = ds.tbl_DisciplineLevels.FindByDisciplineLevelID(DisciplineLevelID);

            if (discipline != null)
            {
                BPCompetencyAreas bpCompAreas = new BPCompetencyAreas();
                BPCompetencies bpCompetencies = new BPCompetencies();

                ds.Merge(bpCompAreas.SelectByDisciplineLevelID(discipline.DisciplineLevelID));
                ds.Merge(bpCompetencies.SelectByDisciplineLevelID(discipline.DisciplineLevelID));

                foreach (BECompetencies.tbl_CompetenciesRow competency in ds.tbl_Competencies)
                {
                    competency.Delete();
                }

                foreach (BECompetencies.tbl_CompetencyAreasRow compArea in ds.tbl_CompetencyAreas)
                {
                    compArea.Delete();
                }

                discipline.Delete();

                bpCompetencies.Update(ds);
                bpCompAreas.Update(ds);
                bpDisciplineLevels.Update(ds);

                bpDisciplineLevels.ReOrderDisciplineLevels();
            }

            BrowseRedirect();
        }
        private void UpdateAssignedItems()
        {
            //if discipline is being deactivated, deactivate all items assigned to the discipline
            BPCompetencyAreas bpCompAreas = new BPCompetencyAreas();
            BPCompetencies bpCompetencies = new BPCompetencies();

            BECompetencies ds = bpCompAreas.SelectByDisciplineLevelID(DisciplineLevelID);
            ds.Merge(bpCompetencies.SelectByDisciplineLevelID(DisciplineLevelID));

            foreach (BECompetencies.tbl_CompetenciesRow competency in ds.tbl_Competencies)
            {
                competency.CompetencyActive = false;
            }

            foreach (BECompetencies.tbl_CompetencyAreasRow compArea in ds.tbl_CompetencyAreas)
            {
                compArea.CompetencyAreaActive = false;
            }

            bpCompetencies.Update(ds);
            bpCompAreas.Update(ds);
        }