Esempio n. 1
0
    protected void loadDataFromConcierge()
    {
        Search sScoringCriterion = new Search(msScoringCriterion.CLASS_NAME);

        sScoringCriterion.AddOutputColumn("Name");
        sScoringCriterion.AddOutputColumn("Description");
        sScoringCriterion.AddOutputColumn("MinimumScore");
        sScoringCriterion.AddOutputColumn("MaximumScore");
        sScoringCriterion.AddOutputColumn("AllowDecimalScores");
        sScoringCriterion.AddCriteria(Expr.Equals("Competition", targetCompetitionEntry.Competition));
        sScoringCriterion.AddSortColumn("DisplayOrder");

        SearchResult srScoringCriterion = APIExtensions.GetSearchResult(sScoringCriterion, 0, null);

        dtScoringCriterion = srScoringCriterion.Table;
        DataColumn scScore = dtScoringCriterion.Columns.Add("Score", typeof(decimal));

        foreach (DataRow drScoringCriterion in dtScoringCriterion.Rows)
        {
            DataRow          criterion      = drScoringCriterion;
            msScoreCardScore scoreCardScore =
                targetScoreCard.Scores.Where(x => x.Criterion == criterion["ID"].ToString()).SingleOrDefault();

            if (scoreCardScore != null)
            {
                drScoringCriterion[scScore] = scoreCardScore.Score;
            }
        }
    }
Esempio n. 2
0
    protected void unbindScoreCard()
    {
        targetScoreCard.Comments = tbComments.Text;

        foreach (GridViewRow gridViewRow in gvScoringCriterion.Rows)
        {
            DataRow          drScoringCriteria = dtScoringCriterion.Rows[gridViewRow.DataItemIndex];
            msScoreCardScore scoreCardScore    =
                targetScoreCard.Scores.Where(x => x.Criterion == drScoringCriteria["ID"].ToString()).SingleOrDefault();

            if (scoreCardScore == null)
            {
                scoreCardScore = new msScoreCardScore
                {
                    Criterion = drScoringCriteria["ID"].ToString()
                };
                targetScoreCard.Scores.Add(scoreCardScore);
            }

            TextBox tbScore = (TextBox)gridViewRow.Cells[2].FindControl("tbScore");
            scoreCardScore.Score = decimal.Parse(tbScore.Text);
        }
    }