Exemple #1
0
        public IActionResult GetProfessorsJson()
        {
            var lecturers = LecturerManagementService.GetLecturers();

            var responseModel = lecturers.Select(l => LecturerViewModel.FormLecturers(l, null));

            return(Ok(responseModel));
        }
        public DataTablesResult <LecturerViewModel> GetCollectionLecturers(DataTablesParam dataTableParam)
        {
            var searchString = dataTableParam.GetSearchString();

            ViewBag.EditActionLink   = "/Administration/EditProfessor";
            ViewBag.DeleteActionLink = "/Administration/DeleteLecturer";
            ViewBag.StatActionLink   = "/Administration/Attendance";
            var lecturers = LecturerManagementService.GetLecturersPageable(pageInfo: dataTableParam.ToPageInfo(), searchString: searchString);

            return(DataTableExtensions.GetResults(lecturers.Items.Select(l => LecturerViewModel.FormLecturers(l, PartialViewToString("_EditGlyphLinks", l.Id))), dataTableParam, lecturers.TotalCount));
        }