Exemplo n.º 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错误"));
        string   Title    = Utils.GetRequest("Title", "post", 2, @"^[\s\S]{1,15}$", "庄名限1-15个字符");
        long     SmallPay = Int64.Parse(Utils.GetRequest("SmallPay", "post", 4, @"^[1-9]\d*$", "最小下注填写错误"));
        long     BigPay   = Int64.Parse(Utils.GetRequest("BigPay", "post", 4, @"^[1-9]\d*$", "最大下注填写错误"));
        int      UsID     = int.Parse(Utils.GetRequest("UsID", "post", 2, @"^[1-9]\d*$", "用户ID错误"));
        string   UsName   = Utils.GetRequest("UsName", "post", 2, @"^[\s\S]{1,10}$", "昵称限1-10个字符");
        int      Click    = int.Parse(Utils.GetRequest("Click", "post", 2, @"^[1-9]\d*$", "用户ID错误"));
        DateTime AddTime  = Utils.ParseTime(Utils.GetRequest("AddTime", "post", 2, DT.RegexTime, "创建时间格式填写出错,正确格式如" + DT.FormatDate(DateTime.Now, 0) + ""));

        if (BigPay < SmallPay)
        {
            Utils.Error("最小下注不能大于最大下注", "");
        }
        if (!new BCW.BLL.Game.Bslist().Exists(id))
        {
            Utils.Error("不存在的记录", "");
        }
        if (!new BCW.BLL.User().Exists(UsID))
        {
            Utils.Error("不存在的会员记录", "");
        }

        BCW.Model.Game.Bslist model = new BCW.Model.Game.Bslist();
        model.ID       = id;
        model.Title    = Title;
        model.SmallPay = SmallPay;
        model.BigPay   = BigPay;
        model.UsID     = UsID;
        model.UsName   = UsName;
        model.Click    = Click;
        model.AddTime  = AddTime;
        new BCW.BLL.Game.Bslist().Update(model);
        Utils.Success("编辑大小庄", "编辑大小庄成功..", Utils.getUrl("bigsmall.aspx?act=edit&amp;id=" + id + "&amp;backurl=" + Utils.getPage(0) + ""), "1");
    }
Exemplo n.º 2
0
 /// <summary>
 /// 更新一条数据
 /// </summary>
 public void UpdateBasic(BCW.Model.Game.Bslist model)
 {
     dal.UpdateBasic(model);
 }
Exemplo n.º 3
0
 /// <summary>
 /// 增加一条数据
 /// </summary>
 public int  Add(BCW.Model.Game.Bslist model)
 {
     return(dal.Add(model));
 }