コード例 #1
0
 /// <summary>
 /// 获取课程和资源
 /// </summary>
 /// <param name="context"></param>
 public void GetCourseAndResource(HttpContext context)
 {
     var zwJson = new ZwJson();
     CourseService courseService = new CourseService(_session);
     var type = context.Request.Params["type"];
     var course = courseService.GetCourseAndResource();
     zwJson.Data = from c in course
                   select new
                       {
                           c.Id,
                           c.Title,
                           Resourceses = c.Resourceses.Where(s => s.Flag == type)
                       };
     zwJson.IsSuccess = true;
     zwJson.JsExecuteMethod = "Ajax_GetCourseAndResource";
     context.Response.Write(_jss.Serialize(zwJson));
 }