Ejemplo n.º 1
0
 private void GetRQList()
 {
     try
     {
         SeoWebSite.BLL.odds_rq oddsrqbll = new SeoWebSite.BLL.odds_rq();
         JObject result     = new JObject();
         int     start      = int.Parse(Request.Form["start"]);
         int     limit      = int.Parse(Request.Form["limit"]);
         int     totalCount = 0;
         string where = Request.Form["where"];
         DataSet ds = oddsrqbll.GetList(where, start + 1, start + limit, out totalCount);
         result.Add("success", true);
         result.Add("totalCount", totalCount);
         string javascriptJson = JsonConvert.SerializeObject(ds.Tables[0], new JavaScriptDateTimeConverter());
         responseText = "{success:true,totalCount:" + totalCount + ",data:" + javascriptJson + "}";
     }
     catch (Exception)
     {
         throw;
     }
 }
Ejemplo n.º 2
0
    private void GetRQList()
    {
        try
        {
            SeoWebSite.BLL.odds_rq oddsrqbll = new SeoWebSite.BLL.odds_rq();
            JObject result = new JObject();
            int start = int.Parse(Request.Form["start"]);
            int limit = int.Parse(Request.Form["limit"]);
            int totalCount = 0;
            string where = Request.Form["where"];
            DataSet ds = oddsrqbll.GetList(where, start + 1, start + limit, out totalCount);
            result.Add("success", true);
            result.Add("totalCount", totalCount);
            string javascriptJson = JsonConvert.SerializeObject(ds.Tables[0], new JavaScriptDateTimeConverter());
            responseText = "{success:true,totalCount:" + totalCount + ",data:" + javascriptJson + "}";
        }
        catch (Exception)
        {

            throw;
        }
    }
Ejemplo n.º 3
0
    private void queryOddsRQ()
    {
        if (Request["odds"] != null && Request["isTrue"] != null)
        {
            JObject result = new JObject();
            JArray oddsArray = JArray.Parse(Request.Form["odds"]);
            int totalCount = 0;
            DataSet ds = null;
            DataTable dt = null;
            SeoWebSite.BLL.odds_rq odds_rqbll = new SeoWebSite.BLL.odds_rq();

            foreach (JObject item in oddsArray)
            {
                ds = odds_rqbll.GetList(item["companyid"].ToString().Replace("\"", ""), new string[] { (string)item["home1"], (string)item["pankou1"], (string)item["away1"], (string)item["home2"], (string)item["pankou2"], (string)item["away2"] });
                if (ds.Tables[0].Rows.Count > 0)
                {
                    if (dt == null)
                    {
                        dt = ds.Tables[0];
                    }
                    else
                    {
                        foreach (DataRow dr in ds.Tables[0].Rows)
                            dt.ImportRow(dr);
                    }
                }
            }
            if (dt.Rows.Count > 0)
            {
                dt.Columns.Add("victory");
                dt.Columns.Add("win1");
                dt.Columns.Add("win2");
                foreach (DataRow dr in dt.Rows)
                {
                    int score = (int)dr["home"] - (int)dr["away"];
                    if (score > 0)
                    {
                        dr["victory"] = 3;
                    }
                    else if (score == 0)
                    {
                        dr["victory"] = 1;
                    }
                    else
                    {
                        dr["victory"] = 0;
                    }
                    if (score > float.Parse(dr["pankou1"].ToString()))
                    {
                        dr["win1"] = 3;
                    }
                    else if (score == float.Parse(dr["pankou1"].ToString()))
                    {
                        dr["win1"] = 1;
                    }
                    else
                    {
                        dr["win1"] = 0;
                    }
                    if (score > float.Parse(dr["pankou2"].ToString()))
                    {
                        dr["win2"] = 3;
                    }
                    else if (score == float.Parse(dr["pankou2"].ToString()))
                    {
                        dr["win2"] = 1;
                    }
                    else
                    {
                        dr["win2"] = 0;
                    }
                }
            }
            result.Add("success", true);
            result.Add("totalCount", totalCount);
            string javascriptJson = JsonConvert.SerializeObject(dt, new JavaScriptDateTimeConverter());
            responseText = "{success:true,totalCount:" + totalCount + ",data:" + javascriptJson + "}";
        }
    }
Ejemplo n.º 4
0
    private void queryOddsRQ()
    {
        if (Request["odds"] != null && Request["isTrue"] != null)
        {
            JObject   result     = new JObject();
            JArray    oddsArray  = JArray.Parse(Request.Form["odds"]);
            int       totalCount = 0;
            DataSet   ds         = null;
            DataTable dt         = null;
            SeoWebSite.BLL.odds_rq odds_rqbll = new SeoWebSite.BLL.odds_rq();

            foreach (JObject item in oddsArray)
            {
                ds = odds_rqbll.GetList(item["companyid"].ToString().Replace("\"", ""), new string[] { (string)item["home1"], (string)item["pankou1"], (string)item["away1"], (string)item["home2"], (string)item["pankou2"], (string)item["away2"] });
                if (ds.Tables[0].Rows.Count > 0)
                {
                    if (dt == null)
                    {
                        dt = ds.Tables[0];
                    }
                    else
                    {
                        foreach (DataRow dr in ds.Tables[0].Rows)
                        {
                            dt.ImportRow(dr);
                        }
                    }
                }
            }
            if (dt.Rows.Count > 0)
            {
                dt.Columns.Add("victory");
                dt.Columns.Add("win1");
                dt.Columns.Add("win2");
                foreach (DataRow dr in dt.Rows)
                {
                    int score = (int)dr["home"] - (int)dr["away"];
                    if (score > 0)
                    {
                        dr["victory"] = 3;
                    }
                    else if (score == 0)
                    {
                        dr["victory"] = 1;
                    }
                    else
                    {
                        dr["victory"] = 0;
                    }
                    if (score > float.Parse(dr["pankou1"].ToString()))
                    {
                        dr["win1"] = 3;
                    }
                    else if (score == float.Parse(dr["pankou1"].ToString()))
                    {
                        dr["win1"] = 1;
                    }
                    else
                    {
                        dr["win1"] = 0;
                    }
                    if (score > float.Parse(dr["pankou2"].ToString()))
                    {
                        dr["win2"] = 3;
                    }
                    else if (score == float.Parse(dr["pankou2"].ToString()))
                    {
                        dr["win2"] = 1;
                    }
                    else
                    {
                        dr["win2"] = 0;
                    }
                }
            }
            result.Add("success", true);
            result.Add("totalCount", totalCount);
            string javascriptJson = JsonConvert.SerializeObject(dt, new JavaScriptDateTimeConverter());
            responseText = "{success:true,totalCount:" + totalCount + ",data:" + javascriptJson + "}";
        }
    }