private void EditPage() { int ManageId = new BCW.User.Manage().IsManageLogin(); if (ManageId != 1 && ManageId != 9) { Utils.Error("权限不足", ""); } int id = int.Parse(Utils.GetRequest("id", "get", 2, @"^[1-9]\d*$", "大小庄ID错误")); Master.Title = "编辑大小庄"; builder.Append(Out.Tab("<div class=\"title\">", "")); builder.Append("编辑大小庄"); builder.Append(Out.Tab("</div>", "")); BCW.Model.Game.Bslist model = new BCW.BLL.Game.Bslist().GetBslist(id); if (model == null) { Utils.Error("不存在的记录", ""); } string strText = "庄名:/,最小下注:/,最大下注:/,用户ID:/,用户昵称:/,人气:/,创建时间:/,,,"; string strName = "Title,SmallPay,BigPay,UsID,UsName,Click,AddTime,id,act,backurl"; string strType = "text,num,num,num,text,num,date,hidden,hidden,hidden"; string strValu = "" + model.Title + "'" + model.SmallPay + "'" + model.BigPay + "'" + model.UsID + "'" + model.UsName + "'" + model.Click + "'" + model.AddTime + "'" + id + "'editsave'" + Utils.getPage(0) + ""; string strEmpt = "false,false,false,false,false,false,false,false,false,false"; string strIdea = "/"; string strOthe = "确定编辑|reset,bigsmall.aspx,post,1,red|blue"; builder.Append(Out.wapform(strText, strName, strType, strValu, strEmpt, strIdea, strOthe)); builder.Append(Out.Tab("<div class=\"hr\"></div>", Out.Hr())); builder.Append(Out.Tab("<div>", "")); builder.Append("<a href=\"" + Utils.getPage("bigsmall.aspx") + "\">返回上一级</a><br />"); builder.Append("<a href=\"" + Utils.getUrl("bigsmall.aspx?act=del&id=" + id + "&backurl=" + Utils.getPage(0) + "") + "\">删除记录</a><br />"); builder.Append(Out.Tab("</div><div class=\"title\"><a href=\"" + Utils.getUrl("../default.aspx") + "\">返回管理中心</a>", "<a href=\"" + Utils.getUrl("../default.aspx") + "\">返回管理中心</a>")); builder.Append(Out.Tab("</div>", "<br />")); }
private void PlayBigSmall() { DataSet ds = new BCW.BLL.Game.Bslist().GetList("TOP 5 ID,SmallPay,BigPay,BzType", "(Money>=" + Convert.ToInt64(ub.GetSub("BsvMoney", xmlPath)) + " and BzType=0 and Money > SmallPay) OR (Money>=" + Convert.ToInt64(ub.GetSub("BsvMoney2", xmlPath)) + " and BzType=1 and Money > SmallPay) Order by NEWID()"); if (ds != null && ds.Tables[0].Rows.Count > 0) { for (int i = 0; i < ds.Tables[0].Rows.Count; i++) { int id = int.Parse(ds.Tables[0].Rows[i]["ID"].ToString()); long SmallPay = Int64.Parse(ds.Tables[0].Rows[i]["SmallPay"].ToString()); long BigPay = Int64.Parse(ds.Tables[0].Rows[i]["BigPay"].ToString()); long PayCent = GetPayCent(); int bzType = int.Parse(ds.Tables[0].Rows[i]["BzType"].ToString()); if (bzType == 1) { PayCent = PayCent * 10; } int k = 0; while (PayCent < SmallPay || PayCent > BigPay) { long vPayCent = GetPayCent(); if (bzType == 1) { PayCent = vPayCent * 10; } else { PayCent = vPayCent; } k++; if (k > 200) { PayCent = SmallPay; break; } } int meid = GetUsID(); PlayBigSmallInfo(meid, id, PayCent); } } }
private void ReloadPage() { Master.Title = "大小庄管理"; builder.Append(Out.Tab("<div class=\"title\">", "")); builder.Append("<a href=\"" + Utils.getUrl("default.aspx") + "\">游戏</a>>"); builder.Append("大小庄"); builder.Append(Out.Tab("</div>", "<br />")); int uid = int.Parse(Utils.GetRequest("uid", "all", 1, @"^[1-9]\d*$", "0")); int pageIndex; int recordCount; int pageSize = Convert.ToInt32(ub.Get("SiteListNo")); string strWhere = string.Empty; string strOrder = string.Empty; if (uid > 0) { strWhere += "usid=" + uid + ""; } string[] pageValUrl = { "act", "backurl" }; pageIndex = Utils.ParseInt(Request.QueryString["page"]); if (pageIndex == 0) { pageIndex = 1; } // 开始读取列表 IList <BCW.Model.Game.Bslist> listBslist = new BCW.BLL.Game.Bslist().GetBslists(pageIndex, pageSize, strWhere, strOrder, out recordCount); if (listBslist.Count > 0) { int k = 1; foreach (BCW.Model.Game.Bslist n in listBslist) { 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("<a href=\"" + Utils.getUrl("bigsmall.aspx?act=edit&id=" + n.ID + "&backurl=" + Utils.PostPage(1) + "") + "\">[管理]></a>"); builder.Append("" + ((pageIndex - 1) * pageSize + k) + ".<a href=\"" + Utils.getUrl("bigsmall.aspx?act=view&id=" + n.ID + "&backurl=" + Utils.PostPage(1) + "") + "\">" + n.Title + "</a>"); k++; builder.Append(Out.Tab("</div>", "")); } // 分页 builder.Append(BasePage.MultiPage(pageIndex, pageSize, recordCount, Utils.getPageUrl(), pageValUrl, "page", 0)); } else { builder.Append(Out.Div("div", "没有相关记录..")); } string strText = "输入用户ID:/,"; string strName = "uid,backurl"; string strType = "num,hidden"; string strValu = "'" + Utils.getPage(0) + ""; string strEmpt = "true,false"; string strIdea = "/"; string strOthe = "搜庄,bigsmall.aspx,post,1,red"; builder.Append(Out.wapform(strText, strName, strType, strValu, strEmpt, strIdea, strOthe)); builder.Append(Out.Tab("<div class=\"hr\"></div>", Out.Hr())); builder.Append(Out.Tab("<div>", "")); builder.Append("<a href=\"" + Utils.getUrl("bigsmall.aspx?act=stat") + "\">赢利分析</a>|<a href=\"" + Utils.getUrl("../toplist.aspx?act=top&ptype=9&backurl=" + Utils.PostPage(1) + "") + "\">排行</a><br />"); builder.Append("<a href=\"" + Utils.getUrl("bigsmall.aspx?act=clear") + "\">清空下注</a><br />"); //builder.Append("<a href=\"" + Utils.getUrl("bigsmall.aspx?act=reset") + "\">重置游戏</a><br />"); builder.Append("<a href=\"" + Utils.getUrl("bigsmall.aspx?act=back") + "\">返赢返负</a><br />"); builder.Append("<a href=\"" + Utils.getUrl("../xml/bigsmallset.aspx?backurl=" + Utils.PostPage(1) + "") + "\">游戏配置</a>"); int ManageId = new BCW.User.Manage().IsManageLogin(); if (ManageId == 1 || ManageId == 11) { builder.Append("<br /><a href=\"" + Utils.getUrl("../xml/bigsmallset.aspx?act=ok&backurl=" + Utils.PostPage(1) + "") + "\">上帝之手</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 />")); }
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.Bslist model = new BCW.BLL.Game.Bslist().GetBslist(id); if (model == null) { Utils.Error("不存在的记录", ""); } Master.Title = "大小庄《" + model.Title + "》"; builder.Append(Out.Tab("<div class=\"title\">", "")); 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("bigsmall.aspx?act=view&ptype=1&id=" + id + "&backurl=" + Utils.getPage(0) + "") + "\">下注</a>|"); } if (ptype == 2) { builder.Append("中奖"); } else { builder.Append("<a href=\"" + Utils.getUrl("bigsmall.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 += "BsId=" + id + ""; } else { strWhere += "BsId=" + id + " and winCent>0"; } string[] pageValUrl = { "act", "ptype", "id", "backurl" }; pageIndex = Utils.ParseInt(Request.QueryString["page"]); if (pageIndex == 0) { pageIndex = 1; } // 开始读取列表 IList <BCW.Model.Game.Bspay> listBspay = new BCW.BLL.Game.Bspay().GetBspays(pageIndex, pageSize, strWhere, out recordCount); if (listBspay.Count > 0) { int k = 1; foreach (BCW.Model.Game.Bspay n in listBspay) { 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>"); string bzText = string.Empty; if (n.BzType == 0) { bzText = ub.Get("SiteBz"); } else { bzText = ub.Get("SiteBz2"); } if (n.WinCent > 0) { builder.Append("下注" + n.PayCent + "" + bzText + ",结果"); if (n.BetType == 1) { builder.Append("(庄小/闲小)"); } else { builder.Append("(庄大/闲大)"); } builder.Append("赢" + n.WinCent + "" + bzText + "[" + DT.FormatDate(n.AddTime, 0) + "]"); } else { builder.Append("下注" + n.PayCent + "" + bzText + ",结果"); if (n.BetType == 1) { builder.Append("(庄大/闲小)"); } else { builder.Append("(庄小/闲大)"); } builder.Append("输" + n.WinCent + "" + bzText + "[" + DT.FormatDate(n.AddTime, 0) + "]"); } builder.Append("IP:" + n.UsIP + "|UA:" + n.UsUA + ""); 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 class=\"hr\"></div>", Out.Hr())); if (pageIndex == 1) { long zWin = new BCW.BLL.Game.Bspay().GetWinCent("BsId=" + id + " and WinCent < 0"); long zLost = new BCW.BLL.Game.Bspay().GetWinCent("BsId=" + id + " and WinCent > 0"); long Win = (-zWin) - zLost; //庄胜与闲胜赔率 string xmlPath = "/Controls/bigsmall.xml"; double ZTar = Convert.ToDouble(ub.GetSub("BsZTar", xmlPath)); double XTar = Convert.ToDouble(ub.GetSub("BsXTar", xmlPath)); //今天赢利 long WinCent = new BCW.BLL.Game.Bspay().GetWinCent("BsId=" + id + " and WinCent > 0"); long WinCent2 = new BCW.BLL.Game.Bspay().GetWinCent("BsId=" + id + " and WinCent < 0"); long TWin = Convert.ToInt64(WinCent * XTar * 0.01); long TWin2 = Convert.ToInt64(-WinCent2 * ZTar * 0.01); builder.Append(Out.Tab("<div class=\"text\">", "")); builder.Append("本庄庄家赢利" + Win + "<br />"); builder.Append("本站在此庄赢利" + (TWin + TWin2) + ""); builder.Append(Out.Tab("</div>", "")); builder.Append(Out.Tab("<div class=\"hr\"></div>", Out.Hr())); } builder.Append(Out.Tab("<div>", "")); builder.Append("<a href=\"" + Utils.getPage("bigsmall.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 />")); }
private void PlayBigSmallInfo(int meid, int id, long PayCent) { ChanageOnline(meid); string mename = new BCW.BLL.User().GetUsName(meid); BCW.Model.Game.Bslist model = new BCW.BLL.Game.Bslist().GetBslist(id); if (model.UsID == meid) { Response.End(); } int bet = new Random().Next(0, 2); if (PayCent < model.SmallPay || PayCent > model.BigPay) { Response.End(); } if (PayCent > model.Money) { Response.End(); } long gold = 0; string bzText = string.Empty; if (model.BzType == 0) { bzText = ub.Get("SiteBz"); gold = new BCW.BLL.User().GetGold(meid); } else { bzText = ub.Get("SiteBz2"); gold = new BCW.BLL.User().GetMoney(meid); } if (gold < PayCent) { //更新消费记录 BCW.Model.Goldlog modelx = new BCW.Model.Goldlog(); modelx.BbTag = 3; modelx.Types = model.BzType; modelx.PUrl = Utils.getPageUrl();//操作的文件名 modelx.UsId = meid; modelx.UsName = mename; modelx.AcGold = 500000; modelx.AfterGold = gold + 500000;//更新后的币数 modelx.AcText = "系统机器人自动操作"; modelx.AddTime = DateTime.Now; new BCW.BLL.Goldlog().Add(modelx); if (model.BzType == 0) { BCW.Data.SqlHelper.ExecuteSql("Update tb_User set iGold=iGold+500000 where id=" + meid + ""); } else { BCW.Data.SqlHelper.ExecuteSql("Update tb_User set iMoney=iMoney+500000 where id=" + meid + ""); } } bool IsWin = false; Random ra = new Random(unchecked ((int)DateTime.Now.Ticks)); int rdNext = ra.Next(0, 2); if (rdNext == bet) { IsWin = true; } //客家十赌六赢 string IsWinBot = ub.GetSub("BsIsWinBot", xmlPath); if (IsWinBot == "0") { rdNext = ra.Next(1, 1000); if (rdNext <= 400) { rdNext = ((bet == 0) ? 1 : 0); IsWin = false; } else { rdNext = bet; IsWin = true; } } long WinCent = 0; if (IsWin)//闲胜 { double XTar = Convert.ToDouble(ub.GetSub("BsXTar", xmlPath)); long xMoney = PayCent - Convert.ToInt64(XTar * 0.01 * PayCent); if (model.BzType == 0) { //更新排行榜 BCW.Model.Toplist modeltop = new BCW.Model.Toplist(); modeltop.Types = 9; modeltop.UsId = model.UsID; modeltop.UsName = model.UsName; modeltop.PutNum = 1; modeltop.PutGold = -PayCent; if (!new BCW.BLL.Toplist().Exists(model.UsID, 9)) { new BCW.BLL.Toplist().Add(modeltop); } else { new BCW.BLL.Toplist().Update(modeltop); } new BCW.BLL.User().UpdateiGold(meid, mename, xMoney, 9); } else { new BCW.BLL.User().UpdateiMoney(meid, mename, xMoney, "大小庄赢得"); } new BCW.BLL.Game.Bslist().UpdateMoney(id, -PayCent); WinCent = xMoney; } else//庄胜 { double ZTar = Convert.ToDouble(ub.GetSub("BsZTar", xmlPath)); long zMoney = PayCent - Convert.ToInt64(ZTar * 0.01 * PayCent); new BCW.BLL.Game.Bslist().UpdateMoney(id, zMoney); if (model.BzType == 0) { //更新排行榜 BCW.Model.Toplist modeltop = new BCW.Model.Toplist(); modeltop.Types = 9; modeltop.UsId = model.UsID; modeltop.UsName = model.UsName; modeltop.WinNum = 1; modeltop.WinGold = zMoney; if (!new BCW.BLL.Toplist().Exists(model.UsID, 9)) { new BCW.BLL.Toplist().Add(modeltop); } else { new BCW.BLL.Toplist().Update(modeltop); } new BCW.BLL.User().UpdateiGold(meid, mename, -PayCent, 9); } else { new BCW.BLL.User().UpdateiMoney(meid, mename, -PayCent, "大小庄失去"); } WinCent = -PayCent; } //写进下注记录 BCW.Model.Game.Bspay addmodel = new BCW.Model.Game.Bspay(); addmodel.BsId = id; addmodel.BsTitle = model.Title; addmodel.BzType = model.BzType; addmodel.BetType = bet; addmodel.PayCent = PayCent; addmodel.UsID = meid; addmodel.UsName = mename; addmodel.WinCent = WinCent; addmodel.AddTime = DateTime.Now; new BCW.BLL.Game.Bspay().Add(addmodel); //写进人气 new BCW.BLL.Game.Bslist().UpdateClick(id); //动态 string wText = string.Empty; if (IsWin == true) { wText = "[url=/bbs/uinfo.aspx?uid=" + meid + "]" + mename + "[/url]在[url=/bbs/game/bigsmall.aspx]大小庄[/url]《" + model.Title + "》赢得了" + PayCent + "" + bzText + ""; } else { wText = "[url=/bbs/uinfo.aspx?uid=" + meid + "]" + mename + "[/url]在[url=/bbs/game/bigsmall.aspx]大小庄[/url]《" + model.Title + "》失去了" + PayCent + "" + bzText + ""; } new BCW.BLL.Action().Add(13, 0, 0, "", wText); }