Example #1
0
        public virtual void UpdateAccountPeriodInfo(AccountPeriodInfo entity)
        {
            DataCommand cmd = DataCommandManager.GetDataCommand("UpdateAccountPeriodInfo");

            cmd.SetParameterValue <AccountPeriodInfo>(entity);
            cmd.ExecuteNonQuery();
        }
Example #2
0
        public virtual AccountPeriodInfo AdjustCollectionPeriodAndRating(AccountPeriodInfo entity)
        {
            if (!entity.AvailableCreditLimit.HasValue)
            {
                throw new BizException(ResouceManager.GetMessageString("Customer.CustomerInfo", "AdjustCollectionPeriodAndRating_CreditLimit_NoNull"));
            }
            AccountPeriodInfo accountInfo = GetCustomerAccountPeriod(entity.CustomerSysNo.Value);

            if (accountInfo != null)
            {
                entity.CustomerSysNo = accountInfo.CustomerSysNo;

                decimal availableCreditLimit = 0;

                if (!accountInfo.AvailableCreditLimit.HasValue)
                {
                    accountInfo.AvailableCreditLimit = 0;
                }
                availableCreditLimit = accountInfo.AvailableCreditLimit.Value + entity.AvailableCreditLimit.Value;
                if (availableCreditLimit < 0)
                {
                    throw new BizException(ResouceManager.GetMessageString("Customer.CustomerInfo", "AdjustCollectionPeriodAndRating_CreditLimit_Negative"));
                }
                entity.AvailableCreditLimit = availableCreditLimit;
            }
            da.UpdateAvailableCreditLimit(entity.CustomerSysNo.Value, entity.AvailableCreditLimit.Value);
            return(entity);
        }
Example #3
0
        public void SetCollectionPeriodAndRating(CustomerAccountPeriodVM vm, EventHandler <RestClientEventArgs <AccountPeriodInfo> > callback)
        {
            string            relativeUrl = "/CustomerService/CustomerExtend/SetCollectionPeriodAndRating";
            AccountPeriodInfo msg         = vm.ConvertVM <CustomerAccountPeriodVM, AccountPeriodInfo>();

            restClient.Update <AccountPeriodInfo>(relativeUrl, msg, callback);
        }
Example #4
0
        public virtual void UpdateAccountPeriodInfo(AccountPeriodInfo entity)
        {
            da.UpdateAccountPeriodInfo(entity);

            ExternalDomainBroker.CreateOperationLog("SetCreditLimit Customer"
                                                    , BizLogType.Basic_Customer_SetCreditLimit
                                                    , entity.CustomerSysNo.Value
                                                    , "8601");
        }
Example #5
0
        public virtual void AddCreditLimit(int customerSysNo, decimal receivableAmount)
        {
            AccountPeriodInfo entity = da.GetAccountPeriodInfoByCustomerSysNo(customerSysNo);

            if (entity != null)
            {
                entity.AvailableCreditLimit += receivableAmount;

                if (entity.AvailableCreditLimit < 0)
                {
                    throw new BizException(ResouceManager.GetMessageString("Customer.CustomerInfo", "SetCreditLimit_CreditLimit_Negative"));
                }
            }
            SetCreditLimit(entity.CustomerSysNo.Value, entity.AvailableCreditLimit.Value);
        }
Example #6
0
 public virtual void CreateAccountPeriodInfo(AccountPeriodInfo entity)
 {
     da.CreateAccountPeriodInfo(entity);
 }
Example #7
0
 /// <summary>
 /// 更新账期信息
 /// </summary>
 /// <param name="entity"></param>
 public virtual void UpdateAccountPeriodInfo(AccountPeriodInfo entity)
 {
     ObjectFactory <AccountPeridProcessor> .Instance.UpdateAccountPeriodInfo(entity);
 }
Example #8
0
 public void SetCollectionPeriodAndRating(AccountPeriodInfo entity)
 {
     ObjectFactory <CustomerAppService> .Instance.UpdateAccountPeriodInfo(entity);
 }