예제 #1
0
    protected void Button1_Click(object sender, EventArgs e)
    {
        if (this.Number.Text.Trim() == "")
        {
            Page.ClientScript.RegisterStartupScript(GetType(), "", "<script>alert('" + GetTran("000787", "请输入编号!") + "')</script>");
            return;
        }

        MemberInfoModel info = ReleaseBLL.GetMemberInfo(this.Number.Text);

        if (info == null)
        {
            Page.ClientScript.RegisterStartupScript(GetType(), "", "<script>alert('" + GetTran("001536", "该编号不存在于系统中") + "')</script>");
            return;
        }

        try
        {
            double money = Convert.ToDouble(this.money.Text);
            if (money <= 0)
            {
                Page.ClientScript.RegisterStartupScript(GetType(), "", "<script>alert('" + GetTran("001539", "操作失败,输入的金额不能小于0!") + "')</script>");
                return;
            }

            if (this.question.Text.Trim() == "")
            {
                Page.ClientScript.RegisterStartupScript(GetType(), "", "<script>alert('" + GetTran("001540", "退回原因不能为空!") + "')</script>");
                return;
            }
            ChongHongModel chonghong = new ChongHongModel();
            chonghong.MoneyNum  = money;
            chonghong.Number    = this.Number.Text;
            chonghong.ExpectNum = Convert.ToInt32(ViewState["qs"]);
            chonghong.Remark    = this.question.Text;
            chonghong.StartDate = DateTime.Now.ToUniversalTime();
            bool blean = ReleaseBLL.AddChongHong(chonghong);
            if (blean)
            {
                Page.ClientScript.RegisterStartupScript(GetType(), "", "<script>alert('" + GetTran("001401", "操作成功!") + "');location.href='StrikeBalancesView.aspx';</script>");
                cleartext();
            }
        }

        catch
        {
            Page.ClientScript.RegisterStartupScript(GetType(), "", "<script>alert('" + GetTran("001541", "操作失败!") + "')</script>");
            return;
        }
    }