Example #1
0
        /// <summary>
        /// 获取电脑账平时成绩
        /// </summary>
        public static decimal GetDNZNormalScore(string classid, string OLSchoolUserId, string OLSchoolId, string OLAccCourseId)
        {
            decimal score = 0;

            Untity.HelperMethod p = new Untity.HelperMethod();
            string path           = Untity.HelperAppSet.getAppSetting("olschoolpath");
            string fullpath       = path + "/Member/GetHKJNormalScore?classid=" + classid
                                    + "&OLSchoolUserId=" + OLSchoolUserId
                                    + "&OLSchoolId=" + OLSchoolId
                                    + "&OLAccCourseId=" + OLAccCourseId;
            string json = p.Get(fullpath);

            Entity.Respose.GTXResult result = Untity.HelperJson.DeserializeObject <Entity.Respose.GTXResult>(json);
            if (result.Data == null)
            {
                throw new Exception("未取得课程(SortId:" + OLSchoolId + ")的数据,请确认是否已购买");
            }
            List <Entity.Respose.HKJScore> _sorts = Untity.HelperJson.DeserializeObject <List <Entity.Respose.HKJScore> >(result.Data.ToString());

            if (_sorts.Count > 0)
            {
                score = _sorts.Average(ii => ii.AutoFinal);
            }
            return(score);
        }
Example #2
0
        /// <summary>
        /// 获取题库平时成绩
        /// </summary>
        public static decimal GetTiKuNormalScore(string classid, string OLSchoolUserId, string OLSchoolId)
        {
            Untity.HelperMethod p = new Untity.HelperMethod();
            string path           = Untity.HelperAppSet.getAppSetting("olschoolpath");
            string fullpath       = path + "/Tiku/Paper/CoursePaperList?classid=" + classid
                                    + "&userid=" + OLSchoolUserId
                                    + "&sortid=" + OLSchoolId;
            string json = p.Get(fullpath);

            Entity.Respose.GTXResult    result = Untity.HelperJson.DeserializeObject <Entity.Respose.GTXResult>(json);
            List <Entity.Respose.Sorts> _sorts = Untity.HelperJson.DeserializeObject <List <Entity.Respose.Sorts> >(result.Data.ToString());
            decimal score = 0;

            foreach (Entity.Respose.Sorts sortitem in _sorts)
            {
                if (sortitem.name == "模拟考试" && sortitem.papers.Count > 0)
                {
                    foreach (Entity.Respose.Papers paperitem in sortitem.papers)
                    {
                        if (paperitem.scores.Count > 0)
                        {
                            score = paperitem.scores.Max(x => x.Score);
                        }
                    }
                }
            }
            return(score);
        }
Example #3
0
        public static Entity.Respose.OLUserResponse getOLSchoolUserId(Entity.MsSQL.T_Organiza _orga, string _username, string _password)
        {
            Untity.HelperMethod p = new Untity.HelperMethod();
            string path           = HelperAppSet.getAppSetting("olschoolpath");
            string fullpath       = path + "/Member/GetUserId?classid=" + _orga.ClassId + "&UserName="******"&PWD=" + _password;
            string json           = p.Get(fullpath);

            Entity.Respose.GTXResult      result = Untity.HelperJson.DeserializeObject <Entity.Respose.GTXResult>(json);
            Entity.Respose.OLUserResponse rep    = Untity.HelperJson.DeserializeObject <Entity.Respose.OLUserResponse>(Untity.HelperDataCvt.objToString(result.Data));
            return(rep);
        }
Example #4
0
        //网校接口调课程
        public static List <Entity.Respose.olschoolsubject> GetOLSchoolAllList()
        {
            HelperMethod p        = new HelperMethod();
            string       path     = HelperAppSet.getAppSetting("olschoolpath");
            string       fullpath = path + "/Member/GetOrgCourse?classid=9";
            var          hrr      = HttpHelper.Singleton.HttpGet(fullpath);
            string       json     = hrr.Result.Data;

            Entity.Respose.GTXResult result = Untity.HelperJson.DeserializeObject <Entity.Respose.GTXResult>(json);
            return(Untity.HelperJson.DeserializeObject <List <Entity.Respose.olschoolsubject> >(HelperDataCvt.objToString(result.Data)));
        }
Example #5
0
        /// <summary>
        /// 获取题库考试成绩
        /// </summary>
        public static decimal GetTiKuExamScore(string classid, string OLSchoolUserId, string OLPaperID)
        {
            decimal score = 0;

            Untity.HelperMethod p = new Untity.HelperMethod();
            string path           = Untity.HelperAppSet.getAppSetting("olschoolpath");
            string fullpath       = path + "/Tiku/Paper/GetCGXExamPaperList?classid=" + classid
                                    + "&userid=" + OLSchoolUserId
                                    + "&paperid=" + OLPaperID;
            string json = p.Get(fullpath);

            Entity.Respose.GTXResult          result = Untity.HelperJson.DeserializeObject <Entity.Respose.GTXResult>(json);
            List <Entity.Respose.PaperScores> _sorts = Untity.HelperJson.DeserializeObject <List <Entity.Respose.PaperScores> >(result.Data.ToString());

            if (_sorts.Count > 0)
            {
                score = _sorts.LastOrDefault().Score;
            }
            return(score);
        }
Example #6
0
        public static bool IsBuyAll(Entity.MsSQL.T_Organiza _orga, string _ids, string _username, ref string error)
        {
            HelperMethod p = new HelperMethod();
            //string path = HelperAppSet.getAppSetting("olschoolpath");
            //string classid = HelperAppSet.getAppSetting("classid");
            string path     = HelperAppSet.getAppSetting("olschoolpath");
            string fullpath = path + "/Member/IsBuyAll?classid=" + _orga.ClassId + "&UserName="******"&Ids=" + _ids;
            string json     = p.Get(fullpath);

            Entity.Respose.GTXResult result = Untity.HelperJson.DeserializeObject <Entity.Respose.GTXResult>(json);
            if (HelperDataCvt.objToString(result.Data).Contains("未购买"))
            {
                error = HelperDataCvt.objToString(result.Data);
                return(false);
            }
            else
            {
                return(true);
            }
        }