예제 #1
0
    protected void Button3_Click(object sender, EventArgs e)
    {
        int nowExpectNum = BLL.CommonClass.CommonDataBLL.getMaxqishu();

        if (nowExpectNum != 1)
        {
            ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('" + GetTran("007094", "只有在第一期时才能初始化!") + "');</script>");
            return;
        }
        txtMemberId.Text = DisposeString.DisString(txtMemberId.Text.Trim());

        int count = BLL.CommonClass.CommonDataBLL.getCountNumber(txtMemberId.Text.Trim());

        if (count > 0)
        {
            Page.ClientScript.RegisterStartupScript(GetType(), "", Transforms.ReturnAlert("该会员编号已存在!"));
            return;
        }

        Model.DefaultMessage def = GetModel(3, txtMemberId.Text.Trim());

        bool isSure = ManagerBLL.UpdateDefaultMember(def);

        if (!isSure)
        {
            Page.ClientScript.RegisterStartupScript(GetType(), "", Transforms.ReturnAlert("修改失败!"));
            return;
        }

        Page.ClientScript.RegisterStartupScript(GetType(), "", "<script language='javascript'>alert('修改成功!');</script>");
    }