| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374 |
- using Newtonsoft.Json.Linq;
- using System.Collections.Generic;
- namespace NEducation.Code
- {
- public class Winner
- {
- public List<WinnerElement> listWinner { get; set; }
- // Default constructor
- public Winner() { }
- // Constructor that parses JSON string
- public Winner(string json) : this(JObject.Parse(json)) { }
- // Constructor that parses JObject
- public Winner(JObject jObject)
- {
- if (jObject != null)
- {
- var list = jObject["listWinner"];
- if (list != null && list.HasValues)
- {
- listWinner = new List<WinnerElement>();
- JArray a = (JArray)list;
- foreach (JObject o in a.Children<JObject>())
- {
- listWinner.Add(new WinnerElement(o));
- }
- }
- }
- }
- }
- public class WinnerElement
- {
- public string id { get; set; }
- public string userId { get; set; }
- public string lestionId { get; set; }
- public string totalQuestion { get; set; }
- public string totalFalse { get; set; }
- public string totalTrue { get; set; }
- public string totalTime { get; set; }
- public string totalScore { get; set; }
- public string sysdate { get; set; }
- public string termId { get; set; }
- public string msisdn { get; set; }
- // Default constructor
- public WinnerElement() { }
- // Constructor that parses JSON string
- public WinnerElement(string json) : this(JObject.Parse(json)) { }
- // Constructor that parses JObject
- public WinnerElement(JObject jObject)
- {
- if (jObject != null)
- {
- id = (string)jObject["id"];
- userId = (string)jObject["userId"];
- lestionId = (string)jObject["lestionId"];
- totalQuestion = (string)jObject["totalQuestion"];
- totalFalse = (string)jObject["totalFalse"];
- totalTrue = (string)jObject["totalTrue"];
- totalTime = (string)jObject["totalTime"];
- totalScore = (string)jObject["totalScore"];
- sysdate = (string)jObject["sysdate"];
- termId = (string)jObject["termId"];
- msisdn = (string)jObject["msisdn"];
- }
- }
- }
- }
|