Esempio n. 1
0
        public async Task <IActionResult> Index()
        {
            OverViewModel model = new OverViewModel();

            model.DepCount = await dep.CountDepartmentAsync();

            model.ClassCount = await classe.CountClass(null);

            model.StudentCount = await stu.CountStudentAsync();

            model.TeacherCount = await th.CountTeacherAsync();

            return(View(model));
        }
Esempio n. 2
0
        // GET: Department/Details/5
        public async Task <IActionResult> Details(int?id)
        {
            var model = new DepDetailViewModel();

            if (id == null)
            {
                return(NotFound());
            }

            model.Department = await dep.GetByIdAsync(id.Value);

            model.numberClass = await cls.CountClass(id.Value);

            model.Classes = await cls.GetAllFromDepartmentAsync(id.Value);

            if (model.Department == null)
            {
                return(NotFound());
            }

            return(View(model));
        }