Пример #1
0
        public ActionResult GetNumSubmisstionEachDepartment()
        {
            var listDep = DAManager.GetListDepartment();
            List <ChartDataViewmodel> dataChart = new List <ChartDataViewmodel>();

            foreach (var item in listDep)
            {
                var data             = DAManager.GetListSubmisstionForAdmin(item.Dep_ID);
                ChartDataViewmodel a = new ChartDataViewmodel();
                a.value = item.Dep_Name;
                a.num   = data.Count();
                dataChart.Add(a);
            }
            return(Json(dataChart, JsonRequestBehavior.AllowGet));
        }
        public ActionResult GetTopStudentHaveMostPublicSubmission()
        {
            var userInfo   = (UserLoginModel)Session[Helper.Commons.USER_SEESION_ADMIN];
            var listPublic = dataAccess.GetSubmissionPublic(userInfo.Department_ID, "Admin");

            var studentInDep = dataAccess.GetUsersByDep(userInfo.Department_ID);
            List <ChartDataViewmodel> dataChart = new List <ChartDataViewmodel>();

            foreach (var item in studentInDep)
            {
                ChartDataViewmodel a = new ChartDataViewmodel();
                a.value = item.Username;
                a.num   = listPublic.Where(x => x.USER.User_ID == item.User_ID).Count();
                dataChart.Add(a);
            }
            return(Json(dataChart, JsonRequestBehavior.AllowGet));
        }