コード例 #1
0
ファイル: StatService.cs プロジェクト: karcagtamas/UniHelper
        /// <inheritdoc />
        public StatisticDto GetHomeStat()
        {
            var stat = new StatisticDto {
                SolvedTasks = GetSolvedTaskNumber(), UnSolvedTasks = GetNotSolvedTaskNumber()
            };

            stat.Periods = new List <PeriodStatistic>();

            var periods = _periodService.GetUserPeriodList();

            periods.ForEach(period =>
            {
                stat.Periods.Add(new PeriodStatistic
                {
                    IsCurrent = period.IsCurrent,
                    Label     = period.Name,
                    Marks     = period.Subjects.Where(x => x.Result != null).Select(x => (int)x.Result).ToList()
                });
            });

            return(stat);
        }
コード例 #2
0
 public List <PeriodDto> GetUserPeriodList()
 {
     return(_service.GetUserPeriodList());
 }