コード例 #1
0
ファイル: ClientForm.cs プロジェクト: BillTheBest/opencbs
        private void InitializePackageNonRepaymentPenalties(LoanProduct pPackage, bool pForCreation)
        {
            groupBoxLoanLateFees.Text = MultiLanguageStrings.GetString(Ressource.ClientForm, "LateFeesGracePeriod.Text") + " (" + pPackage.GracePeriodOfLateFees + ")";
            _gracePeriodOfLateFees = pPackage.GracePeriodOfLateFees;

            #region InitialAmount
            if (!pPackage.NonRepaymentPenalties.InitialAmount.HasValue) //Min and Max
            {
                _lateFeesOnAmountRangeValue = new DoubleValueRange(pPackage.NonRepaymentPenaltiesMin.InitialAmount, pPackage.NonRepaymentPenaltiesMax.InitialAmount);
                textBoxLoanLateFeesOnAmount.Enabled = true;
                labelLoanLateFeesOnAmountMinMax.Text = string.Format("{0}{1}\r\n{2}{3}",
                                  MultiLanguageStrings.GetString(Ressource.CreditContractForm, "min.Text"),
                                  ServicesHelper.ConvertNullableDoubleToString(_lateFeesOnAmountRangeValue.Min, true),
                                  MultiLanguageStrings.GetString(Ressource.CreditContractForm, "max.Text"),
                                  ServicesHelper.ConvertNullableDoubleToString(_lateFeesOnAmountRangeValue.Max, true));
                textBoxLoanLateFeesOnAmount.Text = pForCreation ? ServicesHelper.ConvertNullableDoubleToString(_lateFeesOnAmountRangeValue.Min, true) : ServicesHelper.ConvertNullableDoubleToString(_credit.NonRepaymentPenalties.InitialAmount, true);
            }
            else
                textBoxLoanLateFeesOnAmount.Text = pForCreation ? ServicesHelper.ConvertNullableDoubleToString(pPackage.NonRepaymentPenalties.InitialAmount, true) : ServicesHelper.ConvertNullableDoubleToString(_credit.NonRepaymentPenalties.InitialAmount, true);
            #endregion

            #region OLB
            if (!pPackage.NonRepaymentPenalties.OLB.HasValue) //Min and Max
            {
                _lateFeesOnOLBRangeValue = new DoubleValueRange(pPackage.NonRepaymentPenaltiesMin.OLB, pPackage.NonRepaymentPenaltiesMax.OLB);
                textBoxLoanLateFeesOnOLB.Enabled = true;
                labelLoanLateFeesOnOLBMinMax.Text = string.Format("{0}{1}\r\n{2}{3}",
                                  MultiLanguageStrings.GetString(Ressource.CreditContractForm, "min.Text"),
                                  ServicesHelper.ConvertNullableDoubleToString(_lateFeesOnOLBRangeValue.Min, true),
                                  MultiLanguageStrings.GetString(Ressource.CreditContractForm, "max.Text"),
                                  ServicesHelper.ConvertNullableDoubleToString(_lateFeesOnOLBRangeValue.Max, true));
                textBoxLoanLateFeesOnOLB.Text = pForCreation ? ServicesHelper.ConvertNullableDoubleToString(_lateFeesOnOLBRangeValue.Min, true) : ServicesHelper.ConvertNullableDoubleToString(_credit.NonRepaymentPenalties.OLB, true);
            }
            else
                if (pForCreation)
                {
                    textBoxLoanLateFeesOnOLB.Text = ServicesHelper.ConvertNullableDoubleToString(pPackage.NonRepaymentPenalties.OLB, true);
                }
                else
                {
                    textBoxLoanLateFeesOnOLB.Text = ServicesHelper.ConvertNullableDoubleToString(_credit.NonRepaymentPenalties.OLB, true);
                }
            #endregion

            #region OverdueINterest
            if (!pPackage.NonRepaymentPenalties.OverDueInterest.HasValue) //Min and Max
            {
                _lateFeesOnOverdueInterestRangeValue = new DoubleValueRange(pPackage.NonRepaymentPenaltiesMin.OverDueInterest, pPackage.NonRepaymentPenaltiesMax.OverDueInterest);
                textBoxLoanLateFeesOnOverdueInterest.Enabled = true;
                labelLoanLateFeesOnOverdueInterestMinMax.Text = string.Format("{0}{1}\r\n{2}{3}",
                                  MultiLanguageStrings.GetString(Ressource.CreditContractForm, "min.Text"),
                                  ServicesHelper.ConvertNullableDoubleToString(_lateFeesOnOverdueInterestRangeValue.Min, true),
                                  MultiLanguageStrings.GetString(Ressource.CreditContractForm, "max.Text"),
                                  ServicesHelper.ConvertNullableDoubleToString(_lateFeesOnOverdueInterestRangeValue.Max, true));
                if (pForCreation)
                {
                    textBoxLoanLateFeesOnOverdueInterest.Text = ServicesHelper.ConvertNullableDoubleToString(_lateFeesOnOverdueInterestRangeValue.Min, true);
                }
                else
                {
                    textBoxLoanLateFeesOnOverdueInterest.Text = ServicesHelper.ConvertNullableDoubleToString(_credit.NonRepaymentPenalties.OverDueInterest, true);
                }
            }
            else
                if (pForCreation)
                {
                    textBoxLoanLateFeesOnOverdueInterest.Text = ServicesHelper.ConvertNullableDoubleToString(pPackage.NonRepaymentPenalties.OverDueInterest, true);
                }
                else
                {
                    textBoxLoanLateFeesOnOverdueInterest.Text = ServicesHelper.ConvertNullableDoubleToString(_credit.NonRepaymentPenalties.OverDueInterest, true);
                }
            #endregion

            #region OverduePrincipal
            if (!pPackage.NonRepaymentPenalties.OverDuePrincipal.HasValue) //Min and Max
            {
                _lateFeesOnOverduePrincipalRangeValue = new DoubleValueRange(pPackage.NonRepaymentPenaltiesMin.OverDuePrincipal, pPackage.NonRepaymentPenaltiesMax.OverDuePrincipal);
                textBoxLoanLateFeesOnOverduePrincipal.Enabled = true;
                labelLoanLateFeesOnOverduePrincipalMinMax.Text = string.Format("{0}{1}\r\n{2}{3}",
                                  MultiLanguageStrings.GetString(Ressource.CreditContractForm, "min.Text"),
                                  ServicesHelper.ConvertNullableDoubleToString(_lateFeesOnOverduePrincipalRangeValue.Min, true),
                                  MultiLanguageStrings.GetString(Ressource.CreditContractForm, "max.Text"),
                                  ServicesHelper.ConvertNullableDoubleToString(_lateFeesOnOverduePrincipalRangeValue.Max, true));
                if (pForCreation)
                {
                    textBoxLoanLateFeesOnOverduePrincipal.Text = ServicesHelper.ConvertNullableDoubleToString(_lateFeesOnOverduePrincipalRangeValue.Min, true);
                }
                else
                {
                    textBoxLoanLateFeesOnOverduePrincipal.Text = ServicesHelper.ConvertNullableDoubleToString(_credit.NonRepaymentPenalties.OverDuePrincipal, true);
                }
            }
            else
                if (pForCreation)
                {
                    textBoxLoanLateFeesOnOverduePrincipal.Text = ServicesHelper.ConvertNullableDoubleToString(pPackage.NonRepaymentPenalties.OverDuePrincipal, true);
                }
                else
                {
                    textBoxLoanLateFeesOnOverduePrincipal.Text = ServicesHelper.ConvertNullableDoubleToString(_credit.NonRepaymentPenalties.OverDuePrincipal, true);
                }
            #endregion

            if (pPackage.AnticipatedTotalRepaymentPenaltiesBase == OAnticipatedRepaymentPenaltiesBases.RemainingOLB)
            {
                lblEarlyTotalRepaimentBase.Text = MultiLanguageStrings.GetString(Ressource.ClientForm, "lblEarlyRepaimentBaseOLB.Text");
            }
            else
            {
                lblEarlyTotalRepaimentBase.Text = MultiLanguageStrings.GetString(Ressource.ClientForm, "lblEarlyRepaimentBaseInterest.Text");
            }

            if (pPackage.AnticipatedPartialRepaymentPenaltiesBase == OAnticipatedRepaymentPenaltiesBases.RemainingOLB)
            {
                lblEarlyPartialRepaimentBase.Text = MultiLanguageStrings.GetString(Ressource.ClientForm, "lblEarlyRepaimentBaseOLB.Text");
            }
            else
            {
                lblEarlyPartialRepaimentBase.Text = MultiLanguageStrings.GetString(Ressource.ClientForm, "lblEarlyRepaimentBaseInterest.Text");
            }
        }
コード例 #2
0
ファイル: ClientForm.cs プロジェクト: BillTheBest/opencbs
        private void InitializePackageAnticipatedTotalRepaymentsPenalties(LoanProduct pPackage, bool pForCreation)
        {
            if (!pPackage.AnticipatedTotalRepaymentPenalties.HasValue) //Min and Max
            {
                _anticipatedTotalFeesValueRange = new DoubleValueRange(pPackage.AnticipatedTotalRepaymentPenaltiesMin, pPackage.AnticipatedTotalRepaymentPenaltiesMax);

                textBoxLoanAnticipatedTotalFees.Enabled = true;
                labelLoanAnticipatedTotalFeesMinMax.Text = string.Format("{0}{1}\r\n{2}{3}",
                    MultiLanguageStrings.GetString(Ressource.CreditContractForm, "min.Text"),
                    ServicesHelper.ConvertNullableDoubleToString(_anticipatedTotalFeesValueRange.Min, true),
                    MultiLanguageStrings.GetString(Ressource.CreditContractForm, "max.Text"),
                    ServicesHelper.ConvertNullableDoubleToString(_anticipatedTotalFeesValueRange.Max, true));
                textBoxLoanAnticipatedTotalFees.Text = pForCreation ? ServicesHelper.ConvertNullableDoubleToString(_anticipatedTotalFeesValueRange.Min, true) : ServicesHelper.ConvertNullableDoubleToString(_credit.AnticipatedTotalRepaymentPenalties, true);
            }
            else
            {
                textBoxLoanAnticipatedTotalFees.Enabled = false;
                _anticipatedTotalFeesValueRange = new DoubleValueRange(pPackage.AnticipatedTotalRepaymentPenalties);
                textBoxLoanAnticipatedTotalFees.Text = pForCreation ? ServicesHelper.ConvertNullableDoubleToString(pPackage.AnticipatedTotalRepaymentPenalties, true) : ServicesHelper.ConvertNullableDoubleToString(_credit.AnticipatedTotalRepaymentPenalties, true);
            }
        }