protected void bt_Save_Click(object sender, EventArgs e)
    {
        FNA_FeeWriteOffDetail m = new FNA_FeeWriteOffBLL().GetDetailModel((int)ViewState["ID"]);

        if (decimal.Parse(tbx_ApproveCost.Text) > m.WriteOffCost)
        {
            MessageBox.Show(this, "批复核销金额不能超过申请核销金额!");
            return;
        }

        decimal OldAdjustCost = m.AdjustCost;
        decimal AdjustCost = decimal.Parse(tbx_ApproveCost.Text) - m.WriteOffCost;

        m.AdjustReason = tbx_AdjustReason.Text;
        m["DeductReason"] = ddl_DeductReason.SelectedValue;
        if (AdjustCost != OldAdjustCost)
        {
            if (rbl_AdjustMode.SelectedValue == "")
            {
                MessageBox.Show(this, "请选择正确的调整方式!");
                return;
            }
            else
            {
                FNA_FeeWriteOffDetail_AdjustInfoBLL _Adjustbll = new FNA_FeeWriteOffDetail_AdjustInfoBLL();

                _Adjustbll.Model.WriteOffDetailID = (int)ViewState["ID"];
                _Adjustbll.Model.AdjustMode = int.Parse(rbl_AdjustMode.SelectedValue);
                _Adjustbll.Model.AdjustCost = decimal.Parse(tbx_ApproveCost.Text) - m.WriteOffCost;
                _Adjustbll.Model.AdjustReason = ddl_DeductReason.SelectedValue;
                _Adjustbll.Model.Remark = tbx_AdjustReason.Text;
                _Adjustbll.Model.InsertStaff = (int)Session["UserID"];
                _Adjustbll.Add();

                Session["SuccessFlag"] = true;
                ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "message", "<script language='javascript'>window.close();</script>", false);

            }
        }
        else
        {
            MessageBox.Show(this, "批复金额尚没有修改!");
            return;
        }
    }
Exemplo n.º 2
0
    protected void bt_Save_Click(object sender, EventArgs e)
    {
        FNA_FeeWriteOffDetail m = new FNA_FeeWriteOffBLL().GetDetailModel((int)ViewState["ID"]);

        if (decimal.Parse(tbx_ApproveCost.Text) > m.WriteOffCost)
        {
            MessageBox.Show(this, "批复核销金额不能超过申请核销金额!");
            return;
        }

        decimal OldAdjustCost = m.AdjustCost;
        decimal AdjustCost    = decimal.Parse(tbx_ApproveCost.Text) - m.WriteOffCost;

        m.AdjustReason    = tbx_AdjustReason.Text;
        m["DeductReason"] = ddl_DeductReason.SelectedValue;
        if (AdjustCost != OldAdjustCost)
        {
            if (rbl_AdjustMode.SelectedValue == "")
            {
                MessageBox.Show(this, "请选择正确的调整方式!");
                return;
            }
            else
            {
                FNA_FeeWriteOffDetail_AdjustInfoBLL _Adjustbll = new FNA_FeeWriteOffDetail_AdjustInfoBLL();

                _Adjustbll.Model.WriteOffDetailID = (int)ViewState["ID"];
                _Adjustbll.Model.AdjustMode       = int.Parse(rbl_AdjustMode.SelectedValue);
                _Adjustbll.Model.AdjustCost       = decimal.Parse(tbx_ApproveCost.Text) - m.WriteOffCost;
                _Adjustbll.Model.AdjustReason     = ddl_DeductReason.SelectedValue;
                _Adjustbll.Model.Remark           = tbx_AdjustReason.Text;
                _Adjustbll.Model.InsertStaff      = (int)Session["UserID"];
                _Adjustbll.Add();

                Session["SuccessFlag"] = true;
                ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "message", "<script language='javascript'>window.close();</script>", false);
            }
        }
        else
        {
            MessageBox.Show(this, "批复金额尚没有修改!");
            return;
        }
    }