public IEnumerable <object> GetUniversityList()
        {
            try
            {
                var account       = HttpContext.Session.GetString("user_Account");
                var localProvince = HttpContext.Session.GetString("user_Province");

                if (account == null || localProvince == null)
                {
                    return(new[]
                    {
                        new { msg = "not login" }
                    });
                }

                if (Server.AccountHandle(account) == 0)
                {
                    return(new[]
                    {
                        new { msg = "times exceeded" }
                    });
                }
                var re = HistoryDataServer.GetUniversityList(localProvince);

                return(re);
            }
            catch (Exception e)
            {
                return(new[] { e.Message });
            }
        }
        public IEnumerable <object> QueryScore(int year, string classes, int lscore, int rscore)
        {
            try
            {
                var account       = HttpContext.Session.GetString("user_Account");
                var localProvince = HttpContext.Session.GetString("user_Province");

                if (account == null || localProvince == null)
                {
                    return(new[]
                    {
                        new { msg = "not login" }
                    });
                }

                if (Server.AccountHandle(account) == 0)
                {
                    return(new[]
                    {
                        new { msg = "times exceeded" }
                    });
                }
                var re = HistoryDataServer.QueryScore(localProvince, year, classes, lscore, rscore);

                return(re);
            }
            catch (Exception e)
            {
                return(new[] { e.Message });
            }
        }
Beispiel #3
0
        public IEnumerable <object> QueryProfession(string localProvince, int year, string classes, int lscore, int rscore, string proName)
        {
            try
            {
                var addr = Server.GetUserIp(Request.HttpContext);
                if (Server.IPHandle(addr) == 0)
                {
                    return(new[] { "your ip can't using our api , please contact administrator" });
                }

                var re = HistoryDataServer.QueryProfession(localProvince, year, classes, lscore, rscore, proName);

                return(re);
            }
            catch (Exception e)
            {
                return(new[] { e.Message });
            }
        }
Beispiel #4
0
        public IEnumerable <object> GetUniversityList(string localProvince)
        {
            try
            {
                var addr = Server.GetUserIp(Request.HttpContext);
                if (Server.IPHandle(addr) == 0)
                {
                    return(new[] { "your ip can't using our api , please contact administrator" });
                }

                var re = HistoryDataServer.GetUniversityList(localProvince);

                return(re);
            }
            catch (Exception e)
            {
                return(new[] { e.Message });
            }
        }