public static JsnDec GetCodedic() { var jser = new JavaScriptSerializer(); string reguest2 = @"http://services.tsi.lv/schedule/api/service.asmx/GetItems"; string response2 = Getresponse(reguest2); response2 = response2.Replace("(", ""); response2 = response2.Replace(")", ""); Jsn1 dicdic = jser.Deserialize <Jsn1>(response2); return(jser.Deserialize <JsnDec>(dicdic.d)); }
public static Lessons GetLessons(string group, int timestart, JsnDec codedic) { int timefinish = timestart + 86400; group = codedic.groups.FirstOrDefault(x => x.Value == group).Key; string reguest = $"http://services.tsi.lv/schedule/api/service.asmx/GetLocalizedEvents?from={timestart}&to={timefinish}&teachers=&rooms=&groups={group}&lang=%27ru%27"; string response = Getresponse(reguest); response = response.Replace("(", ""); response = response.Replace(")", ""); var jser = new JavaScriptSerializer(); Jsn1 dic = jser.Deserialize <Jsn1>(response); Jsn2 dic2 = jser.Deserialize <Jsn2>(dic.d); return(new Lessons(dic2, codedic, timestart)); }