Beispiel #1
0
        public ActionResult AnAjaxList()
        {
            int start  = 0;
            int length = 0;

            start  = Convert.ToInt32(Request.Params["start"]);
            length = Convert.ToInt32(Request.Params["length"]);

            var strSql = "";

            BLL.AnswerTable          answer = new BLL.AnswerTable();
            List <Model.AnswerTable> list   = answer.DataTableToList(answer.GetListByPage(strSql, "", start + 1, start + length).Tables[0]);
            int filterTotal = answer.GetRecordCount(strSql);
            int total       = answer.GetRecordCount("");

            return(this.Json(new
            {
                result = 1,
                data = new
                {
                    draw = Request.Params["draw"],
                    recordsTotal = total,
                    recordsFiltered = filterTotal,
                    data = list.Select(o => new
                    {
                        ID = o.ID,
                        Student = o.Student,
                        Filepath = o.Filepath,
                    })
                }
            }));
        }