示例#1
0
    private void EditPage()
    {
        int ManageId = new BCW.User.Manage().IsManageLogin();

        if (Utils.GetTopDomain().Contains("tuhao") || Utils.GetTopDomain().Contains("th"))
        {
            if (ManageId != 1 && ManageId != 2)
            {
                Utils.Error("权限不足", "");
            }
        }
        else if (Utils.GetTopDomain().Contains("kb288.net"))
        {
            if (ManageId != 1 && ManageId != 3 && ManageId != 4 && ManageId != 5)
            {
                Utils.Error("权限不足", "");
            }
        }
        else
        {
            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("编辑第" + id + "局挖宝");
        builder.Append(Out.Tab("</div>", ""));
        BCW.Model.Game.Dicelist model = new BCW.BLL.Game.Dicelist().GetDicelist(id);
        if (model == null)
        {
            Utils.Error("不存在的记录", "");
        }
        if (model.State == 0)
        {
            builder.Append(Out.Tab("<div class=\"text\">", "<br />"));
            builder.Append("当开出数字非0时,开奖时则使用该数字作为开奖结果");
            builder.Append(Out.Tab("</div>", ""));
        }
        string strText = "开出数字(格式如:123):/,开盘时间:/,开奖时间:/,,,";
        string strName = "WinNum,BeginTime,EndTime,id,act,backurl";
        string strType = "num,date,date,hidden,hidden,hidden";
        string strValu = "" + model.WinNum + "'" + DT.FormatDate(model.BeginTime, 0) + "'" + DT.FormatDate(model.EndTime, 0) + "'" + id + "'editsave'" + Utils.getPage(0) + "";
        string strEmpt = "false,false,false,false,false,false";
        string strIdea = "/";
        string strOthe = "确定编辑|reset,dice.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("dice.aspx") + "\">返回上一级</a><br />");
        builder.Append("<a href=\"" + Utils.getUrl("dice.aspx?act=del&amp;id=" + id + "&amp;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 />"));
    }
示例#2
0
    /// <summary>
    /// 挖宝自动游戏程序
    /// </summary>
    /// <param name="DiceId">局数ID</param>
    /// <param name="dt">截止时间</param>
    private void ChangePalyDice()
    {
        BCW.Model.Game.Dicelist dice = null;
        new BCW.User.Game.Dice().DicePage();
        dice = new BCW.BLL.Game.Dicelist().GetDicelist();
        int  DiceId = dice.ID;
        long Sec    = DT.DateDiff(dice.EndTime, DateTime.Now, 4);

        if (DiceId > 0)
        {
            int UsIDNum = new BCW.BLL.Game.Dicepay().GetCount(DiceId);//当期下注ID数

            //如果小于15个则自在不同秒数中自动出动1个ID来下注
            if (UsIDNum < 5)
            {
                bool IsPlay = false;
                Sec = 360 - Sec;

                int ZD = 0;
                if (Sec > 5 && Sec <= 30 && ub.GetSub("DiceZD1", xmlPath) == "0")
                {
                    IsPlay = true;
                    ZD     = 1;
                }
                if (Sec > 30 && Sec <= 60 && ub.GetSub("DiceZD2", xmlPath) == "0")
                {
                    IsPlay = true;
                    ZD     = 2;
                }
                else if (Sec > 60 && Sec <= 90 && ub.GetSub("DiceZD3", xmlPath) == "0")
                {
                    IsPlay = true;
                    ZD     = 3;
                }
                else if (Sec > 90 && Sec <= 120 && ub.GetSub("DiceZD4", xmlPath) == "0")
                {
                    IsPlay = true;
                    ZD     = 4;
                }
                else if (Sec > 120 && Sec <= 150 && ub.GetSub("DiceZD5", xmlPath) == "0")
                {
                    IsPlay = true;
                    ZD     = 5;
                }
                else if (Sec > 150 && Sec <= 180 && ub.GetSub("DiceZD6", xmlPath) == "0")
                {
                    IsPlay = true;
                    ZD     = 6;
                }
                else if (Sec > 180 && Sec <= 210 && ub.GetSub("DiceZD7", xmlPath) == "0")
                {
                    IsPlay = true;
                    ZD     = 7;
                }
                else if (Sec > 210 && Sec <= 240 && ub.GetSub("DiceZD8", xmlPath) == "0")
                {
                    IsPlay = true;
                    ZD     = 8;
                }
                else if (Sec > 240 && Sec <= 270 && ub.GetSub("DiceZD9", xmlPath) == "0")
                {
                    IsPlay = true;
                    ZD     = 9;
                }
                else if (Sec > 270 && Sec <= 300 && ub.GetSub("DiceZD10", xmlPath) == "0")
                {
                    IsPlay = true;
                    ZD     = 10;
                }
                else if (Sec > 300 && Sec <= 330 && ub.GetSub("DiceZD11", xmlPath) == "0")
                {
                    IsPlay = true;
                    ZD     = 11;
                }
                else if (Sec > 330 && Sec <= 355 && ub.GetSub("DiceZD12", xmlPath) == "0")
                {
                    IsPlay = true;
                    ZD     = 12;
                }
                if (IsPlay)
                {
                    //更新某分钟已出动过
                    ub xml = new ub();
                    xml.ReloadSub(xmlPath); //加载配置
                    xml.dss["DiceZD" + ZD + ""] = 1;

                    System.IO.File.WriteAllText(HttpContext.Current.Server.MapPath(xmlPath), xml.Post(xml.dss), System.Text.Encoding.UTF8);
                    //进行自动下注
                    PlayDice(DiceId);
                }
            }
        }
    }
示例#3
0
    private void ReloadPage()
    {
        Master.Title = "挖宝管理";
        builder.Append(Out.Tab("<div class=\"title\">", ""));
        builder.Append("<a href=\"" + Utils.getUrl("default.aspx") + "\">游戏</a>&gt;");
        builder.Append("挖宝");
        builder.Append(Out.Tab("</div>", "<br />"));

        int    pageIndex;
        int    recordCount;
        int    pageSize = Convert.ToInt32(ub.Get("SiteListNo"));
        string strWhere = string.Empty;

        strWhere = "";
        string[] pageValUrl = { "act", "backurl" };
        pageIndex = Utils.ParseInt(Request.QueryString["page"]);
        if (pageIndex == 0)
        {
            pageIndex = 1;
        }

        // 开始读取列表
        IList <BCW.Model.Game.Dicelist> listDicelist = new BCW.BLL.Game.Dicelist().GetDicelists(pageIndex, pageSize, strWhere, out recordCount);

        if (listDicelist.Count > 0)
        {
            int k = 1;
            foreach (BCW.Model.Game.Dicelist n in listDicelist)
            {
                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("dice.aspx?act=edit&amp;id=" + n.ID + "&amp;backurl=" + Utils.PostPage(1) + "") + "\">[管理]&gt;</a>");

                if (n.State == 0)
                {
                    builder.Append("第" + n.ID + "局开出:<a href=\"" + Utils.getUrl("dice.aspx?act=view&amp;id=" + n.ID + "&amp;backurl=" + Utils.PostPage(1) + "") + "\">未开</a>");
                }
                else
                {
                    builder.Append("第" + n.ID + "局开出:<a href=\"" + Utils.getUrl("dice.aspx?act=view&amp;id=" + n.ID + "&amp;backurl=" + Utils.PostPage(1) + "") + "\">" + Utils.ConvertSeparated(n.WinNum.ToString(), 1, ",") + "</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", "没有相关记录.."));
        }
        builder.Append(Out.Tab("<div class=\"hr\"></div>", Out.Hr()));
        builder.Append(Out.Tab("<div>", ""));
        builder.Append("<a href=\"" + Utils.getUrl("dice.aspx?act=stat") + "\">赢利分析</a><br />");
        builder.Append("<a href=\"" + Utils.getUrl("dice.aspx?act=top") + "\">游戏排行</a><br />");
        builder.Append("<a href=\"" + Utils.getUrl("dice.aspx?act=back") + "\">返赢返负</a><br />");
        builder.Append("<a href=\"" + Utils.getUrl("dice.aspx?act=reset") + "\">重置游戏</a><br />");
        builder.Append("<a href=\"" + Utils.getUrl("../xml/diceset.aspx?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 />"));
    }
示例#4
0
    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.Dicelist model = new BCW.BLL.Game.Dicelist().GetDicelist(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("dice.aspx?act=view&amp;ptype=1&amp;id=" + id + "&amp;backurl=" + Utils.getPage(0) + "") + "\">下注</a>|");
        }

        if (ptype == 2)
        {
            builder.Append("中奖");
        }
        else
        {
            builder.Append("<a href=\"" + Utils.getUrl("dice.aspx?act=view&amp;ptype=2&amp;id=" + id + "&amp;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 += "DiceId=" + id + "";
        }
        else
        {
            strWhere += "DiceId=" + id + " and state>0 and winCent>0";
        }

        string[] pageValUrl = { "act", "id", "ptype", "backurl" };
        pageIndex = Utils.ParseInt(Request.QueryString["page"]);
        if (pageIndex == 0)
        {
            pageIndex = 1;
        }

        // 开始读取列表
        IList <BCW.Model.Game.Dicepay> listDicepay = new BCW.BLL.Game.Dicepay().GetDicepays(pageIndex, pageSize, strWhere, out recordCount);

        if (listDicepay.Count > 0)
        {
            builder.Append(Out.Tab("<div class=\"text\">", ""));
            builder.Append("第" + id + "局开出:<b>" + Utils.ConvertSeparated(model.WinNum.ToString(), 1, ",") + "</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.Dicepay n in listDicepay)
            {
                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 + "&amp;backurl=" + Utils.PostPage(1) + "") + "\">" + n.UsName + "</a>");

                string sText = string.Empty;
                if (n.Types == 1)
                {
                    sText = "押大小:" + ((n.BuyNum == 1) ? "大" : "小");
                }
                else if (n.Types == 2)
                {
                    sText = "押单双:" + ((n.BuyNum == 1) ? "单" : "双");
                }
                else if (n.Types == 3)
                {
                    sText = "押总和:" + n.BuyNum.ToString();
                }
                else if (n.Types == 4)
                {
                    sText = "押对子:" + n.BuyNum.ToString();
                }
                else if (n.Types == 5)
                {
                    if (n.BuyNum == 0)
                    {
                        sText = "押任意豹子";
                    }
                    else
                    {
                        sText = "押豹子" + n.BuyNum.ToString();
                    }
                }

                string bzTypes = string.Empty;
                if (n.bzType == 0)
                {
                    bzTypes = ub.Get("SiteBz");
                }
                else
                {
                    bzTypes = ub.Get("SiteBz2");
                }

                if (n.State == 0)
                {
                    builder.Append(sText + ",共" + n.BuyCent + "" + bzTypes + "[" + DT.FormatDate(n.AddTime, 13) + "]");
                }
                else if (n.State == 1)
                {
                    builder.Append(sText + ",共" + n.BuyCent + "" + bzTypes + "[" + DT.FormatDate(n.AddTime, 1) + "]");
                    if (n.WinCent > 0)
                    {
                        builder.Append("赢" + n.WinCent + "" + bzTypes + "");
                    }
                }
                else
                {
                    builder.Append(sText + ",共" + n.BuyCent + "" + bzTypes + ",赢" + n.WinCent + "" + bzTypes + "[" + 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>" + Utils.ConvertSeparated(model.WinNum.ToString(), 1, ",") + "</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("dice.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 />"));
    }