private void CasePage() { Master.Title = "兑奖中心"; int meid = new BCW.User.Users().GetUsId(); if (meid == 0) { Utils.Login(); } builder.Append(Out.Tab("<div class=\"title\">", "")); builder.Append("您现在有" + new BCW.BLL.User().GetGold(meid) + "" + ub.Get("SiteBz") + ""); builder.Append(Out.Tab("</div>", "<br />")); int pageIndex; int recordCount; int pageSize = 10; string strWhere = string.Empty; strWhere = "UsID=" + meid + " and WinCent>0 and State=1"; string[] pageValUrl = { "act", "backurl" }; pageIndex = Utils.ParseInt(Request.QueryString["page"]); if (pageIndex == 0) { pageIndex = 1; } string arrId = ""; // 开始读取列表 IList <BCW.Model.Game.Ballpay> listBallpay = new BCW.BLL.Game.Ballpay().GetBallpays(pageIndex, pageSize, strWhere, out recordCount); if (listBallpay.Count > 0) { int k = 1; foreach (BCW.Model.Game.Ballpay n in listBallpay) { 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 />")); } } builder.Append("[第" + n.BallId + "期]."); builder.Append("买" + n.BuyNum + ",押" + n.BuyCount + "份/花费" + n.BuyCent + "" + ub.Get("SiteBz") + "赢" + n.WinCent + "" + ub.Get("SiteBz") + "[" + DT.FormatDate(n.AddTime, 1) + "]<a href=\"" + Utils.getUrl("ball.aspx?act=caseok&pid=" + n.ID + "") + "\">兑奖</a>"); arrId = arrId + " " + n.ID; k++; builder.Append(Out.Tab("</div>", "")); } // 分页 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 + "'casepost"; string strOthe = "本页兑奖,ball.aspx,post,0,red"; builder.Append(Out.wapform(strName, strValu, strOthe)); } builder.Append(Out.Tab("<div>", Out.Hr())); builder.Append("<a href=\"" + Utils.getUrl("ball.aspx?act=mylist&ptype=1") + "\">未开投注</a> "); builder.Append("<a href=\"" + Utils.getUrl("ball.aspx?act=mylist&ptype=2") + "\">历史投注</a>"); builder.Append(Out.Tab("</div>", "<br />")); builder.Append(Out.Tab("<div class=\"title\">", "")); builder.Append("<a href=\"" + Utils.getUrl("/default.aspx") + "\">首页</a>-"); builder.Append("<a href=\"" + Utils.getUrl("default.aspx") + "\">游戏大厅</a>-"); builder.Append("<a href=\"" + Utils.getUrl("ball.aspx") + "\">彩球</a>"); builder.Append(Out.Tab("</div>", "")); }
private void ListViewPage() { int id = Utils.ParseInt(Utils.GetRequest("id", "get", 2, @"^[1-9]\d*$", "ID错误")); BCW.Model.Game.Balllist model = new BCW.BLL.Game.Balllist().GetBalllist(id); if (model == null) { Utils.Error("不存在的记录", ""); } Master.Title = "第" + id + "期疯狂彩球"; builder.Append(Out.Tab("<div class=\"title\">", "")); builder.Append("<a href=\"" + Utils.getPage("ball.aspx?act=list") + "\">返回上一级</a>"); builder.Append(Out.Tab("</div>", "<br />")); int pageIndex; int recordCount; int pageSize = Convert.ToInt32(ub.Get("SiteListNo")); string strWhere = string.Empty; strWhere += "BallId=" + id + " and WinCent>0"; string[] pageValUrl = { "act", "id", "backurl" }; pageIndex = Utils.ParseInt(Request.QueryString["page"]); if (pageIndex == 0) { pageIndex = 1; } // 开始读取列表 IList <BCW.Model.Game.Ballpay> listBallpay = new BCW.BLL.Game.Ballpay().GetBallpays(pageIndex, pageSize, strWhere, out recordCount); if (listBallpay.Count > 0) { builder.Append(Out.Tab("<div class=\"text\">", "")); builder.Append("第" + id + "期开出号码:<b>" + model.WinNum + "</b>"); builder.Append("<br />共" + recordCount + "注中奖"); builder.Append(Out.Tab("</div>", "<br />")); int k = 1; foreach (BCW.Model.Game.Ballpay n in listBallpay) { 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 />")); } } builder.Append("" + ((pageIndex - 1) * pageSize + k) + "."); builder.Append("<a href=\"" + Utils.getUrl("/bbs/uinfo.aspx?uid=" + n.UsID + "&backurl=" + Utils.PostPage(1) + "") + "\">" + n.UsName + "</a>获得" + n.WinCent + "" + ub.Get("SiteBz") + ""); k++; builder.Append(Out.Tab("</div>", "")); } // 分页 builder.Append(BasePage.MultiPage(pageIndex, pageSize, recordCount, Utils.getPageUrl(), pageValUrl, "page", 0)); } else { builder.Append(Out.Tab("<div class=\"text\">", "")); builder.Append("第" + id + "期开出号码:<b>" + model.WinNum + "</b>"); builder.Append("<br />共0注中奖"); builder.Append(Out.Tab("</div>", "<br />")); builder.Append(Out.Div("div", "没有相关记录..")); } builder.Append(Out.Tab("<div>", Out.Hr())); builder.Append("<a href=\"" + Utils.getUrl("ball.aspx?act=mylist&ptype=1") + "\">未开投注</a> "); builder.Append("<a href=\"" + Utils.getUrl("ball.aspx?act=mylist&ptype=2") + "\">历史投注</a>"); builder.Append(Out.Tab("</div>", "<br />")); builder.Append(Out.Tab("<div class=\"title\">", "")); builder.Append("<a href=\"" + Utils.getUrl("/default.aspx") + "\">首页</a>-"); builder.Append("<a href=\"" + Utils.getUrl("default.aspx") + "\">游戏大厅</a>-"); builder.Append("<a href=\"" + Utils.getUrl("ball.aspx") + "\">彩球</a>"); builder.Append(Out.Tab("</div>", "")); }
private void PayOkPage() { if (IsOpen() == false) { Utils.Error("游戏开放时间:" + ub.GetSub("BallOnTime", xmlPath) + "", ""); } int meid = new BCW.User.Users().GetUsId(); if (meid == 0) { Utils.Login(); } int BuyNum = int.Parse(Utils.GetRequest("BuyNum", "post", 2, @"^[1-9]$|^[1-4]([0-9])?$", "下注数字限1-" + ub.GetSub("BallSysNum", xmlPath) + "")); int BuyCount = int.Parse(Utils.GetRequest("BuyCount", "post", 2, @"^[1-9]\d*$", "下注份数填写错误")); if (BuyNum < 1 || BuyNum > Utils.ParseInt(ub.GetSub("BallSysNum", xmlPath))) { Utils.Error("下注数字限1-" + ub.GetSub("BallSysNum", xmlPath) + "", ""); } //是否刷屏 string appName = "LIGHT_BALL"; int Expir = Utils.ParseInt(ub.GetSub("BallExpir", xmlPath)); BCW.User.Users.IsFresh(appName, Expir); BCW.Model.Game.Balllist ball = new BCW.BLL.Game.Balllist().GetBalllist(); //每期每ID限下注份数 int BuyCounts = new BCW.BLL.Game.Ballpay().GetBuyCount(ball.ID, meid); if (BuyCount + BuyCounts > Utils.ParseInt(ub.GetSub("BallOutIDNum", xmlPath))) { if (BuyCounts >= Utils.ParseInt(ub.GetSub("BallOutIDNum", xmlPath))) { Utils.Error("系统限制每期每人下注" + Utils.ParseInt(ub.GetSub("BallOutIDNum", xmlPath)) + "份,欢迎在下期下注", ""); } else { Utils.Error("系统限制每期每人下注" + Utils.ParseInt(ub.GetSub("BallOutIDNum", xmlPath)) + "份,你现在最多可以下注" + (Utils.ParseInt(ub.GetSub("BallOutIDNum", xmlPath)) - BuyCounts) + "份", ""); } } Application.Lock(); //每期下注限份数 if ((ball.OutNum - ball.AddNum) < BuyCount) { if (ball.OutNum == 0) { Utils.Error("系统每期限购" + ball.OutNum + "份,欢迎在下期下注", ""); } else { Utils.Error("系统每期限购" + ball.OutNum + "份,您还可以购买" + ((ball.OutNum - ball.AddNum) - BuyCount) + "份", ""); } } if (Convert.ToInt64(BuyCount * ball.iCent) > new BCW.BLL.User().GetGold(meid)) { Utils.Error("需花费" + Convert.ToInt64(BuyCount * ball.iCent) + "" + ub.Get("SiteBz") + ",你身上" + ub.Get("SiteBz") + "不足", ""); } //支付安全提示 string[] p_pageArr = { "act", "BuyNum", "BuyCount" }; BCW.User.PaySafe.PaySafePage(meid, Utils.getPageUrl(), p_pageArr); BCW.Model.Game.Ballpay model = new BCW.Model.Game.Ballpay(); int id = 0; string mename = new BCW.BLL.User().GetUsName(meid); model.BallId = ball.ID; model.UsID = meid; model.UsName = mename; model.BuyCent = Convert.ToInt64(BuyCount * ball.iCent); model.BuyNum = BuyNum; model.BuyCount = BuyCount; model.State = 0; model.WinCent = 0; model.AddTime = DateTime.Now; if (!new BCW.BLL.Game.Ballpay().ExistsBuyNum(ball.ID, BuyNum, meid)) { id = new BCW.BLL.Game.Ballpay().Add(model); } else { new BCW.BLL.Game.Ballpay().Update(model); } //加奖池基金并减购买份数 new BCW.BLL.Game.Balllist().UpdatePool(ball.ID, Convert.ToInt64(BuyCount * ball.iCent), BuyCount); //扣币 new BCW.BLL.User().UpdateiGold(meid, mename, -Convert.ToInt64(BuyCount * ball.iCent), 6); string wText = "[url=/bbs/uinfo.aspx?uid=" + meid + "]" + mename + "[/url]在[url=/bbs/game/ball.aspx]疯狂彩球第" + ball.ID + "期[/url]下注" + Convert.ToInt64(BuyCount * ball.iCent) + "" + ub.Get("SiteBz") + ""; new BCW.BLL.Action().Add(8, id, 0, "", wText); Utils.Success("下注", "下注成功,花费了" + Convert.ToInt64(BuyCount * ball.iCent) + "" + ub.Get("SiteBz") + "<br /><a href=\"" + Utils.getUrl("ball.aspx?act=pay") + "\">>继续下注</a>", Utils.getUrl("ball.aspx"), "2"); Application.UnLock(); }
private void MyListPage() { int meid = new BCW.User.Users().GetUsId(); if (meid == 0) { Utils.Login(); } int ptype = Utils.ParseInt(Utils.GetRequest("ptype", "get", 1, @"^[1-2]$", "1")); string strTitle = ""; if (ptype == 1) { strTitle = "我的未开投注"; } else { strTitle = "我的历史投注"; } Master.Title = strTitle; builder.Append(Out.Tab("<div class=\"title\">", "")); builder.Append(strTitle); builder.Append(Out.Tab("</div>", "<br />")); int pageIndex; int recordCount; int pageSize = Convert.ToInt32(ub.Get("SiteListNo")); string strWhere = string.Empty; strWhere = "UsID=" + meid + ""; if (ptype == 1) { strWhere += " and State=0"; } else { strWhere += " and State>0"; } string[] pageValUrl = { "act", "ptype", "backurl" }; pageIndex = Utils.ParseInt(Request.QueryString["page"]); if (pageIndex == 0) { pageIndex = 1; } string Ballqi = ""; // 开始读取列表 IList <BCW.Model.Game.Ballpay> listBallpay = new BCW.BLL.Game.Ballpay().GetBallpays(pageIndex, pageSize, strWhere, out recordCount); if (listBallpay.Count > 0) { int k = 1; foreach (BCW.Model.Game.Ballpay n in listBallpay) { 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 />")); } } if (n.BallId.ToString() != Ballqi) { builder.Append("=第" + n.BallId + "期=<br />"); } builder.Append("[" + ((pageIndex - 1) * pageSize + k) + "]."); if (n.State == 0) { builder.Append("买" + n.BuyNum + ",共押" + n.BuyCount + "份/花费" + n.BuyCent + "" + ub.Get("SiteBz") + "[" + DT.FormatDate(n.AddTime, 13) + "]"); } else if (n.State == 1) { builder.Append("买" + n.BuyNum + ",共押" + n.BuyCount + "份/花费" + n.BuyCent + "" + ub.Get("SiteBz") + "[" + DT.FormatDate(n.AddTime, 1) + "]"); if (n.WinCent > 0) { builder.Append("赢" + n.WinCent + "" + ub.Get("SiteBz") + ""); } } else { builder.Append("买" + n.BuyNum + ",共押" + n.BuyCount + "份/花费" + n.BuyCent + "" + ub.Get("SiteBz") + ",赢" + n.WinCent + "" + ub.Get("SiteBz") + "[" + DT.FormatDate(n.AddTime, 1) + "]"); } Ballqi = n.BallId.ToString(); k++; builder.Append(Out.Tab("</div>", "")); } // 分页 builder.Append(BasePage.MultiPage(pageIndex, pageSize, recordCount, Utils.getPageUrl(), pageValUrl, "page", 0)); } else { builder.Append(Out.Div("div", "没有相关记录..")); } builder.Append(Out.Tab("<div>", Out.Hr())); builder.Append("<a href=\"" + Utils.getUrl("ball.aspx?act=mylist&ptype=1") + "\">未开投注</a> "); builder.Append("<a href=\"" + Utils.getUrl("ball.aspx?act=mylist&ptype=2") + "\">历史投注</a>"); builder.Append(Out.Tab("</div>", "<br />")); builder.Append(Out.Tab("<div class=\"title\">", "")); builder.Append("<a href=\"" + Utils.getUrl("/default.aspx") + "\">首页</a>-"); builder.Append("<a href=\"" + Utils.getUrl("default.aspx") + "\">游戏大厅</a>-"); builder.Append("<a href=\"" + Utils.getUrl("ball.aspx") + "\">彩球</a>"); builder.Append(Out.Tab("</div>", "")); }
private void ViewPage() { int id = int.Parse(Utils.GetRequest("id", "get", 2, @"^[1-9]\d*$", "ID错误")); int ptype = int.Parse(Utils.GetRequest("ptype", "get", 1, @"^[1-2]\d*$", "1")); BCW.Model.Game.Balllist model = new BCW.BLL.Game.Balllist().GetBalllist(id); if (model == null) { Utils.Error("不存在的记录", ""); } Master.Title = "第" + id + "期疯狂彩球"; builder.Append(Out.Tab("<div class=\"text\">", "")); builder.Append("查看下注/开奖记录"); builder.Append(Out.Tab("</div>", "<br />")); builder.Append(Out.Tab("<div class=\"text\">", "")); builder.Append("查看:"); if (ptype == 1) { builder.Append("下注|"); } else { builder.Append("<a href=\"" + Utils.getUrl("ball.aspx?act=view&ptype=1&id=" + id + "&backurl=" + Utils.getPage(0) + "") + "\">下注</a>|"); } if (ptype == 2) { builder.Append("中奖"); } else { builder.Append("<a href=\"" + Utils.getUrl("ball.aspx?act=view&ptype=2&id=" + id + "&backurl=" + Utils.getPage(0) + "") + "\">中奖</a>"); } builder.Append(Out.Tab("</div>", "<br />")); int pageIndex; int recordCount; int pageSize = Convert.ToInt32(ub.Get("SiteListNo")); string strWhere = string.Empty; if (ptype == 1) { strWhere += "BallId=" + id + ""; } else { strWhere += "BallId=" + id + " and state>0 and winCent>0"; } string[] pageValUrl = { "act", "id", "backurl" }; pageIndex = Utils.ParseInt(Request.QueryString["page"]); if (pageIndex == 0) { pageIndex = 1; } // 开始读取列表 IList <BCW.Model.Game.Ballpay> listBallpay = new BCW.BLL.Game.Ballpay().GetBallpays(pageIndex, pageSize, strWhere, out recordCount); if (listBallpay.Count > 0) { builder.Append(Out.Tab("<div class=\"text\">", "")); builder.Append("第" + id + "期开出号码:<b>" + model.WinNum + "</b>"); if (ptype == 1) { builder.Append("<br />共" + recordCount + "注下注"); } else { builder.Append("<br />共" + recordCount + "注中奖"); } builder.Append(Out.Tab("</div>", "<br />")); int k = 1; foreach (BCW.Model.Game.Ballpay n in listBallpay) { 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 />")); } } builder.Append("" + ((pageIndex - 1) * pageSize + k) + ".<a href=\"" + Utils.getUrl("../uinfo.aspx?uid=" + n.UsID + "&backurl=" + Utils.PostPage(1) + "") + "\">" + n.UsName + "</a>"); if (n.State == 0) { builder.Append("买" + n.BuyNum + ",共押" + n.BuyCount + "份/花费" + n.BuyCent + "" + ub.Get("SiteBz") + "[" + DT.FormatDate(n.AddTime, 13) + "]"); } else if (n.State == 1) { builder.Append("买" + n.BuyNum + ",共押" + n.BuyCount + "份/花费" + n.BuyCent + "" + ub.Get("SiteBz") + "[" + DT.FormatDate(n.AddTime, 1) + "]"); if (n.WinCent > 0) { builder.Append("赢" + n.WinCent + "" + ub.Get("SiteBz") + ""); } } else { builder.Append("买" + n.BuyNum + ",共押" + n.BuyCount + "份/花费" + n.BuyCent + "" + ub.Get("SiteBz") + ",赢" + n.WinCent + "" + ub.Get("SiteBz") + "[" + DT.FormatDate(n.AddTime, 1) + "]"); } k++; builder.Append(Out.Tab("</div>", "")); } // 分页 builder.Append(BasePage.MultiPage(pageIndex, pageSize, recordCount, Utils.getPageUrl(), pageValUrl, "page", 0)); } else { builder.Append(Out.Tab("<div class=\"text\">", "")); builder.Append("第" + id + "期开出号码:<b>" + model.WinNum + "</b>"); builder.Append("<br />共0注中奖"); builder.Append(Out.Tab("</div>", "<br />")); builder.Append(Out.Div("div", "没有相关记录..")); } builder.Append(Out.Tab("<div class=\"hr\"></div>", Out.Hr())); builder.Append(Out.Tab("<div>", "")); builder.Append("<a href=\"" + Utils.getPage("ball.aspx") + "\">返回上一级</a>"); builder.Append(Out.Tab("</div>", "<br />")); builder.Append(Out.Tab("<div class=\"title\">", "")); builder.Append("<a href=\"" + Utils.getUrl("../default.aspx") + "\">返回管理中心</a>"); builder.Append(Out.Tab("</div>", "<br />")); }