示例#1
0
        /// <summary>
        /// 申请通过处理
        /// </summary>
        /// <param name="apply"></param>
        /// <param name="store"></param>
        /// <returns></returns>
        public bool ApplySuccess(PinRefundApply apply, PinStore store, ref string msg)
        {
            bool result = false;

            if (apply.type == 2 || apply.type == 3)
            {
                if (string.IsNullOrEmpty(store.setting.place) || string.IsNullOrEmpty(store.setting.phone) || string.IsNullOrEmpty(store.setting.name))
                {
                    msg = "请前往店铺配置设置您的退换货寄件信息";
                    return(result);
                }
            }
            PinGoodsOrderBLL orderBLL = new PinGoodsOrderBLL();

            PinGoodsOrder order = orderBLL.GetModel(apply.orderId);

            if (order == null)
            {
                msg = "订单不存在";
                return(result);
            }
            order.state        = apply.orderState;
            order.returnCount += apply.count;
            order.state        = order.returnCount == order.count ? order.state = (int)PinOrderState.交易取消 : order.state = apply.orderState;
            orderBLL.Update(order, "state,returncount,state");
            PinGroupBLL.SingleModel.RollbackEntrantCount(order, ref msg);
            result = Update(apply, "state,updatetime");
            return(result);
        }
示例#2
0
        /// <summary>
        /// 申请不通过处理
        /// </summary>
        /// <param name="apply"></param>
        /// <param name="msg"></param>
        /// <returns></returns>
        public bool ApplyFail(PinRefundApply apply, ref string msg)
        {
            bool             result   = false;
            PinGoodsOrderBLL orderBLL = new PinGoodsOrderBLL();
            PinGoodsOrder    order    = orderBLL.GetModel(apply.orderId);

            if (order == null)
            {
                msg = "订单不存在";
                return(result);
            }
            order.state = apply.orderState;
            orderBLL.Update(order, "state");
            result = Update(apply, "state,updatetime");
            return(result);
        }