Пример #1
0
        private static List <Classes> QueryClasses(ref CookieContainer cookie, AjaxCommand.Send.ListClassClass lcc)
        {
            List <Classes> result = null;

            try
            {
                AjaxCommand.Send.CommandParams param = new AjaxCommand.Send.CommandParams()
                {
                    @params = lcc
                };
                string json = JsonConvert.SerializeObject(param, Formatting.Indented);

                var req = Http.Post(setting.url.ZxxsXxBjxxQueryUrl).Body(json);
                req.AddHeader("Referer", setting.url.QueryGradeRefererUrl);
                req.AddHeader("_ccrf.token", Csrf.GetCsrfToken());
                string html = req.RealTimeGo().RequestString;

                ReceiveClassesDataClass receiveGrade = JsonConvert.DeserializeObject <ReceiveClassesDataClass>(html);
                result = receiveGrade.rows;
            }
            catch (Exception e)
            {
                throw (e);
            }
            return(result);
        }
Пример #2
0
        public static List <Classes> QueryClassesByGrade(ref CookieContainer cookie, string gradeId)
        {
            List <Classes> result = null;

            try
            {
                AjaxCommand.Send.ListClassClass classData = new AjaxCommand.Send.ListClassClass();
                classData.SetGrade(gradeId);
                result = QueryClasses(ref cookie, classData);
            }
            catch (Exception e)
            {
                throw (e);
            }
            return(result);
        }