Esempio n. 1
0
        public IList <EvaluateCalcEntity> GetCalcScore3(string evaluateId, string groupid, string othergroupid)
        {
            var items   = service.GetCalcScore(evaluateId, null);
            var avg     = service.GetAvgScore(evaluateId);
            var current = service.GetGroupScore(evaluateId, groupid);
            var other   = service.GetGroupScore(evaluateId, othergroupid);
            var seq     = 1;

            if (items.Count > 0)
            {
                var lastScore = items[0].Pct;
                for (int i = 0; i < items.Count; i++)
                {
                    if (items[i].Pct != lastScore)
                    {
                        lastScore = items[i].Pct;
                        seq++;
                    }
                    if (items[i].GroupName == current.Season)
                    {
                        break;
                    }
                }
            }
            current.Seq = seq;

            seq = 1;
            if (items.Count > 0)
            {
                var lastScore = items[0].Pct;
                for (int i = 0; i < items.Count; i++)
                {
                    if (items[i].Pct != lastScore)
                    {
                        lastScore = items[i].Pct;
                        seq++;
                    }
                    if (items[i].GroupName == other.Season)
                    {
                        break;
                    }
                }
            }
            other.Seq = seq;

            return(new List <EvaluateCalcEntity>()
            {
                avg, current, other
            });
        }