-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSkill.cs
More file actions
50 lines (47 loc) · 1.51 KB
/
Copy pathSkill.cs
File metadata and controls
50 lines (47 loc) · 1.51 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
using Newtonsoft.Json.Linq;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace OlyCommonClasses
{
public class Skill
{
public int _SkillId { get; set; }
public string _Name { get; set; }
public string _First_Line { get; set; }
public int _SK_Time_to_learn { get; set; }
public int _SK_Required_Skill { get; set; }
public static void Add(string InputKey, string InputString, List<Skill> _skills)
{
JObject j1 = JObject.Parse(InputString);
JArray myna;
JArray myfl;
if (j1.SelectToken("na") != null && j1.SelectToken("na").HasValues)
{
myna = (JArray)j1.SelectToken("na");
}
else
{
myna = null;
}
if (j1.SelectToken("firstline") != null && j1.SelectToken("firstline").HasValues)
{
myfl = (JArray)j1.SelectToken("firstline");
}
else
{
myfl = null;
}
_skills.Add(new Skill
{
_SkillId = Convert.ToInt32(InputKey),
_First_Line = myfl[0].ToString(),
_Name = myna[0].ToString(),
_SK_Required_Skill = JSON.int_Token(j1, "SK.rs"),
_SK_Time_to_learn = JSON.int_Token(j1, "SK.tl")
});
}
}
}