Esempio n. 1
0
        public JsonResult CheckTname(string matchid, string tname)
        {
            //检查敏感词
            WebClient MyWebClient = new WebClient();
            string    strUrl      = string.Format(ConfigurationManager.AppSettings.Get("api_url") + "/signUp/checkName?teamname={0}", tname);

            MyWebClient.Credentials = CredentialCache.DefaultCredentials;
            byte[] pageData = MyWebClient.DownloadData(strUrl);

            String      strJson = Encoding.UTF8.GetString(pageData) ?? "";
            ResultModel rb      = JsonConvert.DeserializeObject <ResultModel>(strJson);

            if (rb.code == 0)
            {
                TeamRegBll bll = new TeamRegBll();
                bool       res = bll.CheckTname(matchid, tname);

                if (res)
                {
                    return(RepReurnError("已经存在相同的队伍名称"));
                }
                else
                {
                    return(RepReurnOK());
                }
            }
            else
            {
                return(RepReurnError(rb.msg));
            }
        }
Esempio n. 2
0
        public JsonResult CheckTname(string matchid, string tname)
        {
            TeamRegBll bll = new TeamRegBll();
            bool       res = bll.CheckTname(matchid, tname);

            if (res)
            {
                return(RepReurnError("已经存在相同的队伍名称"));
            }
            else
            {
                return(RepReurnOK());
            }
        }