求助大神,帮忙看看datetables插件的使用,我的数据不能再前提显示

来源:互联网 发布:海关数据有用么 编辑:程序博客网 时间:2024/05/22 00:55

  这是控制器中的代码,

 public JsonResult GetCompanyClothDate()

        {
            int Semester1 = Convert.ToInt32(this.TempData["Semester"]);
            int Company1 = Convert.ToInt32(this.TempData["Company"]);
            int Grades1 = Convert.ToInt32(this.TempData["Grades"]);
            var data2 = (
               from c in db.Clothsfoes
               where c.DictSemesterID == Semester1 && c.BasicIfo.DictCompanyID == Company1 && c.BasicIfo.DictGradesID == Grades1
               orderby c.Time
               select new
               {
                   Name = c.BasicIfo.Name,
                   Time = c.Time,
                   SprAutCloth = c.SprAutCloth,
                   SumCloth = c.SumCloth,
                   WinCloth = c.WinCloth,
                   WinCamouFlage = c.WinCamouFlage,
                   SumCamluFlage = c.SumCamluFlage,
                   TrainCloth = c.TrainCloth,
                   c.LeaShoes,
                   c.GlueShoes,
               }).ToList().Select(x => new
               {
                   Time = x.Time.ToString().Split(' ')[0],
                   SprAutCloth = x.SprAutCloth.Substring(0),
                   SumCloth = x.SumCloth.Substring(0),          
                   WinCloth = x.WinCloth.Substring(0),              
                   WinCamouFlage = x.WinCamouFlage.Substring(0),                
                   SumCamluFlage = x.SumCamluFlage.Substring(0),            
                   TrainCloth = x.TrainCloth.Substring(0),             
                   x.LeaShoes,
                   x.GlueShoes,
                   //x.Company,
                   //x.Battalion,
                   //x.Semester,
                   x.Name
               });
            return Json(new
            {
                data = data2
            }, JsonRequestBehavior.AllowGet);

        }

这是视图中的代码,


这些数据在数据库中能找到,但是就是值不能传回前台,大神帮忙看一下         

0 0
原创粉丝点击