示例#1
0
    private DataTable GetLotteryNumberAnalyse_Save(DataTable dtScheme)
    {
        if (dtScheme == null)
        {
            return null;
        }
        try
        {
            dtScheme.Columns.Add("BetCount", Type.GetType("System.String"));
            dtScheme.Columns.Add("BetWay", Type.GetType("System.String"));
        }
        catch { }
        foreach (DataRow dr in dtScheme.Rows)
        {
            string LotteryNumber = "";

            int BetCount = 0;// 投注场次
            string Odds = "";// 投注赔率
            try
            {
                LotteryNumber = dr["LotteryNumber"].ToString();
                Odds = dr["Odds"].ToString();
            }
            catch
            {
                continue;

            }
            string LotteryNumberResult = "";    // 处理后的结果

            if (String.IsNullOrEmpty(LotteryNumber))
            {
                continue;
            }
            if (LotteryNumber.Split(';').Length != 3)
            {
                continue;
            }

            string PlayType, Content, Way = "";

            try
            {
                PlayType = LotteryNumber.Split(';')[0];
                Content = LotteryNumber.Split(';')[1];
                Way = LotteryNumber.Split(';')[2];
            }
            catch
            {
                continue;
            }

            // 解析Content 
            string[] MatchsAndResult = Content.Substring(1, Content.Length - 1).Split('|');
            // MatchID
            string MatchIDs = "";
            // 胜平负
            string result = "";
            // 周一001
            string MatchNumber = "";

            foreach (string val in MatchsAndResult)
            {
                MatchIDs += val.Split('(')[0] + ",";
                // 去掉尾部')'
                result += val.Split('(')[1].Substring(0, val.Split('(')[1].Length - 1) + ",";
            }

            if (MatchIDs.EndsWith(","))
            {
                MatchIDs = MatchIDs.Substring(0, MatchIDs.Length - 1);
            }
            if (result.EndsWith(","))
            {
                result = result.Substring(0, result.Length - 1);
            }
            if (result.EndsWith(")"))
            {
                result = result.Substring(0, result.Length - 1);
            }

            if (string.IsNullOrEmpty(MatchIDs))
            {
                continue;
            }


            // 通过MatchID 查找内容

            DataTable dtMatch = new DAL.Tables.T_Match().Open("StopSellingTime , MatchNumber", "id in (" + MatchIDs + ")", "");
            if (dtMatch == null)
            {
                continue;
            }
            if (dtMatch.Rows.Count < 1)
            {
                continue;
            }

            foreach (DataRow mdr in dtMatch.Rows)
            {
                if (mdr["MatchNumber"] != null)
                {
                    MatchNumber += mdr["MatchNumber"].ToString() + ",";
                }
                dr["EndTime"] = mdr["StopSellingTime"].ToString();
            }

            if (MatchNumber.EndsWith(","))
            {
                MatchNumber = MatchNumber.Substring(0, MatchNumber.Length - 1);
            }

            // 得到投注场次
            BetCount = MatchIDs.Split(',').Length;

            // 拼接LotteryNumber            
            for (int x = 0; x < MatchIDs.Split(',').Length; x++)
            {
                string m = MatchNumber.Split(',')[x];
                string r = GetResult(result.Split(',')[x], PlayType);
                string o = Odds.Split('|')[x];

                LotteryNumberResult += (m + "[" + r + "]" + o + "  ");
            }

            Way = Way.Split(']')[0].Substring(1);
            Way = Way.Substring(0, Way.Length - 1);
            dr["BetWay"] = GetWay(Way);
            dr["LotteryNumber"] = LotteryNumberResult;
            dr["BetCount"] = BetCount + "";
            string day = Shove._Convert.StrToDateTime(dr["DateTime"].ToString(), DateTime.Now.ToString("yyyy-MM-dd hh:mm:ss")).ToString("yyyy-MM-dd hh:mm:ss");

            dr["DateTime"] = day + "";
            //dr["score"] = Convert.ToInt32(dr["score"]);
        }
        return dtScheme;
    }
示例#2
0
    protected void btnOkoooDownload_txt_Click(object sender, EventArgs e)
    {
        DataTable dt = new DAL.Views.V_Isuses().Open("", "[ID] = " + Shove._Web.Utility.FilteSqlInfusion(ddlIsuse.SelectedValue), "");

        if ((dt == null) || (dt.Rows.Count < 1))
        {
            PF.GoError(ErrorNumber.DataReadWrite, "数据库繁忙,请重试", this.Page.GetType().BaseType.FullName);

            return;
        }

        string FileName = dt.Rows[0]["Code"].ToString() + dt.Rows[0]["Name"].ToString() + ".txt";

        dt = new DAL.Views.V_SchemeSchedules().Open("", "IsuseID = " + Shove._Web.Utility.FilteSqlInfusion(ddlIsuse.SelectedValue) + " and Schedule >= 100 and QuashStatus = 0 and Buyed = 0", "[Money] desc");

        if (dt == null)
        {
            PF.GoError(ErrorNumber.DataReadWrite, "数据库繁忙,请重试", this.Page.GetType().BaseType.FullName);

            return;
        }

        if (dt.Rows.Count < 1)
        {
            Shove._Web.JavaScript.Alert(this.Page, "没有数据。");

            return;
        }

        HttpResponse response;

        response = Page.Response;
        response.AppendHeader("Content-Disposition", "attachment;filename=" + FileName);
        Response.ContentType = "application/ms-txt";
        response.ContentEncoding = System.Text.Encoding.GetEncoding("utf-8");

        string CacheKey = "JCZC_Scheme_Bind";

        DataTable dtMatch = Shove._Web.Cache.GetCacheAsDataTable(CacheKey);

        if (dtMatch == null)
        {
            dtMatch = new DAL.Tables.T_Match().Open("ID, MatchNumber, StopSellingTime", "", "");

            if (dtMatch == null)
            {
                return;
            }

            if (dtMatch.Rows.Count < 1)
            {
                return;
            }

            Shove._Web.Cache.SetCache(CacheKey, dtMatch, 3600);
        }

        foreach (DataRow dr in dt.Rows)
        {
            string LotteryNumber = dr["LotteryNumber"].ToString();
            int PlayTypeID = Shove._Convert.StrToInt(dr["PlayTypeID"].ToString(), 0);

            ArrayList al = new ArrayList();

            string[] strs = LotteryNumber.Split('\n');
            string[] strNumbers = null;

            string CanonicalNumber = "";

            if (strs == null)
                return;
            if (strs.Length == 0)
                return;

            for (int i = 0; i < strs.Length; i++)
            {
                if (string.IsNullOrEmpty(strs[i]))
                {
                    continue;
                }

                strNumbers = new SLS.Lottery()[Shove._Convert.StrToInt(PlayTypeID.ToString().Substring(0, PlayTypeID.ToString().Length - 2), 72)].ToSingle(strs[i], ref CanonicalNumber, PlayTypeID);

                if (strNumbers == null)
                {
                    continue;
                }

                for (int j = 0; j < strNumbers.Length; j++)
                {
                    al.Add(strNumbers[j]);
                }
            }

            string[] LotteryNumbers = new string[al.Count];

            StringBuilder sbLotteryNumbers = new StringBuilder();

            for (int i = 0; i < al.Count; i++)
            {
                if (i == al.Count)
                {
                    sbLotteryNumbers.Append(al[i].ToString());
                }
                else
                {
                    sbLotteryNumbers.Append(al[i].ToString() + "\n");
                }

                LotteryNumbers[i] = al[i].ToString();
            }

            int Multiple = 0;
            string Number = "";
            string BuyWays = "";

            foreach (string str in LotteryNumbers)
            {
                if (string.IsNullOrEmpty(str))
                {
                    continue;
                }

                if (str.Split(';').Length < 3)
                {
                    continue;
                }

                try
                {
                    Multiple = Shove._Convert.StrToInt(str.Split(';')[2].Substring(1, str.Split(';')[2].Length - 2).Substring(2), 1);
                }
                catch
                { }

                Number = str.Split(';')[1].Substring(1, str.Split(';')[1].Length - 2);
                string[] Numbers = Number.Split('|');


                if (Numbers.Length == 1)
                {
                    BuyWays = "单关";
                }
                else
                {
                    BuyWays = Numbers.Length.ToString() + "串1";
                }

                long MatchID = 0;

                response.Write(dr["SchemeNumber"].ToString() + "," + PlayTypeName(PlayTypeID) + ",T,");

                for (int i = 0; i < Numbers.Length; i++)
                {
                    if (Numbers[i].IndexOf("(") < 0)
                    {
                        continue;
                    }

                    MatchID = Shove._Convert.StrToLong(Numbers[i].Substring(0, Numbers[i].IndexOf("(")), 1);

                    DataRow[] drMatch = dtMatch.Select("ID=" + MatchID.ToString());

                    if (drMatch.Length < 1)
                    {
                        continue;
                    }

                    response.Write("(" + GetMatchNumber(drMatch[0]["MatchNumber"].ToString()) + ">" + Getesult(PlayTypeID, Numbers[i].Substring(Numbers[i].IndexOf("(") + 1, Numbers[i].IndexOf(")") - Numbers[i].IndexOf("(") - 1)) + ")");

                }

                response.Write("," + BuyWays + "," + Multiple + "," + (2 * Multiple).ToString() + "\r\n");
            }
        }

        response.End();
    }
示例#3
0
    private void BindData()
    {
        long SchemeID = Shove._Convert.StrToLong(Shove._Web.Utility.GetRequest("id"), -1);

        if (SchemeID < 0)
        {
            PF.GoError(ErrorNumber.Unknow, "参数错误", this.GetType().FullName);

            return;
        }

        DataTable dt = new DAL.Tables.T_Schemes().Open("InitiateUserID,LotteryNumber, PlayTypeID", "SiteID = " + _Site.ID.ToString() + " and [ID] = " + SchemeID.ToString(), "");
      
        if (dt == null)
        {
            PF.GoError(ErrorNumber.DataReadWrite, "数据库繁忙,请重试", this.GetType().FullName);

            return;
        }

        if (dt.Rows.Count < 1)
        {
            PF.GoError(ErrorNumber.Unknow, "参数错误", this.GetType().FullName);

            return;
        }

        long InitiateUserID = Shove._Convert.StrToLong(dt.Rows[0]["InitiateUserID"].ToString(), -1);

        //既不是发起人,也不在招股对象之内
        if (_User != null && !_User.isCanViewSchemeContent(SchemeID))
        {
            PF.GoError(ErrorNumber.Unknow, "对不起,您不在此方案的招股对象之内。", this.GetType().FullName);

            return;
        }

        string LotteryNumber = dt.Rows[0]["LotteryNumber"].ToString();

        if (Shove._Convert.StrToInt(dt.Rows[0]["PlayTypeID"].ToString(), -1) > 7200 && Shove._Convert.StrToInt(dt.Rows[0]["PlayTypeID"].ToString(), -1) < 7300)
        {
            string CacheKey = "JCZC_Scheme_Bind";

            DataTable dtMatch = Shove._Web.Cache.GetCacheAsDataTable(CacheKey);

            if (dtMatch == null)
            {
                dtMatch = new DAL.Tables.T_Match().Open("ID, MatchNumber, StopSellingTime", "", "");

                if(dtMatch == null)
                {
                    return;
                }

                if (dtMatch.Rows.Count < 1)
                {
                    return;
                }

                Shove._Web.Cache.SetCache(CacheKey, dtMatch, 3600);
            }

            string CanonicalNumber = "";
            int PlayTypeID = Shove._Convert.StrToInt(dt.Rows[0]["PlayTypeID"].ToString(), 7201);

            ArrayList al = new ArrayList();

            string[] strs = LotteryNumber.Split('\n');

            if (strs == null)
                return;
            if (strs.Length == 0)
                return;

            string CacheKeyNumbers = "Home_Web_DownloadSchemeFile_" + SchemeID.ToString();

            string[] LotteryNumbers = Shove._Web.Cache.GetCacheAsString(CacheKeyNumbers, "").Split('\n');
            string[] strNumbers = null;

            if (LotteryNumbers.Length < 2)
            {
                for (int i = 0; i < strs.Length; i++)
                {
                    if (string.IsNullOrEmpty(strs[i]))
                    {
                        continue;
                    }

                    strNumbers = new SLS.Lottery()[Shove._Convert.StrToInt(PlayTypeID.ToString().Substring(0, PlayTypeID.ToString().Length - 2), 72)].ToSingle(strs[i], ref CanonicalNumber, PlayTypeID);

                    if (strNumbers == null)
                    {
                        continue;
                    }

                    for (int j = 0; j < strNumbers.Length; j++)
                    {
                        al.Add(strNumbers[j]);
                    }
                }

                LotteryNumbers = new string[al.Count];

                StringBuilder sbLotteryNumbers = new StringBuilder();

                for (int i = 0; i < al.Count; i++)
                {
                    if (i == al.Count)
                    {
                        sbLotteryNumbers.Append(al[i].ToString());
                    }
                    else
                    {
                        sbLotteryNumbers.Append(al[i].ToString() + "\n");
                    }

                    LotteryNumbers[i] = al[i].ToString();
                }

                Shove._Web.Cache.SetCache(CacheKeyNumbers, sbLotteryNumbers.ToString(), 3600);
            }

            StringBuilder sb = new StringBuilder();

            sb.Append("<table width=\"60%\" border=\"0\" align=\"center\" cellpadding=\"2\" cellspacing=\"1\" class=\"BgBlue\">");
            sb.Append("<tr align=\"center\" bgcolor=\"#FFFFFF\" class=\"BlueLightBg WhiteWords\">");
            sb.Append("<td width=\"8%\"><strong>序号</strong></td>");
            sb.Append("<td><strong>过关场次</strong></td>");
            sb.Append("<td width=\"10%\"><strong>过关方式</strong></td>");
            sb.Append("<td width=\"10%\"><strong>注数</strong></td>");
            sb.Append("<td width=\"10%\"><strong>投注金额(元)</strong></td></tr>");

            string Number = "";
            int No = 0;
            string BuyWays = "";

            int Multiple = 0;

            int LotID = 0;
            int PlayID = 0;

            PlayID = Shove._Convert.StrToInt(LotteryNumbers[0].Split(';')[0], 7201);
            LotID = Shove._Convert.StrToInt(PlayID.ToString().Substring(0, 2), 72);

            DateTime EndTime = DateTime.Now;

            int pageindex = 1;
            if (!string.IsNullOrEmpty(Shove._Web.Utility.GetRequest("p")))
            {
                pageindex = Shove._Convert.StrToInt(Shove._Web.Utility.GetRequest("p").ToString(), 1);
            }

            int perPageRowCount = 30;

            if (pageindex < 1)
            {
                pageindex = 1;
            }

            foreach (string str in LotteryNumbers)
            {
                if (string.IsNullOrEmpty(str))
                {
                    continue;
                }

                No++;

                if (str.Split(';').Length < 3)
                {
                    continue;
                }

                try
                {
                    Multiple = Shove._Convert.StrToInt(str.Split(';')[2].Substring(1, str.Split(';')[2].Length - 2).Substring(2), 1);
                }
                catch
                { }

                if ((No < (pageindex - 1) * perPageRowCount) || No > (pageindex) * perPageRowCount)
                {
                    continue;
                }

                sb.Append("<tr align=\"center\" class=\"" + ((No % 2 == 0) ? "BlueWord WhiteBg" : "BlueLightBg2 BlueWord") + "\">");
                sb.Append("<td>" + No.ToString() + "</td>");

                Number = str.Split(';')[1].Substring(1, str.Split(';')[1].Length - 2);
                string[] Numbers = Number.Split('|');

                //if (Numbers.Length < 2)
                //{
                //    continue;
                //}

                sb.Append("<td height=\"20\">");

                if (Numbers.Length == 1)
                {
                    BuyWays = "单关";
                }
                else
                {
                    BuyWays = Numbers.Length.ToString() + "串1";
                }

                long MatchID = 0;

                for (int i = 0; i < Numbers.Length; i++)
                {
                    if (Numbers[i].IndexOf("(") < 0)
                    {
                        continue;
                    }

                    MatchID = Shove._Convert.StrToLong(Numbers[i].Substring(0, Numbers[i].IndexOf("(")), 1);

                    DataRow[] dr = dtMatch.Select("ID=" + MatchID.ToString());

                    if (dr.Length < 1)
                    {
                        continue;
                    }

                    sb.Append(dr[0]["MatchNumber"].ToString() + "->" + PF.Getesult(PlayID.ToString(), Numbers[i].Substring(Numbers[i].IndexOf("(") + 1, Numbers[i].IndexOf(")") - Numbers[i].IndexOf("(") - 1)) + ";");
                }

                sb.Append("</td>");
                sb.Append("<td height=\"20\">" + BuyWays + "</td>");
                sb.Append("<td>1</td>");
                sb.Append("<td>" + (2 * Multiple).ToString() + "</td></tr>");
            }

            sb.Append("</table>");
            labLotteryNumber.Text = sb.ToString();

            StringBuilder sbpage = new StringBuilder();

            int rowCount = No;
            int pageCount = rowCount % perPageRowCount == 0 ? rowCount / perPageRowCount : rowCount / perPageRowCount + 1;

            if (SchemeID < 0)
            {
                sbpage.Append("<div id=\"Pagination\" class=\"yahoo\" style=\"width: auto;\"><span id=\"first\"><a href=\"DownloadSchemeFile.aspx\">首页</a></span>");

                if (pageindex == 1)
                {
                    sbpage.Append("<span class=\"disabled\">« 上一页</span>");
                }
                else
                {
                    sbpage.Append("<span><a href=\"DownloadSchemeFile.aspx?p=" + (pageindex - 1).ToString() + "\">« 上一页</a></span>");
                }

                for (int i = 0; i < pageCount; i++)
                {
                    if (i == pageindex - 1)
                    {
                        sbpage.Append("<span class=\"current\">" + (i + 1).ToString() + "</span>");

                        continue;
                    }

                    if ((i < pageindex + 4 || i < 9) && (i > pageindex - 6 || i > pageCount - 10))
                    {
                        sbpage.Append("<a href=\"DownloadSchemeFile.aspx?p=" + (i + 1).ToString() + "\">" + (i + 1).ToString() + "</a>");
                    }
                }

                if (pageindex == pageCount)
                {
                    sbpage.Append("<span class=\"disabled\">下一页 »</span>");
                }
                else
                {
                    sbpage.Append("<span><a href=\"DownloadSchemeFile.aspx?p=" + (pageindex + 1).ToString() + "\">下一页 »</a></span>");
                }

                sbpage.Append("<span id=\"last\" value=\"" + pageCount.ToString() + "\"><a href=\"DownloadSchemeFile.aspx?p=" + (pageCount).ToString() + "\">尾页</a></span><span class=\"jilu\">共" + pageCount.ToString() + "页," + No.ToString() + "条记录</span></div>");
            }
            else
            {
                sbpage.Append("<div id=\"Pagination\" class=\"yahoo\" style=\"width: auto;\"><span id=\"first\"><a href=\"DownloadSchemeFile.aspx?id=" + SchemeID.ToString() + "\">首页</a></span>");

                if (pageindex == 1)
                {
                    sbpage.Append("<span class=\"disabled\">« 上一页</span>");
                }
                else
                {
                    sbpage.Append("<span><a href=\"DownloadSchemeFile.aspx?id=" + SchemeID.ToString() + "&p=" + (pageindex - 1).ToString() + "\">« 上一页</a></span>");
                }

                for (int i = 0; i < pageCount; i++)
                {
                    if (i == pageindex - 1)
                    {
                        sbpage.Append("<span class=\"current\">" + (i + 1).ToString() + "</span>");

                        continue;
                    }

                    if ((i < pageindex + 4 || i < 9) && (i > pageindex - 6 || i > pageCount - 10))
                    {
                        sbpage.Append("<a href=\"DownloadSchemeFile.aspx?id=" + SchemeID.ToString() + "&p=" + (i + 1).ToString() + "\">" + (i + 1).ToString() + "</a>");
                    }
                }

                if (pageindex == pageCount)
                {
                    sbpage.Append("<span class=\"disabled\">下一页 »</span>");
                }
                else
                {
                    sbpage.Append("<span><a href=\"DownloadSchemeFile.aspx?id=" + SchemeID.ToString() + "&p=" + (pageindex + 1).ToString() + "\">下一页 »</a></span>");
                }

                sbpage.Append("<span id=\"last\" value=\"" + pageCount.ToString() + "\"><a href=\"DownloadSchemeFile.aspx?id=" + SchemeID.ToString() + "&p=" + (pageCount).ToString() + "\">尾页</a></span><span class=\"jilu\">共" + pageCount.ToString() + "页," + No.ToString() + "条记录</span></div>");
            }

            labLotteryNumber.Text += sbpage.ToString();

        }
        else
        {
            LotteryNumber = PF.GetScriptResTable(LotteryNumber);

            if (LotteryNumber.IndexOf("table") < 0)
            {
                LotteryNumber = Shove._Convert.ToHtmlCode(LotteryNumber);
            }

            labLotteryNumber.Text = (LotteryNumber == "") ? "未找到相关数据。" : (LotteryNumber + "&nbsp;");
        }
    }
示例#4
0
    private void Bind(long SchemeID)
    {
        string LotteryNumber = "";
        string[] LotteryNumbers = null;

        string CacheKey = "JCZC_Scheme_Bind";

        DataTable dtMatch = Shove._Web.Cache.GetCacheAsDataTable(CacheKey);

        if (SchemeID < 0)
        {
            string FileName = Request.Cookies["ASP.NET_SessionId"].Value;

            try
            {
                LotteryNumber = File.ReadAllText(System.AppDomain.CurrentDomain.BaseDirectory + "Temp\\" + FileName + ".txt");
            }
            catch { }

            if (string.IsNullOrEmpty(LotteryNumber))
            {
                Shove._Web.JavaScript.Alert(this.Page, "传递的参数错误,请重新发起操作!");

                return;
            }

            LotteryNumbers = LotteryNumber.Replace("\r", "").Split('\n');

            if (dtMatch == null)
            {
                dtMatch = new DAL.Tables.T_PassRate().Open("MatchID, MatchNumber, StopSellTime", "", "");
            }
        }

        if (string.IsNullOrEmpty(LotteryNumber))
        {
            string SchemeInfo = "";

            try
            {
                SchemeInfo = File.ReadAllText(System.AppDomain.CurrentDomain.BaseDirectory + "SchemeInfo\\" + SchemeID.ToString() + ".txt");
            }
            catch { }

            if (string.IsNullOrEmpty(SchemeInfo))
            {
                DataTable dt = new DAL.Tables.T_Schemes().Open("", "ID=" + SchemeID.ToString(), "");

                if (dt == null)
                {
                    Shove._Web.JavaScript.Alert(this.Page, "传递的参数错误,请重新发起操作!");

                    return;
                }

                if (dt.Rows.Count < 1)
                {
                    Shove._Web.JavaScript.Alert(this.Page, "传递的参数错误,请重新发起操作!");

                    return;
                }

                LotteryNumber = dt.Rows[0]["LotteryNumber"].ToString();

                ArrayList al = new ArrayList();

                string[] strs = LotteryNumber.Split('\n');

                if (strs == null)
                    return;
                if (strs.Length == 0)
                    return;

                string CanonicalNumber = "";
                int PlayTypeID = Shove._Convert.StrToInt(dt.Rows[0]["PlayTypeID"].ToString(), 7201);

                string CacheKeyNumbers = "Home_Web_DownloadSchemeFile_" + SchemeID.ToString();

                LotteryNumbers = Shove._Web.Cache.GetCacheAsString(CacheKeyNumbers, "").Split('\n');
                string[] strNumbers = null;

                if (LotteryNumbers.Length < 2)
                {
                    for (int i = 0; i < strs.Length; i++)
                    {
                        if (string.IsNullOrEmpty(strs[i]))
                        {
                            continue;
                        }

                        strNumbers = new SLS.Lottery()[Shove._Convert.StrToInt(PlayTypeID.ToString().Substring(0, PlayTypeID.ToString().Length - 2), 72)].ToSingle(strs[i], ref CanonicalNumber, PlayTypeID);

                        if (strNumbers == null)
                        {
                            continue;
                        }

                        for (int j = 0; j < strNumbers.Length; j++)
                        {
                            al.Add(strNumbers[j]);
                        }
                    }

                    LotteryNumbers = new string[al.Count];

                    StringBuilder sbLotteryNumbers = new StringBuilder();

                    for (int i = 0; i < al.Count; i++)
                    {
                        if (i == al.Count)
                        {
                            sbLotteryNumbers.Append(al[i].ToString());
                        }
                        else
                        {
                            sbLotteryNumbers.Append(al[i].ToString() + "\n");
                        }

                        LotteryNumbers[i] = al[i].ToString();
                    }

                    Shove._Web.Cache.SetCache(CacheKeyNumbers, sbLotteryNumbers.ToString(), 3600);
                }

                if (dtMatch == null)
                {
                    dtMatch = new DAL.Tables.T_Match().Open("ID as MatchID, MatchNumber, StopSellingTime as StopSellTime", "", "");
                }
            }
            else
            {
                LotteryNumber = SchemeInfo.Substring(0, SchemeInfo.LastIndexOf('$') - 1);

                LotteryNumbers = LotteryNumber.Replace("\r", "").Split('\n');

                if (dtMatch == null)
                {
                    dtMatch = new DAL.Tables.T_PassRate().Open("MatchID, MatchNumber, StopSellTime", "MatchID in (" + SchemeInfo.Substring(SchemeInfo.LastIndexOf('$')) + ")", "");
                }
            }
        }

        if (dtMatch == null)
        {
            Shove._Web.JavaScript.Alert(this.Page, "传递的参数错误,请重新发起操作!");

            return;
        }

        if (dtMatch.Rows.Count < 1)
        {
            return;
        }

        Shove._Web.Cache.SetCache(CacheKey, dtMatch, 3600);

        StringBuilder sb = new StringBuilder();

        sb.Append("<table width=\"60%\" border=\"0\" align=\"center\" cellpadding=\"2\" cellspacing=\"1\" class=\"BgBlue\">");
        sb.Append("<tr align=\"center\" bgcolor=\"#FFFFFF\" class=\"BlueLightBg WhiteWords\">");
        sb.Append("<td width=\"8%\"><strong>序号</strong></td>");
        sb.Append("<td><strong>过关场次</strong></td>");
        sb.Append("<td width=\"10%\"><strong>过关方式</strong></td>");
        sb.Append("<td width=\"10%\"><strong>注数</strong></td>");
        sb.Append("<td width=\"10%\"><strong>投注金额(元)</strong></td></tr>");

        string Number = "";
        int No = 0;
        string BuyWays = "";

        int Multiple = 0;

        int LotID = 0;
        int PlayID = 0;

        PlayID = Shove._Convert.StrToInt(LotteryNumbers[0].Split(';')[0], 7201);
        LotID = Shove._Convert.StrToInt(PlayID.ToString().Substring(0, 2), 72);

        DateTime EndTime = DateTime.Now;

        int pageindex = 1;
        if (!string.IsNullOrEmpty(Shove._Web.Utility.GetRequest("p")))
        {
            pageindex = Shove._Convert.StrToInt(Shove._Web.Utility.GetRequest("p").ToString(), 1);
        }

        int perPageRowCount = 30;

        if (pageindex < 1)
        {
            pageindex = 1;
        }

        foreach (string str in LotteryNumbers)
        {
            if (string.IsNullOrEmpty(str))
            {
                continue;
            }

            No++;

            if (str.Split(';').Length < 3)
            {
                continue;
            }

            try
            {
                Multiple = Shove._Convert.StrToInt(str.Split(';')[2].Substring(1, str.Split(';')[2].Length - 2).Substring(2), 1);
            }
            catch
            { }

            if ((No < (pageindex - 1) * perPageRowCount) || No > (pageindex) * perPageRowCount)
            {
                continue;
            }

            sb.Append("<tr align=\"center\" class=\"" + ((No % 2 == 0) ? "BlueWord WhiteBg" : "BlueLightBg2 BlueWord") + "\">");
            sb.Append("<td>" + No.ToString() + "</td>");

            Number = str.Split(';')[1].Substring(1, str.Split(';')[1].Length - 2);
            string[] Numbers = Number.Split('|');

            if (Numbers.Length < 2)
            {
                continue;
            }

            sb.Append("<td height=\"20\">");

            BuyWays = Numbers.Length.ToString() + "串1";

            long MatchID = 0;

            for (int i = 0; i < Numbers.Length; i++)
            {
                if (Numbers[i].IndexOf("(") < 0)
                {
                    continue;
                }

                MatchID = Shove._Convert.StrToLong(Numbers[i].Substring(0, Numbers[i].IndexOf("(")), 1);

                DataRow[] dr = dtMatch.Select("MatchID=" + MatchID.ToString());

                if (dr.Length < 1)
                {
                    continue;
                }

                sb.Append(dr[0]["MatchNumber"].ToString() + "->" + PF.Getesult(PlayID.ToString(), Numbers[i].Substring(Numbers[i].IndexOf("(") + 1, Numbers[i].IndexOf(")") - Numbers[i].IndexOf("(") - 1)) + ";");
            }

            sb.Append("</td>");
            sb.Append("<td height=\"20\">" + BuyWays + "</td>");
            sb.Append("<td>1</td>");
            sb.Append("<td>" + (2 * Multiple).ToString() + "</td></tr>");
        }

        sb.Append("</table>");
        labLotteryNumber.Text = sb.ToString();

        StringBuilder sbpage = new StringBuilder();

        int rowCount = No;
        int pageCount = rowCount % perPageRowCount == 0 ? rowCount / perPageRowCount : rowCount / perPageRowCount + 1;

        if (SchemeID < 0)
        {
            sbpage.Append("<div id=\"Pagination\" class=\"yahoo\" style=\"width: auto;\"><span id=\"first\"><a href=\"Scheme.aspx\">首页</a></span>");

            if (pageindex == 1)
            {
                sbpage.Append("<span class=\"disabled\">« 上一页</span>");
            }
            else
            {
                sbpage.Append("<span><a href=\"Scheme.aspx?p=" + (pageindex - 1).ToString() + "\">« 上一页</a></span>");
            }

            for (int i = 0; i < pageCount; i++)
            {
                if (i == pageindex - 1)
                {
                    sbpage.Append("<span class=\"current\">" + (i + 1).ToString() + "</span>");

                    continue;
                }

                if ((i < pageindex + 4 || i < 9) && (i > pageindex - 6 || i > pageCount - 10))
                {
                    sbpage.Append("<a href=\"Scheme.aspx?p=" + (i + 1).ToString() + "\">" + (i + 1).ToString() + "</a>");
                }
            }

            if (pageindex == pageCount)
            {
                sbpage.Append("<span class=\"disabled\">下一页 »</span>");
            }
            else
            {
                sbpage.Append("<span><a href=\"Scheme.aspx?p=" + (pageindex + 1).ToString() + "\">下一页 »</a></span>");
            }

            sbpage.Append("<span id=\"last\" value=\"" + pageCount.ToString() + "\"><a href=\"Scheme.aspx?p=" + (pageCount).ToString() + "\">尾页</a></span><span class=\"jilu\">共" + pageCount.ToString() + "页," + No.ToString() + "条记录</span></div>");
        }
        else
        {
            sbpage.Append("<div id=\"Pagination\" class=\"yahoo\" style=\"width: auto;\"><span id=\"first\"><a href=\"Scheme.aspx?id="+ SchemeID.ToString() +"\">首页</a></span>");

            if (pageindex == 1)
            {
                sbpage.Append("<span class=\"disabled\">« 上一页</span>");
            }
            else
            {
                sbpage.Append("<span><a href=\"Scheme.aspx?id=" + SchemeID.ToString() + "&p=" + (pageindex - 1).ToString() + "\">« 上一页</a></span>");
            }

            for (int i = 0; i < pageCount; i++)
            {
                if (i == pageindex - 1)
                {
                    sbpage.Append("<span class=\"current\">" + (i + 1).ToString() + "</span>");

                    continue;
                }

                if ((i < pageindex + 4 || i < 9) && (i > pageindex - 6 || i > pageCount - 10))
                {
                    sbpage.Append("<a href=\"Scheme.aspx?id=" + SchemeID.ToString() + "&p=" + (i + 1).ToString() + "\">" + (i + 1).ToString() + "</a>");
                }
            }

            if (pageindex == pageCount)
            {
                sbpage.Append("<span class=\"disabled\">下一页 »</span>");
            }
            else
            {
                sbpage.Append("<span><a href=\"Scheme.aspx?id=" + SchemeID.ToString() + "&p=" + (pageindex + 1).ToString() + "\">下一页 »</a></span>");
            }

            sbpage.Append("<span id=\"last\" value=\"" + pageCount.ToString() + "\"><a href=\"Scheme.aspx?id=" + SchemeID.ToString() + "&p=" + (pageCount).ToString() + "\">尾页</a></span><span class=\"jilu\">共" + pageCount.ToString() + "页," + No.ToString() + "条记录</span></div>");
        }

        labLotteryNumber.Text += sbpage.ToString();
    }
示例#5
0
    private DataTable GetUserNewBetContent(DataTable dtNewUserMessage)
    {
        try
        {
            dtNewUserMessage.Columns.Add("BetWay", Type.GetType("System.String"));
            dtNewUserMessage.Columns.Add("BetCount", Type.GetType("System.String"));
        }
        catch { }

        foreach (DataRow dr in dtNewUserMessage.Rows)
        {
            string LotteryNumber = "";

            int BetCount = 0;// 投注场次
            string Odds = "";// 投注赔率
            try
            {
                LotteryNumber = dr["LotteryNumber"].ToString();

                Odds = dr["Odds"].ToString();
            }
            catch
            {
                continue;

            }
            string LotteryNumberResult = "";    // 处理后的结果

            if (String.IsNullOrEmpty(LotteryNumber))
            {
                continue;
            }
            if (LotteryNumber.Split(';').Length != 3)
            {
                continue;
            }

            string PlayType, Content, Way = "";

            try
            {
                PlayType = LotteryNumber.Split(';')[0];
                Content = LotteryNumber.Split(';')[1];
                Way = LotteryNumber.Split(';')[2];
            }
            catch
            {
                continue;
            }

            // 解析Content 
            string[] MatchsAndResult = Content.Substring(1, Content.Length - 1).Split('|');
            // MatchID
            string MatchIDs = "";
            // 胜平负
            string result = "";
            // 周一001
            string MatchNumber = "";

            foreach (string val in MatchsAndResult)
            {
                MatchIDs += val.Split('(')[0] + ",";
                // 去掉尾部')'
                result += val.Split('(')[1].Substring(0, val.Split('(')[1].Length - 1) + ",";
            }

            if (MatchIDs.EndsWith(","))
            {
                MatchIDs = MatchIDs.Substring(0, MatchIDs.Length - 1);
            }
            if (result.EndsWith(","))
            {
                result = result.Substring(0, result.Length - 1);
            }
            if (result.EndsWith(")"))
            {
                result = result.Substring(0, result.Length - 1);
            }

            if (string.IsNullOrEmpty(MatchIDs))
            {
                continue;
            }


            // 通过MatchID 查找内容

            DataTable dtMatch = new DAL.Tables.T_Match().Open("MatchNumber", "id in (" + MatchIDs + ")", "");
            if (dtMatch == null)
            {
                continue;
            }
            if (dtMatch.Rows.Count < 1)
            {
                continue;
            }

            foreach (DataRow mdr in dtMatch.Rows)
            {
                if (mdr["MatchNumber"] != null)
                {
                    MatchNumber += mdr["MatchNumber"].ToString() + ",";
                }
            }

            if (MatchNumber.EndsWith(","))
            {
                MatchNumber = MatchNumber.Substring(0, MatchNumber.Length - 1);
            }

            // 得到投注场次
            BetCount = MatchIDs.Split(',').Length;

            // 拼接LotteryNumber            
            for (int x = 0; x < MatchIDs.Split(',').Length; x++)
            {
                string m = MatchNumber.Split(',')[x];
                string r = GetResult(result.Split(',')[x], PlayType);
                string o = Odds.Split('|')[x];

                LotteryNumberResult += (m + "[" + r + "]" + o + "  ");
            }

            Way = Way.Split(']')[0].Substring(1);
            Way = Way.Substring(0, Way.Length - 1);
            dr["BetWay"] = GetWay(Way);

            dr["LotteryNumber"] = LotteryNumberResult;
            dr["BetCount"] = BetCount + "";

        }
        return dtNewUserMessage;
    }
示例#6
0
    public static string GetScriptResTable(string val)
    {
        try
        {
            string way = GetPassWay(val);               //得到过关方式

            StringBuilder sb = new StringBuilder();

            val = val.Trim();

            int Istart, Ilen;

            GetStrScope(val, "[", "]", out Istart, out Ilen);

            string matchlist = val.Substring(Istart + 1, Ilen - 1);

            string type = val.Split(';')[0];

            if (type.Substring(0, 2) != "72" && type.Substring(0, 2) != "73")
            {
                return val;
            }

            int PlayTypeID = Shove._Convert.StrToInt(val.Split(';')[0], 7201);

            if (type.Substring(0, 2) == "72")
            {
                sb.Append("<div class=\"tdbback\"><table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\" class=\"tablelay\">");
                sb.Append("<th scope='col' width='60'>赛事编号</th>");
                sb.Append("<th scope='col' width='100'>联赛</th><th scope='col' width='150'>主队 VS 客队</th>");
                sb.Append("<th scope='col' width='150'>预计停售时间</th><th scope='col' width='50'>设胆</th><th scope='col'>投注内容</th><th scope='col'>赛果</th>");
            }
            else
            {
                sb.Append("<div class=\"tdbback\"><table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\" class=\"tablelay\">");
                sb.Append("<th scope='col' width='60'>赛事编号</th>");
                sb.Append("<th scope='col' width='100'>联赛</th><th scope='col' width='150'>客队 VS 主队</th>");
                sb.Append("<th scope='col' width='150'>预计停售时间</th><th scope='col' width='50'>设胆</th><th scope='col'>投注内容</th><th scope='col'>赛果</th>");
            }

            string Matchids = "";
            string[] ArrRes = null;
            string MatchListDan = "";
            string MatchidsDan = "";

            DataTable dtMatch = new DataTable();

            dtMatch.Columns.Add("MatchID", typeof(System.String));
            dtMatch.Columns.Add("PlayType", typeof(System.String));

            if (val.Split(';').Length == 4)
            {
                MatchListDan = matchlist.Split(']')[0];
                matchlist = matchlist.Split('[')[1];

                foreach (string match in MatchListDan.Split('|'))
                {
                    DataRow dr = dtMatch.NewRow();

                    dr["MatchID"] = match.Split('(')[0];
                    dr["PlayType"] = match.Split('(')[1].Substring(0, match.Split('(')[1].LastIndexOf(')'));

                    MatchidsDan += match.Split('(')[0] + ",";
                    Matchids += match.Split('(')[0] + ",";

                    dtMatch.Rows.Add(dr);
                    dtMatch.AcceptChanges();
                }

                if (MatchidsDan.EndsWith(","))
                {
                    MatchidsDan = MatchidsDan.Substring(0, MatchidsDan.Length - 1);
                }

                if (string.IsNullOrEmpty(MatchidsDan))
                {
                    return val;
                }
            }

            foreach (string match in matchlist.Split('|'))
            {
                DataRow dr = dtMatch.NewRow();

                dr["MatchID"] = match.Split('(')[0];
                dr["PlayType"] = match.Split('(')[1].Substring(0, match.Split('(')[1].LastIndexOf(')'));

                Matchids += match.Split('(')[0] + ",";

                dtMatch.Rows.Add(dr);
                dtMatch.AcceptChanges();
            }

            if (Matchids.EndsWith(","))
            {
                Matchids = Matchids.Substring(0, Matchids.Length - 1);
            }

            if (string.IsNullOrEmpty(Matchids))
            {
                return val;
            }

            DataTable table = null;

            if (type.Substring(0, 2) == "72")
            {
                string SQL = "game,mainteam +'VS'+guestteam teamname,MatchNumber,DATEADD(minute, (select SystemEndAheadMinute from T_PlayTypes where id = " + PlayTypeID + ") * -1, StopSellingTime) date, id";

                switch (PlayTypeID)
                {
                    case 7201:
                        {
                            SQL += ", SPFResult as Result";
                        }
                        break;
                    case 7202:
                        {
                            SQL += ", ZQBFResult  as Result";
                        }
                        break;
                    case 7203:
                        {
                            SQL += ",ZJQSResult  as Result ";
                        }
                        break;
                    case 7204:
                        {
                            SQL += ", BQCResult as Result ";
                        }
                        break;
                }

                table = new DAL.Tables.T_Match().Open(SQL, "id in (" + Matchids + ")", "");
            }
            else
            {
                string SQL = "game,guestteam +'VS'+mainteam teamname,MatchNumber,DATEADD(minute, (select SystemEndAheadMinute from T_PlayTypes where id = " + PlayTypeID + ") * -1, StopSellingTime) date, id";

                switch (PlayTypeID)
                {
                    case 7301:
                        {
                            SQL += ", SFResult as Result";
                        }
                        break;
                    case 7302:
                        {
                            SQL += ", RFSFResult  as Result";
                        }
                        break;
                    case 7303:
                        {
                            SQL += ",SFCResult  as Result ";
                        }
                        break;
                    case 7304:
                        {
                            SQL += ", DXResult as Result ";
                        }
                        break;
                }

                table = new DAL.Tables.T_MatchBasket().Open(SQL, "id in (" + Matchids + ")", "");
            }

            if (table == null)
            {
                return val;
            }

            if (table.Rows.Count < 1)
            {
                return val;
            }

            string res = "";
            string Result = "";

            foreach (DataRow dr in table.Rows)
            {
                sb.Append("<tr class=\"trbg2\" bgcolor=\"#ffffff\"><td>" + dr["MatchNumber"].ToString() + "</td><td>" + dr["game"].ToString() + "</td><td>" + dr["teamname"].ToString() + "</td><td>" + Shove._Convert.StrToDateTime(dr["date"].ToString(), DateTime.Now.ToString()).ToString("yy-MM-dd HH:mm") + "</td>");
                sb.Append("<td>");

                if (MatchidsDan.IndexOf(dr["id"].ToString()) >= 0)
                {
                    sb.Append("是");
                }

                sb.Append("</td>");

                res = dtMatch.Select("MatchID='" + dr["id"].ToString() + "'")[0]["PlayType"].ToString();

                ArrRes = res.Split(',');
                sb.Append("<td>");

                foreach (string r in ArrRes)
                {
                    Result = Getesult(type, r);
                    if (Result.Equals(dr["Result"].ToString()))
                    {
                        Result = "<span class=\"red eng\">" + Result + "</span>";
                    }

                    sb.Append(Result + " ");
                }

                sb.Append("</td><td><span class=\"red eng\">" + dr["Result"].ToString() + "</span>");
                sb.Append("</td></tr>");
            }

            sb.Append("</table></div>");
            sb.Append("<div style=\"text-align:center;width:660px;\">过关方式:" + way + "</div>");

            return sb.ToString();
        }
        catch (System.Exception ex)
        {
            new Log("TWZT").Write(ex.Message);

            return val;
        }
    }
示例#7
0
    /// <summary>
    /// 处理 方案
    /// </summary>
    /// <param name="dtNewUserMessage"></param>
    private void GetUserNewBetContent(DataTable dtNewUserMessage)
    {

        try
        {
            dtNewUserMessage.Columns.Add("BetWay", Type.GetType("System.String"));
            dtNewUserMessage.Columns.Add("BetCount", Type.GetType("System.String"));
        }
        catch { }

        foreach (DataRow dr in dtNewUserMessage.Rows)
        {
            string LotteryNumber = "";

            int BetCount = 0;// 投注场次
            string Odds = "";// 投注赔率
            try
            {
                LotteryNumber = dr["LotteryNumber"].ToString();

                Odds = dr["Odds"].ToString();
            }
            catch
            {
                continue;

            }
            string LotteryNumberResult = "";    // 处理后的结果

            if (String.IsNullOrEmpty(LotteryNumber))
            {
                continue;
            }
            if (LotteryNumber.Split(';').Length != 3)
            {
                continue;
            }

            string PlayType, Content, Way = "";

            try
            {
                PlayType = LotteryNumber.Split(';')[0];
                Content = LotteryNumber.Split(';')[1];
                Way = LotteryNumber.Split(';')[2];
            }
            catch
            {
                continue;
            }

            // 解析Content 
            string[] MatchsAndResult = Content.Substring(1, Content.Length - 1).Split('|');
            // MatchID
            string MatchIDs = "";
            // 胜平负
            string result = "";
            // 周一001
            string MatchNumber = "";

            foreach (string val in MatchsAndResult)
            {
                MatchIDs += val.Split('(')[0] + ",";
                // 去掉尾部')'
                result += val.Split('(')[1].Substring(0, val.Split('(')[1].Length - 1) + ",";
            }

            if (MatchIDs.EndsWith(","))
            {
                MatchIDs = MatchIDs.Substring(0, MatchIDs.Length - 1);
            }
            if (result.EndsWith(","))
            {
                result = result.Substring(0, result.Length - 1);
            }
            if (result.EndsWith(")"))
            {
                result = result.Substring(0, result.Length - 1);
            }

            if (string.IsNullOrEmpty(MatchIDs))
            {
                continue;
            }


            // 通过MatchID 查找内容

            DataTable dtMatch = new DAL.Tables.T_Match().Open("MatchNumber", "id in (" + MatchIDs + ")", "");
            if (dtMatch == null)
            {
                continue;
            }
            if (dtMatch.Rows.Count < 1)
            {
                continue;
            }

            foreach (DataRow mdr in dtMatch.Rows)
            {
                if (mdr["MatchNumber"] != null)
                {
                    MatchNumber += mdr["MatchNumber"].ToString() + ",";
                }
            }

            if (MatchNumber.EndsWith(","))
            {
                MatchNumber = MatchNumber.Substring(0, MatchNumber.Length - 1);
            }

            // 得到投注场次
            BetCount = MatchIDs.Split(',').Length;

            // 拼接LotteryNumber            
            for (int x = 0; x < MatchIDs.Split(',').Length; x++)
            {
                string m = MatchNumber.Split(',')[x];
                string r = GetResult(result.Split(',')[x], PlayType);
                string o = Odds.Split('|')[x];

                LotteryNumberResult += (m + "[" + r + "]" + o + "  ");
            }

            Way = Way.Split(']')[0].Substring(1);
            Way = Way.Substring(0, Way.Length - 1);
            dr["BetWay"] = GetWay(Way);

            dr["LotteryNumber"] = LotteryNumberResult;
            dr["BetCount"] = BetCount + "";

        }

        // 筛选
        if (!string.IsNullOrEmpty(userName) || !string.IsNullOrEmpty(datetime))
        {
            DataTable dtt = new DataTable();
            dtt = dtNewUserMessage.Clone();//拷贝框架

            if (userName.Equals("输入用户名"))
            {
                userName = "";
            }


            DataRow[] drs = dtNewUserMessage.Select("DateTime > '" + datetime + " 0:00:00' and  DateTime < '" + datetime + " 23:59:59' and Name like '%" + userName + "%'");
            for (int i = 0; i < drs.Length; i++)
            {
                dtt.ImportRow((DataRow)drs[i]);//这一句再确认一下。呵呵
            }

            dtNewUserMessage = dtt;
        }

        SetPagePaging(dtNewUserMessage);
    }
示例#8
0
    public string GetScriptResTable(string val)
    {
        try
        {
            val = val.Trim();

            int Istart, Ilen;

            GetStrScope(val, "[", "]", out Istart, out Ilen);

            string matchlist = val.Substring(Istart + 1, Ilen - 1);

            string type = val.Split(';')[0];

            if (type.Substring(0, 2) != "72" && type.Substring(0, 2) != "73")
            {
                return val;
            }

            string Matchids = "";
            string MatchListDan = "";

            if (val.Split(';').Length == 4)
            {
                MatchListDan = matchlist.Split(']')[0];

                foreach (string match in MatchListDan.Split('|'))
                {
                    Matchids += match.Split('(')[0] + ",";
                }
            }

            foreach (string match in matchlist.Split('|'))
            {
                Matchids += match.Split('(')[0] + ",";
            }

            if (Matchids.EndsWith(","))
            {
                Matchids = Matchids.Substring(0, Matchids.Length - 1);
            }

            DataTable table = null;

            if (type.Substring(0, 2) == "72")
            {
                table = new DAL.Tables.T_Match().Open("StopSellingTime", "id in (" + Matchids + ")", " StopSellingTime ");
            }
            else
            {
                table = new DAL.Tables.T_MatchBasket().Open("StopSellingTime", "id in (" + Matchids + ")", " StopSellingTime");
            }

            if (table.Rows.Count < 1)
            {
                return "";
            }

            DataTable dtPlayType = new DAL.Tables.T_PlayTypes().Open("SystemEndAheadMinute", "ID=" + type.Substring(0, 4), "");

            if (dtPlayType == null)
            {
                return "";
            }

            if (dtPlayType.Rows.Count < 1)
            {
                return "";
            }

            return Shove._Convert.StrToDateTime(table.Rows[0]["StopSellingTime"].ToString(), DateTime.Now.AddDays(-1).ToString()).AddMinutes(Shove._Convert.StrToInt(dtPlayType.Rows[0]["SystemEndAheadMinute"].ToString(), 0) * -1).ToString();
        }
        catch {
            return "";
        }
    }