public IEnumerable <object> QueryUniversity(string classes, string uniName)
        {
            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.QueryUniversity(localProvince, classes, uniName);

                return(re);
            }
            catch (Exception e)
            {
                return(new[] { e.Message });
            }
        }
Beispiel #2
0
        public IEnumerable <object> QueryUniversity(string localProvince, string classes, string uniName)
        {
            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.QueryUniversity(localProvince, classes, uniName);

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