Пример #1
0
        public ActionResult GetListDepartment()
        {
            var item = new List <ItemValueModel>();
            var res  = dataAccess.GetListDepartment();

            item = res.Select(x => new ItemValueModel {
                ItemText  = x.Dep_Name,
                ItemValue = x.Dep_ID
            }).ToList();
            return(Json(item, JsonRequestBehavior.AllowGet));
        }
Пример #2
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));
        }