Beispiel #1
0
        public ActionResult SchoolMarksStatistic()
        {
            List <KeyValuePair <int, int> > statistic = MarksDB.GetSchoolMarksStatistic();

            ViewBag.Statistic = statistic;
            return(View());
        }
Beispiel #2
0
        public JsonResult GetSchoolMarksStatistic()
        {
            List <KeyValuePair <int, int> > statistic = MarksDB.GetSchoolMarksStatistic();

            List <KeyValuePair <string, int> > result = new List <KeyValuePair <string, int> >
            {
                new KeyValuePair <string, int>("От 0 до 4:", statistic[0].Value),
                new KeyValuePair <string, int>("От 4 до 7:", statistic[1].Value),
                new KeyValuePair <string, int>("От 7 до 9:", statistic[2].Value),
                new KeyValuePair <string, int>("От 9 до 12:", statistic[3].Value),
            };

            return(Json(new { Results = result }, JsonRequestBehavior.AllowGet));
        }