Exemple #1
0
        public void Update(BalanceRefundInfo entity)
        {
            DataCommand dataCommand = DataCommandManager.GetDataCommand("UpdateBalanceRefund");

            dataCommand.SetParameterValue(entity);
            dataCommand.ExecuteNonQuery();
        }
Exemple #2
0
 /// <summary>
 /// 更新退款信息
 /// </summary>
 /// <param name="entity"></param>
 public virtual void Update(BalanceRefundInfo entity)
 {
     if (entity.SysNo == null || entity.SysNo == 0)
     {
         throw new ArgumentException("entity.SysNo");
     }
     ObjectFactory <BalanceRefundProcessor> .Instance.Update(entity);
 }
Exemple #3
0
        public BalanceRefundInfo Create(BalanceRefundInfo entity)
        {
            DataCommand dataCommand = DataCommandManager.GetDataCommand("InsertBalanceRefund");

            dataCommand.SetParameterValue(entity);
            entity.SysNo = Convert.ToInt32(dataCommand.ExecuteScalar());

            return(Load(entity.SysNo.Value));
        }
Exemple #4
0
        public void Create(PrepayRefundVM request, EventHandler <RestClientEventArgs <object> > callback)
        {
            BalanceRefundInfo entity = request.ConvertVM <PrepayRefundVM, BalanceRefundInfo>();

            entity.CompanyCode = CPApplication.Current.CompanyCode;
            string relativeUrl = "/InvoiceService/BalanceRefund/Create";

            GetRestClient(ConstValue.DomainName_Invoice).Create(relativeUrl, entity, callback);
        }
        /// <summary>
        /// 创建顾客余额退款信息
        /// </summary>
        /// <param name="entity"></param>
        /// <returns></returns>
        public virtual BalanceRefundInfo Create(BalanceRefundInfo entity)
        {
            if (entity.ReturnPrepayAmt <= 0)
            {
                //throw new BizException("退款金额必须大于等于0。");
                ThrowBizException("BalanceRefund_RefundAmoutNeedMoreThan0");
            }
            if (!ExternalDomainBroker.ExistsCustomer(entity.CustomerSysNo.Value))
            {
                //throw new BizException(string.Format("编号为{0}的顾客不存在。", entity.CustomerSysNo));
                ThrowBizException("BalanceRefund_NotExsistCustomer", entity.CustomerSysNo);
            }

            TransactionOptions options = new TransactionOptions();

            options.IsolationLevel = IsolationLevel.ReadUncommitted;
            using (TransactionScope ts = new TransactionScope(TransactionScopeOption.Required, options))
            {
                ExternalDomainBroker.AdjustCustomerPerpayAmount(entity.CustomerSysNo.Value, 0, -entity.ReturnPrepayAmt.Value, PrepayType.BalanceReturn, "余额账户转银行退款");

                entity.Status = BalanceRefundStatus.Origin;
                entity        = m_BalanceRefundDA.Create(entity);

                //发送创建Message
                EventPublisher.Publish(new CreateBalanceRefundMessage()
                {
                    ReturnPrepaySysNo = entity.SysNo.Value,
                    CurrentUserSysNo  = ServiceContext.Current.UserSysNo
                });


                ts.Complete();
            }

            return(entity);
        }
Exemple #6
0
 /// <summary>
 /// 创建余额退款信息
 /// </summary>
 /// <param name="entity"></param>
 /// <returns></returns>
 public virtual BalanceRefundInfo Create(BalanceRefundInfo entity)
 {
     return(ObjectFactory <BalanceRefundProcessor> .Instance.Create(entity));
 }
 /// <summary>
 /// 更新退款信息
 /// </summary>
 /// <param name="entity"></param>
 public virtual void Update(BalanceRefundInfo entity)
 {
     m_BalanceRefundDA.Update(entity);
 }
Exemple #8
0
 public void UpdateBalanceRefund(BalanceRefundInfo entity)
 {
     ObjectFactory <BalanceRefundAppService> .Instance.Update(entity);
 }
Exemple #9
0
 public BalanceRefundInfo CreateBalanceRefund(BalanceRefundInfo entity)
 {
     return(ObjectFactory <BalanceRefundAppService> .Instance.Create(entity));
 }