Lesson.cs 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. using NEducation.Controllers;
  2. using Newtonsoft.Json.Linq;
  3. using System;
  4. using System.Collections.Generic;
  5. using System.Linq;
  6. using System.Web;
  7. namespace NEducation.Code
  8. {
  9. public class Lesson
  10. {
  11. public String id { get; set; }
  12. public String courseId { get; set; }
  13. public String code { get; set; }
  14. public String name { get; set; }
  15. public String description { get; set; }
  16. public String introduction { get; set; }
  17. public String iconPath { get; set; }
  18. public String logoPath { get; set; }
  19. public Lesson() { }
  20. public Lesson(string json) : this(JObject.Parse(json))
  21. { }
  22. public Lesson(JObject jObject)
  23. {
  24. System.Diagnostics.Debug.WriteLine(jObject);
  25. if (jObject != null)
  26. {
  27. id = (string)jObject["ID"];
  28. code = (string)jObject["CODE"];
  29. name = (string)jObject["NAME"];
  30. courseId = (string)jObject["COURSE_ID"];
  31. description = (string)jObject["DESCRIPTION"];
  32. introduction = (string)jObject["INTRODUCTION"];
  33. iconPath = UtilsController.GetContentPath.LessonContentPath + (string)jObject["ICON_PATH"];
  34. logoPath = UtilsController.GetContentPath.LessonContentPath + (string)jObject["LOGO_PAHT"];
  35. System.Diagnostics.Debug.WriteLine("path " + iconPath);
  36. }
  37. }
  38. }
  39. }