Esempio n. 1
0
    private void AddSavePage()
    {
        string StName    = Utils.GetRequest("StName", "post", 2, @"^[\s\S]{1,20}$", "名称限1-20字");
        int    Types     = int.Parse(Utils.GetRequest("Types", "post", 2, @"^[0-9]\d*$", "ID错误"));
        int    ShotTypes = int.Parse(Utils.GetRequest("ShotTypes", "post", 2, @"^[0-1]\d*$", "出手方式选择错误"));
        int    SmallPay  = int.Parse(Utils.GetRequest("SmallPay", "post", 2, @"^[0-9]\d*$", "最小下注填写错误"));
        int    BigPay    = int.Parse(Utils.GetRequest("BigPay", "post", 2, @"^[0-9]\d*$", "最大下注填写错误"));
        int    Expir     = int.Parse(Utils.GetRequest("Expir", "post", 2, @"^[0-9]\d*$", "超时时间填写错误"));

        BCW.Model.Game.Stone model = new BCW.Model.Game.Stone();
        model.StName    = StName;
        model.Types     = Types;
        model.ShotTypes = ShotTypes;
        model.SmallPay  = SmallPay;
        model.BigPay    = BigPay;
        model.Expir     = Expir;
        model.PayCent   = 0;
        model.OneUsId   = 0;
        model.TwoUsId   = 0;
        model.ThrUsId   = 0;
        model.OneShot   = 0;
        model.TwoShot   = 0;
        model.ThrShot   = 0;
        model.Online    = 0;
        model.OneStat   = 0;
        model.TwoStat   = 0;
        model.ThrStat   = 0;
        model.IsStatus  = 0;
        model.NextShot  = 1;
        model.PkCount   = 1;

        new BCW.BLL.Game.Stone().Add(model);

        Utils.Success("添加成功", "添加房间成功..", Utils.getUrl("stone.aspx"), "1");
    }
Esempio n. 2
0
    private void EditSavePage()
    {
        int    id        = int.Parse(Utils.GetRequest("id", "post", 2, @"^[0-9]\d*$", "ID错误"));
        string StName    = Utils.GetRequest("StName", "post", 2, @"^[\s\S]{1,20}$", "名称限1-20字");
        int    Types     = int.Parse(Utils.GetRequest("Types", "post", 2, @"^[0-9]\d*$", "ID错误"));
        int    ShotTypes = int.Parse(Utils.GetRequest("ShotTypes", "post", 2, @"^[0-1]\d*$", "出手方式选择错误"));
        int    SmallPay  = int.Parse(Utils.GetRequest("SmallPay", "post", 2, @"^[0-9]\d*$", "最小下注填写错误"));
        int    BigPay    = int.Parse(Utils.GetRequest("BigPay", "post", 2, @"^[0-9]\d*$", "最大下注填写错误"));
        int    Expir     = int.Parse(Utils.GetRequest("Expir", "post", 2, @"^[0-9]\d*$", "超时时间填写错误"));

        if (!new BCW.BLL.Game.Stone().Exists(id))
        {
            Utils.Error("不存在的记录", "");
        }
        BCW.Model.Game.Stone model = new BCW.Model.Game.Stone();
        model.ID        = id;
        model.StName    = StName;
        model.Types     = Types;
        model.ShotTypes = ShotTypes;
        model.SmallPay  = SmallPay;
        model.BigPay    = BigPay;
        model.Expir     = Expir;
        new BCW.BLL.Game.Stone().Update(model);

        Utils.Success("修改成功", "修改房间成功..", Utils.getUrl("stone.aspx"), "1");
    }