| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455 |
- using NEducation.Controllers;
- using Newtonsoft.Json.Linq;
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Web;
- namespace NEducation.Code
- {
- public class Listening
- {
- public String id { get; set; }
- public String name { get; set; }
- public String descriptionGlobal { get; set; }
- public String descriptionLocal { get; set; }
- public String introductionGlobal { get; set; }
- public String introductionLocal { get; set; }
- public String picture { get; set; }
- public String content { get; set; }
- public String contentType { get; set; }
- public String lessonID { get; set; }
- // parse data from JSON data
- public Listening() { }
- public Listening(string json) : this(JObject.Parse(json))
- { }
- public Listening(JObject jObject)
- {
- if (jObject != null)
- {
- id = (string)jObject["ID"];
- name = (string)jObject["NAME"];
- descriptionGlobal = (string)jObject["DESCRIPTION_GLOBAL"];
- descriptionLocal = (string)jObject["DESCRIPTION_LOCAL"];
- introductionGlobal = (string)jObject["INTRODUCTION_GLOBAL"];
- introductionLocal = (string)jObject["INTRODUCTION_LOCAL"];
- picture = UtilsController.GetContentPath.ListenContentPath + (string)jObject["PICTURE"];
- contentType = (string)jObject["CONTENT_TYPE"];
- if (contentType == UtilsController.GetContentType.AUDIO_FILE ||
- contentType == UtilsController.GetContentType.PICTURE_FILE ||
- contentType == UtilsController.GetContentType.VIDEO_FILE)
- content = UtilsController.GetContentPath.ListenContentPath + (string)jObject["CONTENT"];
- else
- content = (string)jObject["CONTENT"];
- lessonID = (string)jObject["LESSON_ID"];
- System.Diagnostics.Debug.WriteLine("content " + content);
- }
- }
- }
- }
|