Exemple #1
0
 /// <summary>
 /// 生成流水信息,并更新付款单的最新流水信息号
 /// </summary>
 public void GenerateFlowOrders()
 {
     try
     {
         #region 生成流水信息
         T_Pay_Info_DetailsEntity payDetailsEntity = new T_Pay_Info_DetailsEntity()
         {
             Amount                    = this.operationAmount,
             Createtime                = DateTime.Now,
             PayInfoDetailsCode        = CodeNumber,
             Details_Name              = EnumHelper.ToDescription(PayDetailsTypeEnum.Consumption),
             Details_Type              = (int)PayDetailsTypeEnum.Consumption,
             EcommerceGroupID          = inputPayEntity.EcommerceGroupID,
             EcommerceGroupName        = this.EcommerceProjectMoneyCapacity.EcommerceGroupName,
             Electricity_Supplier_Code = inputPayEntity.Electricity_Supplier_Code,
             Electricity_Supplier_Id   = inputPayEntity.EcommerceID,
             Electricity_Supplier_Name = inputPayEntity.Electricity_Supplier_Name,
             Pay_Info_Code             = inputPayEntity.Pay_Info_Code,
             Pay_Info_Details_ID       = Guid.NewGuid().ToString(),
             Pay_Info_ID               = inputPayEntity.Pay_Info_Id,
             Project_Code              = inputPayEntity.Project_Code,
             Project_ID                = inputPayEntity.Project_Id,
             Project_Name              = inputPayEntity.Project_Name,
         };
         Transdb.Insert(payDetailsEntity);
         inputPayEntity.LastPayInfoDetailsCode = CodeNumber;
         Transdb.Update(inputPayEntity);
         #endregion
     }
     catch (Exception ex)
     {
         throw new Exception(ex.Message);
     }
 }
Exemple #2
0
 /// <summary>
 /// 调整资金池
 /// </summary>
 public void AdjustTheFundsPool()
 {
     try
     {
         #region 调整资金池金额
         //1、减去可用的资金池
         EcommerceProjectMoneyCapacity.ActualControlTotalAmount = EcommerceProjectMoneyCapacity.ActualControlTotalAmount - this.operationAmount;
         //2、加上占用金额
         EcommerceProjectMoneyCapacity.FlowNopayTotalAmount = EcommerceProjectMoneyCapacity.FlowNopayTotalAmount + this.operationAmount;
         Transdb.Update(EcommerceProjectMoneyCapacity);
         #endregion
     }
     catch (Exception ex)
     {
         throw new Exception(ex.Message);
     }
 }
Exemple #3
0
        /// <summary>
        /// 调整资金池
        /// </summary>
        public void AdjustTheFundsPool()
        {
            string errMsg = string.Empty;

            try
            {
                if (!Check(out errMsg))
                {
                    // 只要这里有错误 必须还原到原来的状态,英文前面已经更新过
                    if (this.existingPayEntity != null)
                    {
                        new RepositoryFactory().BaseRepository().Update(this.existingPayEntity);
                    }
                    else
                    {
                        new RepositoryFactory().BaseRepository().Delete(this.inputPayEntity);
                    }
                    throw new Exception(errMsg);
                }
                #region 调整资金池金额

                //1、减去占用金额
                EcommerceProjectMoneyCapacity.FlowNopayTotalAmount = EcommerceProjectMoneyCapacity.FlowNopayTotalAmount - this.operationAmount;
                //2、总资金池扣掉
                EcommerceProjectMoneyCapacity.ControlTotalAmount = EcommerceProjectMoneyCapacity.ControlTotalAmount - this.operationAmount;
                Transdb.Update(EcommerceProjectMoneyCapacity);
                #endregion
            }
            catch (Exception ex)
            {
                // 只要这里有错误 必须还原到原来的状态,英文前面已经更新过
                if (this.existingPayEntity != null)
                {
                    new RepositoryFactory().BaseRepository().Update(this.existingPayEntity);
                }
                else
                {
                    new RepositoryFactory().BaseRepository().Delete(this.inputPayEntity);
                }
                throw new Exception(ex.Message);
            }
        }