Exemple #1
0
        internal object GetSubjects(DataTablesAjaxRequestModel tableModel)
        {
            var data = _subjectService.GetSubjects(
                tableModel.PageIndex,
                tableModel.PageSize,
                tableModel.SearchText,
                tableModel.GetSortText(new string[] { "Name", "RegistrationOpen" }));

            return(new
            {
                recordsTotal = data.total,
                recordsFiltered = data.totalDisplay,
                data = (from record in data.records
                        select new string[]
                {
                    record.Name,
                    record.RegistrationOpen.ToString()
                }
                        ).ToArray()
            });
        }
        internal object GetStudents(DataTablesAjaxRequestModel tableModel)
        {
            var data = _studentService.GetStudents(
                tableModel.PageIndex,
                tableModel.PageSize,
                tableModel.SearchText,
                tableModel.GetSortText(new string[] { "Name", "Username", "Email" }));

            return(new
            {
                recordsTotal = data.total,
                recordsFiltered = data.totalDisplay,
                data = (from record in data.records
                        select new string[]
                {
                    record.Name,
                    record.Username,
                    record.Email,
                    record.Id.ToString()
                }
                        ).ToArray()
            });
        }