コード例 #1
0
    //public dtoCommitteesSummaryItem(UserSubmission s, String anonymousUser)
    //    : base(s, anonymousUser)
    //{
    //    Committees = new List<dtoCommitteeDisplayItem>();
    //    Counters = new Dictionary<EvaluationStatus, long>() { { EvaluationStatus.Evaluated, 0 }, { EvaluationStatus.Evaluating, 0 }, { EvaluationStatus.EvaluatorReplacement, 0 }, { EvaluationStatus.Invalidated, 0 }, { EvaluationStatus.None, 0 } };
    //}

        public void UpdateCounters()
        {
            var query = Committees.Where(c => c.Evaluations != null).SelectMany(c => c.Evaluations);
            Counters[EvaluationStatus.None] = query.Where(s => s.Status == EvaluationStatus.None).Count();
            Counters[EvaluationStatus.Evaluated] = query.Where(s => s.Status == EvaluationStatus.Evaluated).Count();
            Counters[EvaluationStatus.Evaluating] = query.Where(s => s.Status == EvaluationStatus.Evaluating).Count();
            Counters[EvaluationStatus.EvaluatorReplacement] = query.Where(s => s.Status == EvaluationStatus.EvaluatorReplacement).Count();
            Counters[EvaluationStatus.Invalidated] = query.Where(s => s.Status == EvaluationStatus.Invalidated).Count();
        }
コード例 #2
0
        public List <dtoCommitteePartialAssignment> GetPartialAssignments(Dictionary <long, Dictionary <long, String> > evaluators)
        {
            List <dtoCommitteePartialAssignment> items = new List <dtoCommitteePartialAssignment>();

            items.AddRange(Committees.Where(c => c.Evaluators.Count != evaluators[c.IdCommittee].Values.Count).Select(c => new dtoCommitteePartialAssignment()
            {
                CommitteeName  = c.Name, Display = c.Display, SubmitterName = this.DisplayName, SubmitterType = this.SubmitterType,
                SubmittedOn    = this.SubmittedOn, AssignedEvaluators = c.Evaluators.Count, AvailableEvaluators = evaluators[c.IdCommittee].Values.Count
                , IdSubmission = this.IdSubmission
            }).ToList());
            return(items);
        }