public virtual void UpdatePayment(Payment entity)
 {
     Update(entity);
 }
 public virtual void DeletePayment(Payment entity)
 {
     Delete(entity);
 }
 public virtual void DeletePayment(Payment entity)
 {
     entityDao.DeletePayment(entity);
 }
 public virtual void CreatePayment(Payment entity)
 {
     Create(entity);
 }
 public virtual void UpdatePayment(Payment entity)
 {
     entityDao.UpdatePayment(entity);
 }
 public virtual void CreatePayment(Payment entity)
 {
     entityDao.CreatePayment(entity);
 }
        public void CreatePayment(Payment payment, User user)
        {
            DateTime dateTimeNow = DateTime.Now;

            #region 创建Payment
            payment.PaymentNo = numberControlMgrE.GenerateNumber(BusinessConstants.CODE_PREFIX_PAY);
            payment.BackwashAmount = 0;
            payment.CreateUser = user;
            payment.CreateDate = dateTimeNow;
            payment.LastModifyUser = user;
            payment.LastModifyDate = dateTimeNow;
            payment.Status = BusinessConstants.CODE_MASTER_STATUS_VALUE_SUBMIT;

            this.CreatePayment(payment);
            #endregion
        }
 public void UpdatePayment(Payment payment, string userCode)
 {
     this.UpdatePayment(payment, this.userMgrE.CheckAndLoadUser(userCode));
 }
        public void UpdatePayment(Payment payment, User user)
        {
            //check
            Payment oldPayment = this.CheckAndLoadPayment(payment.PaymentNo);

            oldPayment.BackwashAmount = payment.BackwashAmount;

            if (oldPayment.BackwashAmount != 0 && oldPayment.Amount != 0 
                    && Math.Round(oldPayment.BackwashAmount.Value,2) == Math.Round(oldPayment.Amount,2))
            {
                oldPayment.Status = BusinessConstants.CODE_MASTER_STATUS_VALUE_CLOSE;
            }
            else
            {
                oldPayment.Status = BusinessConstants.CODE_MASTER_STATUS_VALUE_SUBMIT;
            }

            oldPayment.LastModifyUser = user;
            oldPayment.LastModifyDate = DateTime.Now;
            this.UpdatePayment(oldPayment);
        }