示例#1
0
        public JsonResult GetCourseById(DataTableParameters dataTableParameters, int ID)
        {
            COURSE course = new COURSE();

            var resultSet = new DataTableResultSet();

            resultSet.draw = dataTableParameters.Draw;
            var lst = course.GetCourseByID(ID, dataTableParameters.Start + 1,
                                           dataTableParameters.Start + dataTableParameters.Length + 1);

            resultSet.recordsTotal = resultSet.recordsFiltered = course.GetCount(ID);

            foreach (var i in lst)
            {
                var columns = new List <string>();

                columns.Add("<img src='" + i.PICTURE + "' class='img-rounded' height='100' width='100' alt='X' />");
                columns.Add(i.EMP_ID == null ? "" : i.EMP_ID.Trim());
                columns.Add(i.EMP_NAME == null ? "" : i.EMP_NAME.Trim());
                columns.Add(i.DEPARTMENT == null ? "" : i.DEPARTMENT.Trim());
                columns.Add(i.COURSE.Trim());
                columns.Add(i.TEACHER == null ? "" : i.TEACHER.Trim());
                resultSet.data.Add(columns);
            }
            return(Json(resultSet));
        }