コード例 #1
0
        public override DMPFeeResponseViewModel Calculate()
        {
            DMPFeeResponseViewModel response = new DMPFeeResponseViewModel();

            if (this.DisposableIncome > 0.0m)
            {
                if (this.TotalDebt > 0.0m)
                {
                    this.Fee = this.DisposableIncome * 0.15m;
                    this.DistributableIncome = this.DisposableIncome - this.Fee;

                    foreach (DebtModel d in DebtRepaymentList)
                    {
                        // work out repayments

                        d.DebtMonthlyRepayment = this.DistributableIncome * (d.DebtAmount / this.TotalDebt);
                    }

                    response.DistributableIncome = this.DistributableIncome;
                    response.Fee = this.Fee;
                }
            }

            response.TotalDebt         = this.TotalDebt;
            response.DebtRepaymentList = this.DebtRepaymentList;
            response.DisposableIncome  = this.DisposableIncome;

            return(response);
        }
コード例 #2
0
        public override DMPFeeResponseViewModel Calculate()
        {
            DMPFeeResponseViewModel response = new DMPFeeResponseViewModel();

            if (this.DisposableIncome > 0)
            {
                if (this.TotalDebt > 0)
                {
                    if (this.DisposableIncome < 100)
                    {
                        this.Fee = 25;
                    }
                    else if (this.DisposableIncome >= 100 && this.DisposableIncome < 200)
                    {
                        this.Fee = 30;
                    }
                    else if (this.DisposableIncome >= 200)
                    {
                        this.Fee = this.DisposableIncome * 0.16m;

                        if (this.Fee < 25)
                        {
                            this.Fee = 25;
                        }

                        if (this.Fee > 300)
                        {
                            this.Fee = 300;
                        }
                    }

                    this.DistributableIncome = this.DisposableIncome - this.Fee;

                    foreach (DebtModel d in DebtRepaymentList)
                    {
                        // work out repayments

                        d.DebtMonthlyRepayment = this.DistributableIncome * (d.DebtAmount / this.TotalDebt);
                    }

                    response.DistributableIncome = this.DistributableIncome;
                    response.Fee = this.Fee;
                }
            }

            response.TotalDebt         = this.TotalDebt;
            response.DebtRepaymentList = this.DebtRepaymentList;
            response.DisposableIncome  = this.DisposableIncome;

            return(response);
        }
コード例 #3
0
        public DMPFeeResultModel Calculate(DMPFeeRequestViewModel req)
        {
            DMPFeeResultModel result = new DMPFeeResultModel();

            DMPFeeResponseViewModel feeResponse = null;

            DebtServiceProviderEnumerator debtProvider = (DebtServiceProviderEnumerator)Enum.Parse(typeof(DebtServiceProviderEnumerator), req.CustomerDebtManagementCompanyId);

            switch (debtProvider)
            {
            case DebtServiceProviderEnumerator.McDermottGodfrey:

                feeResponse = new McDermottGodfreyDMPServiceProvider(req).Calculate();

                break;

            case DebtServiceProviderEnumerator.DebtDestructor:

                feeResponse = new DebtDestructorDMPServiceProvider(req).Calculate();

                break;

            case DebtServiceProviderEnumerator.MoneyHelper:

                feeResponse = new MoneyHelperDMPServiceProvider(req).Calculate();

                break;

            default:
                break;
            }

            if (feeResponse.IsNotNull())
            {
                feeResponse.Request = req;        // original request

                result.DMPResponse = feeResponse; // provider response

                result.OK = true;
            }

            return(result);
        }
コード例 #4
0
        public override DMPFeeResponseViewModel Calculate()
        {
            DMPFeeResponseViewModel response = new DMPFeeResponseViewModel();

            if (this.DisposableIncome > 0)
            {
                if (this.TotalDebt > 0)
                {
                    if (this.TotalDebt < 1000)
                    {
                        this.Fee = 10;
                    }
                    else
                    {
                        this.Fee = Math.Ceiling(this.TotalDebt / 1000) * 10;

                        if (this.Fee > 100)
                        {
                            this.Fee = 100;
                        }
                    }

                    this.DistributableIncome = this.DisposableIncome - this.Fee;

                    foreach (DebtModel d in DebtRepaymentList)
                    {
                        // work out repayments

                        d.DebtMonthlyRepayment = this.DistributableIncome * (d.DebtAmount / this.TotalDebt);
                    }

                    response.DistributableIncome = this.DistributableIncome;
                    response.Fee = this.Fee;
                }
            }

            response.TotalDebt         = this.TotalDebt;
            response.DebtRepaymentList = this.DebtRepaymentList;
            response.DisposableIncome  = this.DisposableIncome;

            return(response);
        }