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

        if (ManageId != 1 && ManageId != 9)
        {
            Utils.Error("权限不足", "");
        }
        int      id         = int.Parse(Utils.GetRequest("id", "post", 2, @"^[1-9]\d*$", "ID错误"));
        int      WinNum     = int.Parse(Utils.GetRequest("WinNum", "post", 2, @"^[0-9]\d*$", "开出数字填写错误"));
        DateTime BeginTime  = Utils.ParseTime(Utils.GetRequest("BeginTime", "post", 2, DT.RegexTime, "开盘时间格式填写出错,正确格式如" + DT.FormatDate(DateTime.Now, 0) + ""));
        DateTime EndTime    = Utils.ParseTime(Utils.GetRequest("EndTime", "post", 2, DT.RegexTime, "开奖时间格式填写出错,正确格式如" + DT.FormatDate(DateTime.Now, 0) + ""));
        int      OutNum     = int.Parse(Utils.GetRequest("OutNum", "post", 2, @"^[0-9]\d*$", "可购买份数填写错误"));
        int      AddNum     = int.Parse(Utils.GetRequest("AddNum", "post", 2, @"^[0-9]\d*$", "已购买份数填写错误"));
        int      iCent      = int.Parse(Utils.GetRequest("iCent", "post", 2, @"^[0-9]\d*$", "每份价格填写错误"));
        int      Odds       = int.Parse(Utils.GetRequest("Odds", "post", 2, @"^[0-9]\d*$", "本期赔率填写错误"));
        long     Pool       = Int64.Parse(Utils.GetRequest("Pool", "post", 4, @"^[0-9]\d*$", "奖池额填写错误"));
        long     BeforePool = Int64.Parse(Utils.GetRequest("BeforePool", "post", 4, @"^[0-9]\d*$", "上期奖池额填写错误"));

        if (!new BCW.BLL.Game.Balllist().Exists(id))
        {
            Utils.Error("不存在的记录", "");
        }

        //记录日志
        if (Utils.GetDomain().Contains("kubao") || Utils.GetDomain().Contains("tuhao") || Utils.GetDomain().Contains("th") || Utils.GetDomain().Contains("kb288"))
        {
            String sLogFilePath = System.AppDomain.CurrentDomain.BaseDirectory.ToString() + "/logstr/" + DateTime.Now.ToString("MM-dd") + ".txt";
            LogHelper.Write(sLogFilePath, "操作管理员:" + ManageId + "号/编辑彩球期数:" + id + "|是否预设:" + WinNum + "");
        }

        BCW.Model.Game.Balllist model = new BCW.Model.Game.Balllist();
        model.ID         = id;
        model.WinNum     = WinNum;
        model.BeginTime  = BeginTime;
        model.EndTime    = EndTime;
        model.OutNum     = OutNum;
        model.AddNum     = AddNum;
        model.iCent      = iCent;
        model.Odds       = Odds;
        model.Pool       = Pool;
        model.BeforePool = BeforePool;
        new BCW.BLL.Game.Balllist().Update(model);
        Utils.Success("编辑第" + id + "期", "编辑第" + id + "期成功..", Utils.getUrl("ball.aspx?act=edit&id=" + id + "&backurl=" + Utils.getPage(0) + ""), "1");
    }
示例#2
0
    private void ReloadPage()
    {
        Master.Title = ub.GetSub("BallName", xmlPath);
        int    meid = new BCW.User.Users().GetUsId();
        string Logo = ub.GetSub("BallLogo", xmlPath);

        if (Logo != "")
        {
            builder.Append(Out.Tab("<div>", ""));
            builder.Append("<img src=\"" + Logo + "\" alt=\"load\"/>");
            builder.Append(Out.Tab("</div>", "<br />"));
        }
        builder.Append(Out.Tab("<div class=\"title\">", ""));
        builder.Append("<a href=\"" + Utils.getUrl("/bbs/game/default.aspx") + "\">游戏大厅</a>&gt;彩球");
        builder.Append(Out.Tab("</div>", "<br />"));

        string Notes = ub.GetSub("BallNotes", xmlPath);

        if (Notes != "")
        {
            builder.Append(Out.Tab("<div>", ""));
            builder.Append(Out.SysUBB(Notes) + "");
            builder.Append(Out.Tab("</div>", "<br />"));
        }
        if (IsOpen() == true)
        {
            new BCW.User.Ball().BallPage(0, 0);
            BCW.Model.Game.Balllist ball = null;
            ball = new BCW.BLL.Game.Balllist().GetBalllist();
            if (ball.ID == 0)
            {
                //第一期开始
                ball.WinNum = 0;
                ball.OutNum = Utils.ParseInt(ub.GetSub("BallOutNum", xmlPath));
                ball.iCent  = Utils.ParseInt(ub.GetSub("BalliCent", xmlPath));
                ball.AddNum = 0;
                ball.Odds   = Utils.ParseInt(ub.GetSub("BallOdds", xmlPath));
                //系统投入币
                int SysCent = Utils.ParseInt(ub.GetSub("BallSysPay", xmlPath));
                //开奖周期分钟
                int CycleMin = Utils.ParseInt(ub.GetSub("BallCycleMin", xmlPath));
                ball.Pool       = Convert.ToInt64(SysCent);
                ball.BeforePool = Convert.ToInt64(SysCent);
                ball.BeginTime  = DateTime.Now;
                ball.EndTime    = DateTime.Now.AddMinutes(Convert.ToDouble(CycleMin));
                ball.ID         = new BCW.BLL.Game.Balllist().Add(ball);
            }
            builder.Append(Out.Tab("<div class=\"title\">", ""));
            builder.Append("欢迎进入疯狂彩球第" + ball.ID + "期");
            builder.Append(Out.Tab("</div>", "<br />"));
            builder.Append(Out.Tab("<div>", ""));
            if (ball.EndTime < DateTime.Now)
            {
                builder.Append("系统正在开奖。。。");
            }
            else
            {
                builder.Append("距离开奖还有" + DT.DateDiff(DateTime.Now, ball.EndTime) + "");
            }

            builder.Append("<br />每份下注:" + Utils.ConvertGold(Convert.ToInt64(ball.iCent)) + "" + ub.Get("SiteBz") + "/赔率1:" + ball.Odds + "");
            builder.Append("<br />奖池:" + Utils.ConvertGold(ball.Pool) + "" + ub.Get("SiteBz") + "<br />");
            if (ball.BeforePool > 0)
            {
                builder.Append("上期落下奖池:" + Utils.ConvertGold(ball.BeforePool) + "" + ub.Get("SiteBz") + "<br />");
            }
            builder.Append("<a href=\"" + Utils.getUrl("ball.aspx?act=pay") + "\">立即投注</a> ");
        }
        else
        {
            builder.Append(Out.Tab("<div class=\"text\">", ""));
            builder.Append("欢迎进入疯狂彩球游戏");
            builder.Append(Out.Tab("</div>", "<br />"));
            builder.Append(Out.Tab("<div>", ""));
            builder.Append("游戏开放时间:" + ub.GetSub("BallOnTime", xmlPath) + "");
            builder.Append("<br />目前还没到开放时间哦!");
            builder.Append("<br /><a href=\"" + Utils.getUrl("ball.aspx?act=list&amp;backurl=" + Utils.PostPage(1) + "") + "\">历史开奖</a> ");
        }
        builder.Append("<a href=\"" + Utils.getUrl("ball.aspx?act=case") + "\">兑奖</a> ");
        builder.Append("<a href=\"" + Utils.getUrl("ball.aspx") + "\">刷新</a><br />");
        builder.Append("你目前自带" + Utils.ConvertGold(new BCW.BLL.User().GetGold(meid)) + "" + ub.Get("SiteBz") + "");
        builder.Append(Out.Tab("</div>", "<br />"));
        builder.Append(Out.Tab("<div class=\"text\">", ""));
        builder.Append("<a href=\"" + Utils.getUrl("ball.aspx?act=mylist&amp;ptype=1") + "\">未开投注</a> ");
        builder.Append("<a href=\"" + Utils.getUrl("ball.aspx?act=mylist&amp;ptype=2") + "\">历史投注</a><br />");
        builder.Append("<a href=\"" + Utils.getUrl("ball.aspx?act=top") + "\">排行榜单</a> ");
        builder.Append("<a href=\"" + Utils.getUrl("ball.aspx?act=help") + "\">游戏帮助</a>");
        builder.Append(Out.Tab("</div>", "<br />"));
        builder.Append(Out.Tab("<div class=\"text\">", ""));
        builder.Append("【往期开奖记录】");
        builder.Append(Out.Tab("</div>", "<br />"));
        IList <BCW.Model.Game.Balllist> listBalllist = new BCW.BLL.Game.Balllist().GetBalllists(3, "State=1");

        if (listBalllist.Count > 0)
        {
            builder.Append(Out.Tab("<div>", ""));
            int k = 1;
            foreach (BCW.Model.Game.Balllist n in listBalllist)
            {
                builder.Append("第" + n.ID + "期开出号码:<a href=\"" + Utils.getUrl("ball.aspx?act=listview&amp;id=" + n.ID + "&amp;backurl=" + Utils.PostPage(1) + "") + "\"><b>" + n.WinNum + "</b></a><br />");

                k++;
            }
            builder.Append("<a href=\"" + Utils.getUrl("ball.aspx?act=list&amp;backurl=" + Utils.PostPage(1) + "") + "\">&gt;&gt;查看历史开奖</a>");
            builder.Append(Out.Tab("</div>", ""));
        }
        else
        {
            builder.Append(Out.Div("div", "没有相关记录.."));
        }

        //闲聊显示
        builder.Append(Out.SysUBB(BCW.User.Users.ShowSpeak(8, "ball.aspx", 0, 0)));
        builder.Append(Out.Tab("<div class=\"text\">", "<br />"));
        builder.Append("【游戏动态记录】");
        builder.Append(Out.Tab("</div>", ""));
        // 开始读取动态列表
        int    SizeNum  = 3;
        string strWhere = "Types=8";
        IList <BCW.Model.Action> listAction = new BCW.BLL.Action().GetActions(SizeNum, strWhere);

        if (listAction.Count > 0)
        {
            int k = 1;
            foreach (BCW.Model.Action n in listAction)
            {
                builder.Append(Out.Tab("<div>", "<br />"));
                string ForNotes = Regex.Replace(n.Notes, @"\[url=\/bbs\/game\/([\s\S]+?)\]([\s\S]+?)\[\/url\]", "$2", RegexOptions.IgnoreCase);
                ForNotes = ForNotes.Replace("疯狂彩球", "");
                builder.AppendFormat("{0}前{1}", DT.DateDiff2(DateTime.Now, n.AddTime), Out.SysUBB(ForNotes));
                builder.Append(Out.Tab("</div>", ""));
                k++;
            }
            if (k > SizeNum)
            {
                builder.Append(Out.Tab("<div class=\"text\">", "<br />"));
                builder.Append("<a href=\"" + Utils.getUrl("/bbs/action.aspx?ptype=8&amp;backurl=" + Utils.PostPage(1) + "") + "\">更多游戏动态</a>");
                builder.Append(Out.Tab("</div>", ""));
            }
        }
        //游戏底部Ubb
        string Foot = ub.GetSub("BallFoot", xmlPath);

        if (Foot != "")
        {
            builder.Append(Out.Tab("<div>", "<br />"));
            builder.Append(BCW.User.AdminCall.AdminUBB(Out.SysUBB(Foot)));
            builder.Append(Out.Tab("</div>", ""));
        }
        builder.Append(Out.Tab("<div class=\"title\">", Out.Hr()));
        builder.Append("<a href=\"" + Utils.getUrl("/default.aspx") + "\">首页</a>-");
        builder.Append("<a href=\"" + Utils.getUrl("default.aspx") + "\">游戏大厅</a>");
        builder.Append(Out.Tab("</div>", ""));
    }
示例#3
0
 /// <summary>
 /// 更新一条数据
 /// </summary>
 public void Update(BCW.Model.Game.Balllist model)
 {
     dal.Update(model);
 }
示例#4
0
 /// <summary>
 /// 增加一条数据
 /// </summary>
 public int  Add(BCW.Model.Game.Balllist model)
 {
     return(dal.Add(model));
 }