protected void Page_Load(object sender, EventArgs e) { Master.Title = "完场数据分析"; int ptype = Utils.ParseInt(Utils.GetRequest("ptype", "get", 1, @"^[1-2]$", "1")); int showtype = Utils.ParseInt(Utils.GetRequest("showtype", "get", 1, @"^[0-3]$", "0")); if (showtype == 0) { builder.Append(Out.Tab("<div class=\"title\">", "")); builder.Append("完场数据分析(不含串串、已排除机器人投注)"); builder.Append(Out.Tab("</div>", "<br />")); builder.Append(Out.Tab("<div class=\"text\">", "")); if (ptype == 1) { builder.Append("当前统计:足球 " + Out.waplink(Utils.getUrl("stats.aspx?ptype=2"), "切换篮球")); } else { builder.Append("当前统计:篮球 " + Out.waplink(Utils.getUrl("stats.aspx?ptype=1"), "切换足球")); } builder.Append(Out.Tab("</div>", "<br />")); //统计今天 int todaycsNum, todayzsNum, todaywinNum; long todayzsCent, todaywinCent; todaycsNum = new TPR2.BLL.guess.BaList().GetBaListCount("p_type=" + ptype + " and Year(p_addtime)=" + DateTime.Now.Year + " AND Month(p_addtime) = " + DateTime.Now.Month + " and Day(p_addtime) = " + DateTime.Now.Day + " and p_active<>0"); todayzsNum = new TPR2.BLL.guess.BaPay().GetBaPayCount("isrobot=0 and ptype=" + ptype + " and Year(paytimes) = " + DateTime.Now.Year + " AND Month(paytimes) = " + DateTime.Now.Month + " and Day(paytimes) = " + DateTime.Now.Day + " and p_active<>0"); todaywinNum = new TPR2.BLL.guess.BaPay().GetBaPayCount("isrobot=0 and ptype=" + ptype + " and Year(paytimes) = " + DateTime.Now.Year + " AND Month(paytimes) = " + DateTime.Now.Month + " and Day(paytimes) = " + DateTime.Now.Day + " and p_getMoney>0 and p_active<>0"); todayzsCent = new TPR2.BLL.guess.BaPay().GetBaPaypayCent("isrobot=0 and ptype=" + ptype + " and Year(paytimes) = " + DateTime.Now.Year + " AND Month(paytimes) = " + DateTime.Now.Month + " and Day(paytimes) = " + DateTime.Now.Day + " and p_active<>0"); todaywinCent = new TPR2.BLL.guess.BaPay().GetBaPaygetMoney("isrobot=0 and ptype=" + ptype + " and Year(paytimes) = " + DateTime.Now.Year + " AND Month(paytimes) = " + DateTime.Now.Month + " and Day(paytimes) = " + DateTime.Now.Day + " and p_getMoney>0 and p_active<>0"); //统计昨天 int yestcsNum, yestzsNum, yestwinNum; long yestzsCent, yestwinCent; yestcsNum = new TPR2.BLL.guess.BaList().GetBaListCount("p_type=" + ptype + " and Year(p_addtime)=" + DateTime.Now.AddDays(-1).Year + " AND Month(p_addtime) = " + DateTime.Now.AddDays(-1).Month + " and Day(p_addtime) = " + DateTime.Now.AddDays(-1).Day + " and p_active<>0"); yestzsNum = new TPR2.BLL.guess.BaPay().GetBaPayCount("isrobot=0 and ptype=" + ptype + " and Year(paytimes) = " + DateTime.Now.AddDays(-1).Year + " AND Month(paytimes) = " + DateTime.Now.AddDays(-1).Month + " and Day(paytimes) = " + DateTime.Now.AddDays(-1).Day + " and p_active<>0"); yestwinNum = new TPR2.BLL.guess.BaPay().GetBaPayCount("isrobot=0 and ptype=" + ptype + " and Year(paytimes) = " + DateTime.Now.AddDays(-1).Year + " AND Month(paytimes) = " + DateTime.Now.AddDays(-1).Month + " and Day(paytimes) = " + DateTime.Now.AddDays(-1).Day + " and p_getMoney>0 and p_active<>0"); yestzsCent = new TPR2.BLL.guess.BaPay().GetBaPaypayCent("isrobot=0 and ptype=" + ptype + " and Year(paytimes) = " + DateTime.Now.AddDays(-1).Year + " AND Month(paytimes) = " + DateTime.Now.AddDays(-1).Month + " and Day(paytimes) = " + DateTime.Now.AddDays(-1).Day + " and p_active<>0"); yestwinCent = new TPR2.BLL.guess.BaPay().GetBaPaygetMoney("isrobot=0 and ptype=" + ptype + " and Year(paytimes) = " + DateTime.Now.AddDays(-1).Year + " AND Month(paytimes) = " + DateTime.Now.AddDays(-1).Month + " and Day(paytimes) = " + DateTime.Now.AddDays(-1).Day + " and p_getMoney>0 and p_active<>0"); //统计本月 int bmcsNum, bmzsNum, bmwinNum; long bmzsCent, bmwinCent; bmcsNum = new TPR2.BLL.guess.BaList().GetBaListCount("p_type=" + ptype + " and Year(p_addtime)=" + (DateTime.Now.Year) + " AND Month(p_addtime) = " + (DateTime.Now.Month) + " and p_active<>0"); bmzsNum = new TPR2.BLL.guess.BaPay().GetBaPayCount("isrobot=0 and ptype=" + ptype + " and Year(paytimes) = " + (DateTime.Now.Year) + " AND Month(paytimes) = " + (DateTime.Now.Month) + " and p_active<>0"); bmwinNum = new TPR2.BLL.guess.BaPay().GetBaPayCount("isrobot=0 and ptype=" + ptype + " and Year(paytimes) = " + (DateTime.Now.Year) + " AND Month(paytimes) = " + (DateTime.Now.Month) + " and p_getMoney>0 and p_active<>0"); bmzsCent = new TPR2.BLL.guess.BaPay().GetBaPaypayCent("isrobot=0 and ptype=" + ptype + " and Year(paytimes) = " + (DateTime.Now.Year) + " AND Month(paytimes) = " + (DateTime.Now.Month) + " and p_active<>0"); bmwinCent = new TPR2.BLL.guess.BaPay().GetBaPaygetMoney("isrobot=0 and ptype=" + ptype + " and Year(paytimes) = " + (DateTime.Now.Year) + " AND Month(paytimes) = " + (DateTime.Now.Month) + " and p_getMoney>0 and p_active<>0"); //统计上月 int smcsNum, smzsNum, smwinNum; long smzsCent, smwinCent; smcsNum = new TPR2.BLL.guess.BaList().GetBaListCount("p_type=" + ptype + " and Year(p_addtime)=" + (DateTime.Now.Year - DateTime.Now.Day) + " AND Month(p_addtime) = " + (DateTime.Now.Month - DateTime.Now.Day) + " and p_active<>0"); smzsNum = new TPR2.BLL.guess.BaPay().GetBaPayCount("isrobot=0 and ptype=" + ptype + " and Year(paytimes) = " + (DateTime.Now.Year - DateTime.Now.Day) + " AND Month(paytimes) = " + (DateTime.Now.Month - DateTime.Now.Day) + " and p_active<>0"); smwinNum = new TPR2.BLL.guess.BaPay().GetBaPayCount("isrobot=0 and ptype=" + ptype + " and Year(paytimes) = " + (DateTime.Now.Year - DateTime.Now.Day) + " AND Month(paytimes) = " + (DateTime.Now.Month - DateTime.Now.Day) + " and p_getMoney>0 and p_active<>0"); smzsCent = new TPR2.BLL.guess.BaPay().GetBaPaypayCent("isrobot=0 and ptype=" + ptype + " and Year(paytimes) = " + (DateTime.Now.Year - DateTime.Now.Day) + " AND Month(paytimes) = " + (DateTime.Now.Month - DateTime.Now.Day) + " and p_active<>0"); smwinCent = new TPR2.BLL.guess.BaPay().GetBaPaygetMoney("isrobot=0 and ptype=" + ptype + " and Year(paytimes) = " + (DateTime.Now.Year - DateTime.Now.Day) + " AND Month(paytimes) = " + (DateTime.Now.Month - DateTime.Now.Day) + " and p_getMoney>0 and p_active<>0"); //总计 int csNum, zsNum, winNum; long zsCent, winCent; csNum = new TPR2.BLL.guess.BaList().GetBaListCount("p_type=" + ptype + " and p_active<>0"); zsNum = new TPR2.BLL.guess.BaPay().GetBaPayCount("isrobot=0 and ptype=" + ptype + " and p_active<>0"); winNum = new TPR2.BLL.guess.BaPay().GetBaPayCount("isrobot=0 and ptype=" + ptype + " and p_getMoney>0 and p_active<>0"); zsCent = new TPR2.BLL.guess.BaPay().GetBaPaypayCent("isrobot=0 and ptype=" + ptype + " and p_active<>0"); winCent = new TPR2.BLL.guess.BaPay().GetBaPaygetMoney("isrobot=0 and ptype=" + ptype + " and p_getMoney>0 and p_active<>0"); builder.Append(Out.Tab("<div>", "")); builder.Append("<table border=\"1\" cellpadding=\"3\" cellspacing=\"0\">"); builder.Append("<tr>"); builder.Append("<td>类别</td><td>场次</td><td>下注数</td><td>下注额</td><td>用户赢注数</td><td>用户赢金额</td><td>本站盈利</td>"); builder.Append("</tr>"); builder.Append("<tr>"); builder.Append("<td>今天</td><td>" + todaycsNum + "</td><td>" + todayzsNum + "</td><td>" + todayzsCent + "</td><td>" + todaywinNum + "</td><td>" + todaywinCent + "</td><td>" + (todayzsCent - todaywinCent) + "</td>"); builder.Append("</tr>"); builder.Append("<tr>"); builder.Append("<td>昨天</td><td>" + yestcsNum + "</td><td>" + yestzsNum + "</td><td>" + yestzsCent + "</td><td>" + yestwinNum + "</td><td>" + yestwinCent + "</td><td>" + (yestzsCent - yestwinCent) + "</td>"); builder.Append("</tr>"); builder.Append("<tr>"); builder.Append("<td>本月</td><td>" + bmcsNum + "</td><td>" + bmzsNum + "</td><td>" + bmzsCent + "</td><td>" + bmwinNum + "</td><td>" + bmwinCent + "</td><td>" + (bmzsCent - bmwinCent) + "</td>"); builder.Append("</tr>"); builder.Append("<tr>"); builder.Append("<td>上月</td><td>" + smcsNum + "</td><td>" + smzsNum + "</td><td>" + smzsCent + "</td><td>" + smwinNum + "</td><td>" + smwinCent + "</td><td>" + (smzsCent - smwinCent) + "</td>"); builder.Append("</tr>"); builder.Append("<tr>"); builder.Append("<td>总计</td><td>" + csNum + "</td><td>" + zsNum + "</td><td>" + zsCent + "</td><td>" + winNum + "</td><td>" + winCent + "</td><td>" + (zsCent - winCent) + "</td>"); builder.Append("</tr>"); builder.Append("</table>"); builder.Append(Out.Tab("</div>", "<br />")); builder.Append(Out.Tab("<div>", "")); builder.Append(Out.waplink(Utils.getUrl("stats.aspx?showtype=1"), ">串串数据分析")); builder.Append(Out.Tab("</div>", "")); } else if (showtype == 1) { //统计今天 int todayzsNum2, todaywinNum2; long todayzsCent2, todaywinCent2; todayzsNum2 = new TPR2.BLL.guess.Super().GetSuperCount("Year(AddTime) = " + DateTime.Now.Year + " AND Month(AddTime) = " + DateTime.Now.Month + " and Day(AddTime) = " + DateTime.Now.Day + " and Status<>0"); todaywinNum2 = new TPR2.BLL.guess.Super().GetSuperCount("Year(AddTime) = " + DateTime.Now.Year + " AND Month(AddTime) = " + DateTime.Now.Month + " and Day(AddTime) = " + DateTime.Now.Day + " and getMoney>0 and Status<>0"); todayzsCent2 = new TPR2.BLL.guess.Super().GetSuperpayCent("Year(AddTime) = " + DateTime.Now.Year + " AND Month(AddTime) = " + DateTime.Now.Month + " and Day(AddTime) = " + DateTime.Now.Day + " and Status<>0"); todaywinCent2 = new TPR2.BLL.guess.Super().GetSupergetMoney("Year(AddTime) = " + DateTime.Now.Year + " AND Month(AddTime) = " + DateTime.Now.Month + " and Day(AddTime) = " + DateTime.Now.Day + " and getMoney>0 and Status<>0"); //统计昨天 int yestzsNum2, yestwinNum2; long yestzsCent2, yestwinCent2; yestzsNum2 = new TPR2.BLL.guess.Super().GetSuperCount("Year(AddTime) = " + DateTime.Now.AddDays(-1).Year + " AND Month(AddTime) = " + DateTime.Now.AddDays(-1).Month + " and Day(AddTime) = " + DateTime.Now.AddDays(-1).Day + " and Status<>0"); yestwinNum2 = new TPR2.BLL.guess.Super().GetSuperCount("Year(AddTime) = " + DateTime.Now.AddDays(-1).Year + " AND Month(AddTime) = " + DateTime.Now.AddDays(-1).Month + " and Day(AddTime) = " + DateTime.Now.AddDays(-1).Day + " and getMoney>0 and Status<>0"); yestzsCent2 = new TPR2.BLL.guess.Super().GetSuperpayCent("Year(AddTime) = " + DateTime.Now.AddDays(-1).Year + " AND Month(AddTime) = " + DateTime.Now.AddDays(-1).Month + " and Day(AddTime) = " + DateTime.Now.AddDays(-1).Day + " and Status<>0"); yestwinCent2 = new TPR2.BLL.guess.Super().GetSupergetMoney("Year(AddTime) = " + DateTime.Now.AddDays(-1).Year + " AND Month(AddTime) = " + DateTime.Now.AddDays(-1).Month + " and Day(AddTime) = " + DateTime.Now.AddDays(-1).Day + " and getMoney>0 and Status<>0"); //统计本月 int bmzsNum2, bmwinNum2; long bmzsCent2, bmwinCent2; bmzsNum2 = new TPR2.BLL.guess.Super().GetSuperCount("Year(AddTime) = " + (DateTime.Now.Year) + " AND Month(AddTime) = " + (DateTime.Now.Month) + " and Status<>0"); bmwinNum2 = new TPR2.BLL.guess.Super().GetSuperCount("Year(AddTime) = " + (DateTime.Now.Year) + " AND Month(AddTime) = " + (DateTime.Now.Month) + " and getMoney>0 and Status<>0"); bmzsCent2 = new TPR2.BLL.guess.Super().GetSuperpayCent("Year(AddTime) = " + (DateTime.Now.Year) + " AND Month(AddTime) = " + (DateTime.Now.Month) + " and Status<>0"); bmwinCent2 = new TPR2.BLL.guess.Super().GetSupergetMoney("Year(AddTime) = " + (DateTime.Now.Year) + " AND Month(AddTime) = " + (DateTime.Now.Month) + " and getMoney>0 and Status<>0"); //统计上月 int smzsNum2, smwinNum2; long smzsCent2, smwinCent2; smzsNum2 = new TPR2.BLL.guess.Super().GetSuperCount("Year(AddTime) = " + (DateTime.Now.Year - DateTime.Now.Day) + " AND Month(AddTime) = " + (DateTime.Now.Month - DateTime.Now.Day) + " and Status<>0"); smwinNum2 = new TPR2.BLL.guess.Super().GetSuperCount("Year(AddTime) = " + (DateTime.Now.Year - DateTime.Now.Day) + " AND Month(AddTime) = " + (DateTime.Now.Month - DateTime.Now.Day) + " and getMoney>0 and Status<>0"); smzsCent2 = new TPR2.BLL.guess.Super().GetSuperpayCent("Year(AddTime) = " + (DateTime.Now.Year - DateTime.Now.Day) + " AND Month(AddTime) = " + (DateTime.Now.Month - DateTime.Now.Day) + " and Status<>0"); smwinCent2 = new TPR2.BLL.guess.Super().GetSupergetMoney("Year(AddTime) = " + (DateTime.Now.Year - DateTime.Now.Day) + " AND Month(AddTime) = " + (DateTime.Now.Month - DateTime.Now.Day) + " and getMoney>0 and Status<>0"); //总计 int zsNum2, winNum2; long zsCent2, winCent2; zsNum2 = new TPR2.BLL.guess.Super().GetSuperCount("Status<>0"); winNum2 = new TPR2.BLL.guess.Super().GetSuperCount("getMoney>0 and Status<>0"); zsCent2 = new TPR2.BLL.guess.Super().GetSuperpayCent("Status<>0"); winCent2 = new TPR2.BLL.guess.Super().GetSupergetMoney("getMoney>0 and Status<>0"); builder.Append(Out.Tab("<div class=\"title\">", "")); builder.Append("完场串串数据分析"); builder.Append(Out.Tab("</div>", "<br />")); builder.Append(Out.Tab("<div>", "")); builder.Append("<table border=\"1\" cellpadding=\"3\" cellspacing=\"0\">"); builder.Append("<tr>"); builder.Append("<td>类别</td><td>下注数</td><td>下注额</td><td>用户赢注数</td><td>用户赢金额</td><td>本站盈利</td>"); builder.Append("</tr>"); builder.Append("<tr>"); builder.Append("<td>今天</td><td>" + todayzsNum2 + "</td><td>" + todayzsCent2 + "</td><td>" + todaywinNum2 + "</td><td>" + todaywinCent2 + "</td><td>" + (todayzsCent2 - todaywinCent2) + "</td>"); builder.Append("</tr>"); builder.Append("<tr>"); builder.Append("<td>昨天</td><td>" + yestzsNum2 + "</td><td>" + yestzsCent2 + "</td><td>" + yestwinNum2 + "</td><td>" + yestwinCent2 + "</td><td>" + (yestzsCent2 - yestwinCent2) + "</td>"); builder.Append("</tr>"); builder.Append("<tr>"); builder.Append("<td>本月</td><td>" + bmzsNum2 + "</td><td>" + bmzsCent2 + "</td><td>" + bmwinNum2 + "</td><td>" + bmwinCent2 + "</td><td>" + (bmzsCent2 - bmwinCent2) + "</td>"); builder.Append("</tr>"); builder.Append("<tr>"); builder.Append("<td>上月</td><td>" + smzsNum2 + "</td><td>" + smzsCent2 + "</td><td>" + smwinNum2 + "</td><td>" + smwinCent2 + "</td><td>" + (smzsCent2 - smwinCent2) + "</td>"); builder.Append("</tr>"); builder.Append("<tr>"); builder.Append("<td>总计</td><td>" + zsNum2 + "</td><td>" + zsCent2 + "</td><td>" + winNum2 + "</td><td>" + winCent2 + "</td><td>" + (zsCent2 - winCent2) + "</td>"); builder.Append("</tr>"); builder.Append("</table>"); builder.Append(Out.Tab("</div>", "<br />")); builder.Append(Out.Tab("<div>", "")); builder.Append(Out.waplink(Utils.getUrl("stats.aspx"), ">普通数据分析")); builder.Append(Out.Tab("</div>", "")); } else if (showtype > 1) { Master.Title = "未场数据分析"; DataSet ds = null; builder.Append(Out.Tab("<div class=\"title\">", "")); if (showtype == 2) { builder.Append("未结束赛事下注数TOP10"); ds = new TPR2.BLL.guess.BaPay().GetBaPayList("top 10 bcid,count(bcid) as payCount", "p_active=0 group by bcid", "count(bcid) desc"); } else { builder.Append("未结束赛事下注额TOP10"); ds = new TPR2.BLL.guess.BaPay().GetBaPayList("top 10 bcid,sum(payCent) as payCount", "p_active=0 group by bcid", "sum(payCent) desc"); } builder.Append(Out.Tab("</div>", "<br />")); builder.Append(Out.Tab("<div>", "")); builder.Append("<table border=\"1\" cellpadding=\"3\" cellspacing=\"0\">"); builder.Append("<tr>"); builder.Append("<td>名次</td><td>1</td><td>2</td><td>3</td><td>4</td><td>5</td><td>6</td><td>7</td><td>8</td><td>9</td><td>10</td>"); builder.Append("</tr>"); builder.Append("<tr>"); builder.Append("<td>赛事ID</td>"); for (int i = 0; i < ds.Tables[0].Rows.Count; i++) { builder.Append("<td>" + Out.waplink(Utils.getUrl("ShowGuess.aspx?gid=" + ds.Tables[0].Rows[i]["bcid"].ToString()), ds.Tables[0].Rows[i]["bcid"].ToString()) + "</td>"); } if (ds.Tables[0].Rows.Count < 10) { for (int i = 0; i < 10 - ds.Tables[0].Rows.Count; i++) { builder.Append("<td>0</td>"); } } builder.Append("</tr>"); builder.Append("<tr>"); if (showtype == 2) { builder.Append("<td>下注数</td>"); } else { builder.Append("<td>下注额</td>"); } for (int i = 0; i < ds.Tables[0].Rows.Count; i++) { builder.Append("<td>" + Convert.ToDouble(ds.Tables[0].Rows[i]["payCount"]) + "</td>"); } if (ds.Tables[0].Rows.Count < 10) { for (int i = 0; i < 10 - ds.Tables[0].Rows.Count; i++) { builder.Append("<td>0</td>"); } } builder.Append("</tr>"); builder.Append("</table>"); builder.Append(Out.Tab("</div>", "")); builder.Append(Out.Tab("<div>", "")); if (showtype == 2) { builder.Append(Out.waplink(Utils.getUrl("stats.aspx?showtype=3"), ">未结束赛事下注额TOP10")); } else { builder.Append(Out.waplink(Utils.getUrl("stats.aspx?showtype=2"), ">未结束赛事下注数TOP10")); } builder.Append(Out.Tab("</div>", "")); } builder.Append(Out.Tab("<div class=\"hr\"></div>", Out.Hr())); builder.Append(Out.Tab("<div>", "")); builder.Append(Out.waplink(Utils.getUrl("default.aspx"), "返回上一级")); builder.Append(Out.Tab("</div>", "")); builder.Append(Out.Tab("<div class=\"title\">", "<br />")); builder.Append("<a href=\"" + Utils.getUrl("../default.aspx") + "\">返回管理中心</a>"); builder.Append(Out.Tab("</div>", "<br />")); }
private void ReloadPage(int meid, long gold) { builder.Append(Out.Tab("<div class=\"title\">", "")); builder.Append("您现在有" + gold + "" + ub.Get("SiteBz") + ""); builder.Append(Out.Tab("</div>", "<br />")); int pageSize = 10; int pageIndex; int recordCount; string strWhere = ""; string[] pageValUrl = { "act" }; pageIndex = Utils.ParseInt(Request.QueryString["page"]); if (pageIndex == 0) { pageIndex = 1; } strWhere = "UsID=" + meid + " and IsOpen=1 and Status=1 and p_case=0"; // 开始读取竞猜 string arrId = ""; IList <TPR2.Model.guess.Super> listSuper = new TPR2.BLL.guess.Super().GetSupers(pageIndex, pageSize, strWhere, out recordCount); if (listSuper.Count > 0) { int k = 1; foreach (TPR2.Model.guess.Super n in listSuper) { if (k % 2 == 0) { builder.Append(Out.Tab("<div class=\"text\">", "<br />")); } else { if (k == 1) { builder.Append(Out.Tab("<div>", "")); } else { builder.Append(Out.Tab("<div>", "<br />")); } } string sWin = string.Empty; sWin = "赢"; builder.Append(Out.waplink(Utils.getUrl("betsuper.aspx?act=listview&id=" + n.ID + ""), "[" + sWin + "]串竞猜" + n.PayCent + "" + ub.Get("SiteBz") + "") + ""); builder.AppendFormat(" 赢{0}币," + Out.waplink(Utils.getUrl("supercase.aspx?act=get&pid=" + n.ID + ""), "兑奖") + "", Convert.ToDouble(n.getMoney)); string[] Title = Regex.Split(Utils.Mid(n.Title, 2, n.Title.Length), "##"); for (int i = 0; i < Title.Length; i++) { builder.Append("<br />场次" + (i + 1) + ":" + Title[i] + ""); } arrId = arrId + " " + n.ID; builder.Append(Out.Tab("</div>", "")); k++; } // 分页 builder.Append(BasePage.MultiPage(pageIndex, pageSize, recordCount, Utils.getPageUrl(), pageValUrl, "page", 0)); } else { builder.Append(Out.Div("div", "没有相关记录..")); } if (!string.IsNullOrEmpty(arrId)) { builder.Append(Out.Tab("", "<br />")); arrId = arrId.Trim(); arrId = arrId.Replace(" ", ","); string strName = "arrId,act"; string strValu = "" + arrId + "'post"; string strOthe = "本页兑奖,supercase.aspx,post,0,red"; builder.Append(Out.wapform(strName, strValu, strOthe)); builder.Append(Out.Tab("", "<br />")); } }
protected void Page_Load(object sender, EventArgs e) { //防止缓存 Response.Buffer = true; Response.ExpiresAbsolute = DateTime.Now.AddSeconds(-1); Response.Expires = 0; Response.CacheControl = "no-cache"; DataSet ds = new TPR2.BLL.guess.Super().GetList("ID,UsID,UsName,BID,PID,Odds,PayCent,p_isfs,p_Auto", "IsOpen=1 and Status=0"); if (ds != null && ds.Tables[0].Rows.Count > 0) { #region 循环下注订单 for (int i = 0; i < ds.Tables[0].Rows.Count; i++) { #region 赋值初期 bool isover = true; int ID = int.Parse(ds.Tables[0].Rows[i]["ID"].ToString()); string BID = ds.Tables[0].Rows[i]["BID"].ToString(); string PID = ds.Tables[0].Rows[i]["PID"].ToString(); string Odds = ds.Tables[0].Rows[i]["Odds"].ToString(); int UsID = int.Parse(ds.Tables[0].Rows[i]["UsID"].ToString()); string UsName = ds.Tables[0].Rows[i]["UsName"].ToString(); double PayCent = double.Parse(ds.Tables[0].Rows[i]["PayCent"].ToString()); int p_isfs = int.Parse(ds.Tables[0].Rows[i]["p_isfs"].ToString()); string[] sBID = Regex.Split(Utils.Mid(BID, 2, BID.Length), "##"); string[] sPID = Regex.Split(Utils.Mid(PID, 2, PID.Length), "##"); string[] sOdds = Regex.Split(Utils.Mid(Odds, 2, Odds.Length), "##"); int p_Auto = int.Parse(ds.Tables[0].Rows[i]["p_Auto"].ToString()); #endregion //P不等于0的时候则视为人工开奖 if (p_Auto != 0) { continue; } #region 比赛是否已结束 for (int j = 0; j < sBID.Length; j++) { int gid = Convert.ToInt32(sBID[j]); //比赛是否已结束 isover = BCW.Data.SqlHelper.Exists("select count(1) from tb_TBaList where ID=" + gid + " and p_active>0"); if (isover == false) { break; } } #endregion #region 如果各场次已结束则进行开奖 if (isover) { if (p_isfs > 0) { //复式 #region 分析复式投注的总注数列表 string strBID = ""; List <string> listNum = new Combination().GetCombination2(sBID.Length, p_isfs, sBID); if (listNum.Count > 0) { foreach (string n in listNum) { strBID += "##" + n.Replace(",", "@"); } } string strPID = ""; List <string> listNum2 = new Combination().GetCombination2(sPID.Length, p_isfs, sPID); if (listNum2.Count > 0) { foreach (string n in listNum2) { strPID += "##" + n.Replace(",", "@"); } } string strOdds = ""; List <string> listNum3 = new Combination().GetCombination2(sOdds.Length, p_isfs, sOdds); if (listNum3.Count > 0) { foreach (string n in listNum3) { strOdds += "##" + n.Replace(",", "@"); } } string[] sBID2 = Regex.Split(Utils.Mid(strBID, 2, strBID.Length), "##"); string[] sPID2 = Regex.Split(Utils.Mid(strPID, 2, strPID.Length), "##"); string[] sOdds2 = Regex.Split(Utils.Mid(strOdds, 2, strOdds.Length), "##"); string fsStat = ""; double cents = 0; #endregion #region J循环 for (int j = 0; j < sBID2.Length; j++) { string[] sBID3 = Regex.Split(sBID2[j], "@"); string[] sPID3 = Regex.Split(sPID2[j], "@"); string[] sOdds3 = Regex.Split(sOdds2[j], "@"); //----------------------------------------------------- int errNum = 0; int sbNum = 0; string Stats = string.Empty; double pCent = PayCent; #region k循环 判断输赢 for (int k = 0; k < sBID3.Length; k++) { int gid = Convert.ToInt32(sBID3[k]); int pid = Convert.ToInt32(sPID3[k]); double odds = Convert.ToDouble(sOdds3[k]); TPR2.Model.guess.BaList qq = new TPR2.BLL.guess.BaList().GetModel(gid); int p_type = new TPR2.BLL.guess.BaList().GetPtype(gid); decimal GetMoney = 0; GetMoney = new TPR2.BLL.guess.BaPay().GetBaPayMoney(pid, UsID); if (p_type == 1) { #region 类型为1,1为足球 if (GetMoney == 0)//全输 { Stats += "##全输"; pCent = pCent * 0; } else if (GetMoney == 100)//平盘 { if (qq.p_active == 2) { Stats += "##平盘"; pCent = pCent * 1; errNum++; } else { Stats += "##走盘"; pCent = pCent * 1; } } else if (GetMoney == 50)//输半 { Stats += "##输半"; pCent = pCent * 0.5; sbNum++; } else if (GetMoney == Convert.ToDecimal(100 * odds))//全赢 { Stats += "##全赢"; pCent = pCent * odds; } else//赢半 { Stats += "##赢半"; pCent = pCent * Convert.ToDouble((odds - 1) / 2 + 1); } #endregion } else { #region 除1外的类型,篮球或其他 if (GetMoney == 0)//全输 { Stats += "##全输"; pCent = pCent * 0; } else if (GetMoney > 100) { Stats += "##全赢"; pCent = pCent * odds; } else if (GetMoney == 100)//平盘 { Stats += "##平盘"; pCent = pCent * 1; errNum++; } #endregion } } #endregion if (sBID3.Length - errNum < 3) { pCent = PayCent; } if (sbNum >= 2) { pCent = 0; } fsStat += Stats; cents += pCent; } #endregion #region 更新输赢 TPR2.Model.guess.Super model = new TPR2.Model.guess.Super(); if (cents == 0) { //更新为输 model.Status = 2; model.getMoney = Convert.ToDecimal(-(PayCent + PayCent * p_isfs)); } else { //更新为赢 model.Status = 1; model.getMoney = Convert.ToDecimal(cents); //发送兑奖内线 string strLog = "超级竞猜赛事ID" + ID + "[br]恭喜赢了" + Convert.ToDouble(cents) + "" + ub.Get("SiteBz") + "[url=/bbs/guess2/supercase.aspx]马上兑奖[/url]"; new BCW.BLL.Guest().Add(1, UsID, UsName, strLog); } #endregion #region 更新为结束 //更新为结束 model.ID = ID; model.getOdds = fsStat; new TPR2.BLL.guess.Super().Update4(model); #endregion #region 更新排行 //更新排行 TPR2.Model.guess.SuperOrder m = new TPR2.Model.guess.SuperOrder(); m.UsID = UsID; m.UsName = UsName; if (cents == 0) { m.Cent = Convert.ToDecimal(-(PayCent + PayCent * p_isfs)); } else { m.Cent = Convert.ToDecimal(cents); } if (!new TPR2.BLL.guess.SuperOrder().Exists(UsID)) { new TPR2.BLL.guess.SuperOrder().Add(m); } else { new TPR2.BLL.guess.SuperOrder().Update(m); } #endregion } else { //非复式 投注处理 int errNum = 0; int sbNum = 0; string Stats = string.Empty; double pCent = PayCent; #region k循环判断输赢 for (int k = 0; k < sBID.Length; k++) { int gid = Convert.ToInt32(sBID[k]); int pid = Convert.ToInt32(sPID[k]); double odds = Convert.ToDouble(sOdds[k]); TPR2.Model.guess.BaList m = new TPR2.BLL.guess.BaList().GetModel(gid); decimal GetMoney = 0; GetMoney = new TPR2.BLL.guess.BaPay().GetBaPayMoney(pid, UsID); if (GetMoney == -1) { break; } if (m.p_type == 1) { #region p_type类型为1的输赢 if (GetMoney == 0)//全输 { Stats += "##全输"; pCent = pCent * 0; } else if (GetMoney == 100)//平盘 { if (m.p_active == 2) { Stats += "##平盘"; pCent = pCent * 1; errNum++; } else { Stats += "##走盘"; pCent = pCent * 1; } } else if (GetMoney == 50)//输半 { Stats += "##输半"; pCent = pCent * 0.5; sbNum++; } else if (GetMoney == Convert.ToDecimal(100 * odds))//全赢 { Stats += "##全赢"; pCent = pCent * odds; } else//赢半 { Stats += "##赢半"; pCent = pCent * Convert.ToDouble((odds - 1) / 2 + 1); } #endregion } else { #region 除1外的类型 if (GetMoney == 0)//全输 { Stats += "##全输"; pCent = pCent * 0; } else if (GetMoney > 100) { Stats += "##全赢"; pCent = pCent * odds; } else if (GetMoney == 100)//平盘 { if (m.p_active == 2) { Stats += "##平盘"; pCent = pCent * 1; errNum++; } else { Stats += "##走盘"; pCent = pCent * 1; } } #endregion } } #endregion #region 发送内线以及处理更新 TPR2.Model.guess.Super model = new TPR2.Model.guess.Super(); if (sBID.Length - errNum < 3) { //无效返回本金 model.Status = 1; model.getMoney = Convert.ToDecimal(PayCent); //发送兑奖内线 string strLog = "超级竞猜赛事ID" + ID + "[br]串串无效系统退回本金" + Convert.ToDouble(PayCent) + "" + ub.Get("SiteBz") + "[url=/bbs/guess2/supercase.aspx]马上兑奖[/url]"; new BCW.BLL.Guest().Add(1, UsID, UsName, strLog); } else { if (pCent == 0 || sbNum >= 2) { //更新为输 model.Status = 2; model.getMoney = Convert.ToDecimal(-PayCent); } else { //更新为赢 model.Status = 1; model.getMoney = Convert.ToDecimal(pCent); //发送兑奖内线 string strLog = "超级竞猜赛事ID" + ID + "[br]恭喜赢了" + Convert.ToDouble(pCent) + "" + ub.Get("SiteBz") + "[url=/bbs/guess2/supercase.aspx]马上兑奖[/url]"; new BCW.BLL.Guest().Add(1, UsID, UsName, strLog); } } #endregion #region 更新为结束 //更新为结束 model.ID = ID; model.getOdds = Stats; new TPR2.BLL.guess.Super().Update4(model); #endregion #region 更新排行 //更新排行 TPR2.Model.guess.SuperOrder n = new TPR2.Model.guess.SuperOrder(); n.UsID = UsID; n.UsName = UsName; if (pCent == 0) { n.Cent = Convert.ToDecimal(-PayCent); } else { n.Cent = Convert.ToDecimal(pCent); } if (!new TPR2.BLL.guess.SuperOrder().Exists(UsID)) { new TPR2.BLL.guess.SuperOrder().Add(n); } else { new TPR2.BLL.guess.SuperOrder().Update(n); } #endregion } } #endregion } #endregion Response.Write("Ok!"); Response.End(); } Response.Write("No record!"); Response.End(); }