Exemple #1
0
        public string BoBoCount(MatchParameterModel match)
        {
            string               result       = "";
            MessageModel         message      = new MessageModel();
            JavaScriptSerializer jss          = new JavaScriptSerializer();
            HashSet <object>     returnResult = new HashSet <object>();
            BoBoCountModel       joinCount    = new BoBoCountModel();

            //主播列表
            using (HiGame_V1Entities context = new HiGame_V1Entities())
            {
                var sql = "SELECT" +
                          " Count(t1.GameRecordID) as JoinCount" +
                          " FROM db_GameRecord t1" +
                          " LEFT JOIN db_Team t2 ON t1.TeamID=t2.TeamID" +
                          " WHERE t2.State=0 AND t1.GameID =" + match.MatchID + " AND t1.BoBoID=" + match.BoBoID;

                joinCount = context.Database.SqlQuery <BoBoCountModel>(sql)
                            .FirstOrDefault();
            }
            message.MessageCode = MESSAGE.OK_CODE;
            message.Message     = MESSAGE.OK;
            returnResult.Add(message);
            returnResult.Add(joinCount);
            result = jss.Serialize(returnResult);
            return(result);
        }
Exemple #2
0
        public string MatchDateList(MatchParameterModel para)
        {
            string                result       = "";
            MessageModel          message      = new MessageModel();
            JavaScriptSerializer  jss          = new JavaScriptSerializer();
            HashSet <object>      returnResult = new HashSet <object>();
            List <MatchDateModel> dateList     = new List <MatchDateModel>();

            //主播赛程列表
            using (HiGame_V1Entities context = new HiGame_V1Entities())
            {
                var sql = "SELECT" +
                          " CONVERT(varchar(100), t1.StartTime, 23) as StartTime" +
                          " FROM db_FightResult t1" +
                          " WHERE t1.BoBoID= " + para.BoBoID +
                          " AND t1.GameID=" + para.MatchID +
                          " GROUP BY CONVERT(varchar(100), t1.StartTime, 23)" +
                          " ORDER BY CONVERT(varchar(100), t1.StartTime, 23)";

                dateList = context.Database.SqlQuery <MatchDateModel>(sql)
                           .ToList();
            }
            message.MessageCode = MESSAGE.OK_CODE;
            message.Message     = MESSAGE.OK;
            returnResult.Add(message);
            returnResult.Add(dateList);
            result = jss.Serialize(returnResult);
            return(result);
        }
        public HttpResponseMessage BoBoCount([FromBody] MatchParameterModel match)
        {
            MatchLogic matchLogic = new MatchLogic();

            jsonResult = matchLogic.BoBoCount(match);

            returnResult.Content = new StringContent(jsonResult, Encoding.UTF8, "application/json");
            return(returnResult);
        }
Exemple #4
0
        public string MatchState(MatchParameterModel para)
        {
            string               result       = "";
            MessageModel         message      = new MessageModel();
            JavaScriptSerializer jss          = new JavaScriptSerializer();
            HashSet <object>     returnResult = new HashSet <object>();


            //主播赛程列表
            MatchStateModel matchState = new MatchStateModel();

            matchState.MatchState = Convert.ToInt32(WebConfigurationManager.AppSettings["matchstate"]);

            message.MessageCode = MESSAGE.OK_CODE;
            message.Message     = MESSAGE.OK;
            returnResult.Add(message);
            returnResult.Add(matchState);
            result = jss.Serialize(returnResult);
            return(result);
        }
Exemple #5
0
        public string BoBoMatchList(MatchParameterModel para)
        {
            string               result        = "";
            MessageModel         message       = new MessageModel();
            JavaScriptSerializer jss           = new JavaScriptSerializer();
            HashSet <object>     returnResult  = new HashSet <object>();
            List <MyMatchModel>  boboMatchList = new List <MyMatchModel>();

            //主播赛程列表2
            using (HiGame_V1Entities context = new HiGame_V1Entities())
            {
                var sql2 = "SELECT" +
                           " t1.ResultID as MatchID," +
                           " t1.GameStage as MatchName," +
                           " t1.HomeTeamID as STeamID," +
                           " t2.TeamName as STeamName," +
                           " t2.TeamPicture as STeamLogo," +
                           " t1.CustomerTeamID as ETeamID," +
                           " t3.TeamName as ETeamName," +
                           " t3.TeamPicture as ETeamLogo," +
                           "  CONVERT(varchar(100), t1.EndTime, 20) as EndTime," +
                           " t1.Result " +
                           " FROM db_FightResult t1" +
                           " LEFT JOIN db_Team t2 ON t1.HomeTeamID=t2.TeamID" +
                           " LEFT JOIN db_Team t3 ON t1.CustomerTeamID=t3.TeamID" +
                           " WHERE t1.BoBoID= " + para.BoBoID +
                           " AND t1.GameID=" + para.MatchID +
                           " AND CONVERT(varchar(100), t1.EndTime, 23)=" + "'" + para.MatchTime + "'" +
                           " ORDER BY t1.EndTime DESC";

                boboMatchList = context.Database.SqlQuery <MyMatchModel>(sql2)
                                .ToList();
            }
            message.MessageCode = MESSAGE.OK_CODE;
            message.Message     = MESSAGE.OK;
            returnResult.Add(message);
            returnResult.Add(boboMatchList);
            result = jss.Serialize(returnResult);
            return(result);
        }