Ejemplo n.º 1
0
        private void Submit()
        {
            int orderId       = RequestHelper.GetQueryString <int>("orderId");
            int orderDetailId = RequestHelper.GetQueryString <int>("orderDetailId");

            int     needRefundCount = RequestHelper.GetForm <int>("refund_count");
            decimal needRefundMoney = RequestHelper.GetForm <decimal>("refund_money");
            string  refundRemark    = StringHelper.AddSafe(RequestHelper.GetForm <string>("refund_remark"));

            OrderRefundInfo orderRefund = new OrderRefundInfo();

            orderRefund.RefundNumber = ShopCommon.CreateOrderRefundNumber();
            orderRefund.OrderId      = orderId;
            if (orderDetailId > 0)
            {
                orderRefund.OrderDetailId = orderDetailId;
                orderRefund.RefundCount   = needRefundCount;
            }
            orderRefund.Status       = (int)OrderRefundStatus.Submit;
            orderRefund.TmCreate     = DateTime.Now;
            orderRefund.RefundRemark = refundRemark;
            orderRefund.UserType     = 1;
            orderRefund.UserId       = base.UserId;
            orderRefund.UserName     = base.UserName;

            var refundMsg = JWRefund.VerifySubmitOrderRefund(orderRefund, needRefundMoney);

            if (refundMsg.CanRefund)
            {
                int id = OrderRefundBLL.Add(orderRefund);
                OrderRefundActionBLL.Add(new OrderRefundActionInfo
                {
                    OrderRefundId = id,
                    Status        = (int)BoolType.True,
                    Tm            = DateTime.Now,
                    UserType      = 1,
                    UserId        = base.UserId,
                    UserName      = base.UserName,
                    Remark        = "用户提交退款申请"
                });
                ResponseHelper.Write("ok|" + id);
                ResponseHelper.End();
            }
            else
            {
                ResponseHelper.Write("error|" + refundMsg.ErrorCodeMsg);
                ResponseHelper.End();
            }
        }
Ejemplo n.º 2
0
        protected void SubmitButton_Click(object sender, EventArgs e)
        {
            CheckAdminPower("OrderRefundApply", PowerCheckType.Single);

            int     orderId         = RequestHelper.GetQueryString <int>("orderId");
            int     orderDetailId   = RequestHelper.GetQueryString <int>("orderDetailId");
            decimal needRefundMoney = Convert.ToDecimal(RefundMoney.Text);

            OrderRefundInfo orderRefund = new OrderRefundInfo();

            orderRefund.RefundNumber = ShopCommon.CreateOrderRefundNumber();
            orderRefund.OrderId      = orderId;
            if (orderDetailId > 0)
            {
                orderRefund.OrderDetailId = orderDetailId;
                orderRefund.RefundCount   = Convert.ToInt32(RefundCount.Text);
            }
            orderRefund.Status       = (int)OrderRefundStatus.Submit;
            orderRefund.TmCreate     = DateTime.Now;
            orderRefund.RefundRemark = RefundRemark.Text;
            orderRefund.UserType     = 2;
            orderRefund.UserId       = Cookies.Admin.GetAdminID(false);
            orderRefund.UserName     = Cookies.Admin.GetAdminName(false);

            var refundMsg = JWRefund.VerifySubmitOrderRefund(orderRefund, needRefundMoney);

            if (refundMsg.CanRefund)
            {
                int id = OrderRefundBLL.Add(orderRefund);
                OrderRefundActionBLL.Add(new OrderRefundActionInfo
                {
                    OrderRefundId = id,
                    Status        = (int)BoolType.True,
                    Tm            = DateTime.Now,
                    UserType      = 2,
                    UserId        = orderRefund.UserId,
                    UserName      = orderRefund.UserName,
                    Remark        = "系统提交退款申请"
                });
                AdminLogBLL.Add(ShopLanguage.ReadLanguage("AddRecord"), ShopLanguage.ReadLanguage("OrderRefund"), id);
                ScriptHelper.Alert("退款申请成功", RequestHelper.RawUrl);
            }
            else
            {
                ScriptHelper.Alert(refundMsg.ErrorCodeMsg);
            }
        }