예제 #1
0
        protected void save_close_Click(object sender, EventArgs e)
        {
            decimal adjustNum = 0;

            if (!string.IsNullOrEmpty(Request.Form["AdjustNum"]))
            {
                decimal.TryParse(Request.Form["AdjustNum"], out adjustNum);
            }
            if (Request.Form["adjustType"] == "Reduce")
            {
                adjustNum = 0 - adjustNum;
            }

            decimal adjustMoney = 0;

            if (!string.IsNullOrEmpty(Request.Form["AdjustMoney"]))
            {
                decimal.TryParse(Request.Form["AdjustMoney"], out adjustMoney);
            }

            var    result     = false;
            string failReason = string.Empty;

            if (!string.IsNullOrEmpty(Request.Form["reason"]))
            {
                if (block != null)
                {
                    result = invBll.AjustBlock(block.id, adjustNum, Request.Form["reason"], LoginUserId, ref failReason);
                }
                else if (deduction != null)
                {
                    result = invBll.AjustDeduction(deduction.id, adjustNum, adjustMoney, Request.Form["reason"], LoginUserId);
                }
            }

            ClientScript.RegisterStartupScript(this.GetType(), "提示信息", $"<script>alert('保存{(result? "成功!" : $"失败.{failReason}")}');window.close();self.opener.location.reload(); </script>");