Beispiel #1
0
    private void AgainPayPage()
    {
        if (IsOpen() == false)
        {
            Utils.Error("游戏开放时间:" + ub.GetSub("AppleOnTime", xmlPath) + "", "");
        }
        int meid = new BCW.User.Users().GetUsId();

        if (meid == 0)
        {
            Utils.Login();
        }

        int id = int.Parse(Utils.GetRequest("id", "get", 2, @"^[1-9]\d*$", "ID错误"));

        BCW.Model.Game.Applelist apple = new BCW.BLL.Game.Applelist().GetApplelist(id);
        if (apple == null)
        {
            Utils.Error("不存在的记录", "");
        }
        if (apple.EndTime.AddSeconds(-10) > DateTime.Now)
        {
        }
        else
        {
            Utils.Error("苹果机正在转动。。。", "");
        }

        int  myPayCount = new BCW.BLL.Game.Applepay().GetCount(meid, (id - 1));
        long Price      = Utils.ParseInt64(ub.GetSub("ApplePrice", xmlPath));
        long Prices     = Convert.ToInt64(Price * myPayCount);
        long gold       = new BCW.BLL.User().GetGold(meid);

        if (gold < Prices)
        {
            Utils.Error("您的" + ub.Get("SiteBz") + "不足" + Price + ",无法重压上期下注!", "");
        }

        //支付安全提示
        string[] p_pageArr = { "act", "id" };
        BCW.User.PaySafe.PaySafePage(meid, Utils.getPageUrl(), p_pageArr, "get");
        //扣币
        string mename = new BCW.BLL.User().GetUsName(meid);

        new BCW.BLL.User().UpdateiGold(meid, mename, -Prices, "苹果机消费");

        DataSet ds = new BCW.BLL.Game.Applepay().GetList("Types,PayCount", "UsID=" + meid + " and AppleId=" + (id - 1) + " and State=1");

        if (ds == null || ds.Tables[0].Rows.Count == 0)
        {
            Utils.Error("不存在的上期下注记录", "");
        }
        for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
        {
            int Types    = int.Parse(ds.Tables[0].Rows[i]["Types"].ToString());
            int PayCount = int.Parse(ds.Tables[0].Rows[i]["PayCount"].ToString());
            //更新总下注额与某项下注数
            new BCW.BLL.Game.Applelist().Update(id, Convert.ToInt64(PayCount * Price), Types, PayCount);
            BCW.Model.Game.Applepay model = new BCW.Model.Game.Applepay();
            model.AppleId  = id;
            model.PayCount = PayCount;
            model.Types    = Types;
            model.UsID     = meid;
            model.UsName   = mename;
            model.AddTime  = DateTime.Now;
            if (new BCW.BLL.Game.Applepay().Exists(Types, meid, id))
            {
                new BCW.BLL.Game.Applepay().Update(model);
            }
            else
            {
                new BCW.BLL.Game.Applepay().Add(model);
            }
        }

        string wText = "[url=/bbs/uinfo.aspx?uid=" + meid + "]" + mename + "[/url]在[url=/bbs/game/apple.aspx]苹果机第" + id + "期[/url]下注" + Prices + "" + ub.Get("SiteBz") + "";

        new BCW.BLL.Action().Add(17, id, 0, "", wText);
        Utils.Success("重压上期", "重压上期下注成功,花费" + Prices + "" + ub.Get("SiteBz") + "", Utils.getUrl("apple.aspx"), "2");
    }
Beispiel #2
0
 /// <summary>
 /// 更新一条数据
 /// </summary>
 public void Update(BCW.Model.Game.Applepay model)
 {
     dal.Update(model);
 }
Beispiel #3
0
    private void PayPage()
    {
        if (IsOpen() == false)
        {
            Utils.Error("游戏开放时间:" + ub.GetSub("AppleOnTime", xmlPath) + "", "");
        }
        int meid = new BCW.User.Users().GetUsId();

        if (meid == 0)
        {
            Utils.Login();
        }

        Master.Title   = "我要下注";
        Master.Refresh = 3;
        Master.Gourl   = Utils.getUrl("apple.aspx");

        builder.Append(Out.Tab("<div class=\"title\">", ""));
        builder.Append("<a href=\"" + Utils.getUrl("apple.aspx") + "\">苹果机</a>&gt;");
        builder.Append("下注");
        builder.Append(Out.Tab("</div>", ""));
        int id    = int.Parse(Utils.GetRequest("id", "get", 2, @"^[1-9]\d*$", "ID错误"));
        int ptype = int.Parse(Utils.GetRequest("ptype", "get", 2, @"^[1-8]$", "下注类型错误"));
        int num   = int.Parse(Utils.GetRequest("num", "get", 1, @"^[1-9]\d*$", "1"));

        if (num > 500)
        {
            num = 500;
        }

        BCW.Model.Game.Applelist apple = new BCW.BLL.Game.Applelist().GetApplelist(id);
        if (apple == null)
        {
            Utils.Error("不存在的记录", "");
        }
        if (apple.EndTime.AddSeconds(-10) > DateTime.Now)
        {
        }
        else
        {
            Utils.Error("苹果机正在转动。。。", "");
        }

        long Price = Utils.ParseInt64(ub.GetSub("ApplePrice", xmlPath));

        if (num > 1)
        {
            Price = Convert.ToInt64(Price * num);
        }

        long gold = new BCW.BLL.User().GetGold(meid);

        if (gold < Price)
        {
            Utils.Error("您的" + ub.Get("SiteBz") + "不足" + Price + ",无法下注!", "");
        }

        int AppleOutIDNum = Utils.ParseInt(ub.GetSub("AppleOutIDNum", xmlPath));
        int myCount       = new BCW.BLL.Game.Applepay().GetCount(meid, id);

        if (AppleOutIDNum < (myCount + num))
        {
            if (AppleOutIDNum < myCount)
            {
                Utils.Error("很遗憾,每ID每期限下注" + AppleOutIDNum + "注", "");
            }
            else
            {
                Utils.Error("很遗憾,每ID每期限下注" + AppleOutIDNum + "注,你还可以下注" + (AppleOutIDNum - myCount - num) + "注", "");
            }
        }
        //支付安全提示
        string[] p_pageArr = { "act", "id", "ptype", "num" };
        BCW.User.PaySafe.PaySafePage(meid, Utils.getPageUrl(), p_pageArr, "get");
        //是否刷屏
        //string appName = "LIGHT_APPLE";
        //int Expir = Utils.ParseInt(ub.GetSub("AppleExpir", xmlPath));
        //BCW.User.Users.IsFresh(appName, Expir);

        //扣币
        string mename = new BCW.BLL.User().GetUsName(meid);

        new BCW.BLL.User().UpdateiGold(meid, mename, -Price, "苹果机消费");
        //更新总下注额与某项下注数
        new BCW.BLL.Game.Applelist().Update(id, Price, ptype, num);

        BCW.Model.Game.Applepay model = new BCW.Model.Game.Applepay();
        model.AppleId  = id;
        model.PayCount = num;
        model.Types    = ptype;
        model.UsID     = meid;
        model.UsName   = mename;
        model.AddTime  = DateTime.Now;
        if (new BCW.BLL.Game.Applepay().Exists(ptype, meid, id))
        {
            new BCW.BLL.Game.Applepay().Update(model);
        }
        else
        {
            new BCW.BLL.Game.Applepay().Add(model);
        }

        string wText = "[url=/bbs/uinfo.aspx?uid=" + meid + "]" + mename + "[/url]在[url=/bbs/game/apple.aspx]苹果机第" + id + "期[/url]下注" + Price + "" + ub.Get("SiteBz") + "";

        new BCW.BLL.Action().Add(17, id, 0, "", wText);

        builder.Append(Out.Tab("<div>", Out.Hr()));
        builder.Append("下注" + AppleType(ptype) + "成功!花费" + Price + "" + ub.Get("SiteBz") + "<br />");
        builder.Append("您可以再压:<a href=\"" + Utils.getUrl("apple.aspx?act=pay&amp;ptype=" + ptype + "&amp;id=" + id + "&amp;num=1") + "\">1注</a>.");
        builder.Append("<a href=\"" + Utils.getUrl("apple.aspx?act=pay&amp;ptype=" + ptype + "&amp;id=" + id + "&amp;num=5") + "\">5注</a>.");
        builder.Append("<a href=\"" + Utils.getUrl("apple.aspx?act=pay&amp;ptype=" + ptype + "&amp;id=" + id + "&amp;num=10") + "\">10注</a><br />");
        builder.Append("<a href=\"" + Utils.getUrl("apple.aspx?act=pay&amp;ptype=" + ptype + "&amp;id=" + id + "&amp;num=50") + "\">50注</a>.");
        builder.Append("<a href=\"" + Utils.getUrl("apple.aspx?act=pay&amp;ptype=" + ptype + "&amp;id=" + id + "&amp;num=100") + "\">100注</a>.");
        builder.Append("<a href=\"" + Utils.getUrl("apple.aspx?act=pay&amp;ptype=" + ptype + "&amp;id=" + id + "&amp;num=200") + "\">200注</a>.");
        builder.Append("<a href=\"" + Utils.getUrl("apple.aspx?act=pay&amp;ptype=" + ptype + "&amp;id=" + id + "&amp;num=500") + "\">500注</a>");
        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("<a href=\"" + Utils.getUrl("apple.aspx") + "\">苹果机</a>");
        builder.Append(Out.Tab("</div>", ""));
    }
Beispiel #4
0
 /// <summary>
 /// 增加一条数据
 /// </summary>
 public int  Add(BCW.Model.Game.Applepay model)
 {
     return(dal.Add(model));
 }