コード例 #1
0
ファイル: HomeController.cs プロジェクト: Dozer74/WebCrawler
        private ActionResult ParseStatistic(DataModel[] records, IGroupInfoProvider infoProvider)
        {
            for (int i = 0; i < records.Length; i++)
            {
                if (i>0)
                    records[i].Delta = records[i].MembersCount - records[i - 1].MembersCount;
                records[i].UpdatingTime = ConvertToLocalTime(records[i].UpdatingTime);
            }

            var model = new StatisticModel
            {
                GroupName = infoProvider.GetSavedGroupName(),
                GroupUrl = infoProvider.GetSavedGroupUrl(),
                RecordsCount = records.Length,
                LastUpdateTime = records.Max(st => st.UpdatingTime),
                Records = records.Reverse().ToArray() //последние записи должны отображаться в начале
            };

            return View("Index", model);
        }
コード例 #2
0
        private ActionResult ParseStatistic(DataModel[] records, IGroupInfoProvider infoProvider)
        {
            records = Precount(records);

            var model = new StatisticModel
            {
                GroupName = infoProvider.GetSavedGroupName(),
                GroupUrl = infoProvider.GetSavedGroupUrl(),
                RecordsCount = dataProvider.GetRecordsCount(),
                LastUpdateTime = records.Max(st => st.UpdatingTime),
                Records = records.ToArray()
            };

            return View("GetAll", model);
        }