示例#1
0
        /// <summary>
        /// 更新
        /// </summary>
        /// <param name="vm"></param>
        /// <param name="callback"></param>
        public void Update(SOIncomeRefundMaintainVM vm, Action callback)
        {
            var entity = vm.ConvertVM <SOIncomeRefundMaintainVM, SOIncomeRefundInfo>((s, t) =>
            {
                t.Status         = s.AuditStatus;
                t.OrderSysNo     = s.RMANumber;    //退款单号
                t.HaveAutoRMA    = s.ShipRejected; //是否RMA物流拒收
                t.RefundReason   = !string.IsNullOrEmpty(s.RefundReasonSysNo) ? Convert.ToInt32(s.RefundReasonSysNo) : (int?)null;
                t.BankName       = s.RefundInfo.BankName;
                t.BranchBankName = s.RefundInfo.BranchBankName;
                t.CardNumber     = s.RefundInfo.CardNumber;
                t.CardOwnerName  = s.RefundInfo.CardOwnerName;
                t.PostAddress    = s.RefundInfo.PostAddress;
                t.PostCode       = s.RefundInfo.PostCode;
                t.ReceiverName   = s.RefundInfo.CashReceiver;
                t.Note           = s.RefundInfo.RefundMemo;
                t.RefundPayType  = s.RefundInfo.RefundPayType;
            });

            string relativeUrl = "/InvoiceService/SOIncomeRefund/Update";

            restClient.Update(relativeUrl, entity, (obj, args) =>
            {
                if (args.FaultsHandle())
                {
                    return;
                }
                callback();
            });
        }
        public UCSOIncomeRefundMaintain(AuditRefundVM refund, AuditRefundFacade facade)
            : this()
        {
            auditRefundFacade = facade;
            currentRefund     = EntityConverter <AuditRefundVM, SOIncomeRefundMaintainVM> .Convert(refund);

            currentRefund.RefundInfo = EntityConverter <AuditRefundVM, RefundInfoVM> .Convert(refund, (s, t) =>
            {
                t.RefundMemo = s.Note;
            });
        }