public CloseSavingsForm(OCurrency pBalance) { InitializeComponent(); lbTotalAmountValue.Text = pBalance.GetFormatedValue(UseCents); gbCloseFees.Enabled = false; _amount = pBalance; _closeFees = 0; Initialize(); }
public CloseSavingsForm(ISavingProduct savingBookProduct, OCurrency pBalance, OCurrency pCloseFees) { InitializeComponent(); _amount = pBalance; _closeFees = pCloseFees; if (savingBookProduct is SavingsBookProduct) _savingsBookProduct = (SavingsBookProduct)savingBookProduct; lbTotalAmountValue.Text = pBalance.GetFormatedValue(UseCents); gbCloseFees.Enabled = (_closeFees.Value > 0); Initialize(); }
private void DisplayGuarantors(IEnumerable<Guarantor> pGuarantors, OCurrency pAmount) { _totalGuarantorAmount = 0; OCurrency totalGuarantorAmountPercent = 0; listViewGuarantors.Items.Clear(); foreach (Guarantor selectedGuarantor in pGuarantors) { ListViewItem listViewItem = new ListViewItem(((Person)selectedGuarantor.Tiers).Name) { Tag = selectedGuarantor }; listViewItem.SubItems.Add(selectedGuarantor.Amount.GetFormatedValue(_credit.UseCents)); if (pAmount.HasValue) listViewItem.SubItems.Add((selectedGuarantor.Amount / pAmount * (double)100).ToString()); else listViewItem.SubItems.Add("-"); listViewItem.SubItems.Add(selectedGuarantor.Description); _totalGuarantorAmount += selectedGuarantor.Amount; totalGuarantorAmountPercent += selectedGuarantor.Amount / pAmount * (double)100; listViewGuarantors.Items.Add(listViewItem); } var totalItem = new ListViewItem(""); totalItem.Font = listViewGuarantors.Font; totalItem.Font = new Font(totalItem.Font, FontStyle.Bold); totalItem.SubItems.Add(_totalGuarantorAmount.GetFormatedValue(_credit.UseCents)); totalItem.SubItems.Add(totalGuarantorAmountPercent.GetFormatedValue(true)); listViewGuarantors.Items.Add(totalItem); }
private void DisplayCollateral() { _totalCollateralAmount = 0; OCurrency totalCollateralAmountPercent = 0; listViewCollaterals.Items.Clear(); foreach (ContractCollateral selectedCollateral in _collaterals) { CollateralProduct collateralProduct = ServicesProvider.GetInstance().GetCollateralProductServices().SelectCollateralProductByPropertyId(selectedCollateral.PropertyValues[0].Property.Id); OCurrency selectedCollateralAmount = 0; foreach (CollateralPropertyValue propertyValue in selectedCollateral.PropertyValues) if (propertyValue.Property.Name.Equals(GetString("FrmAddCollateralProduct", "propertyAmount")) || propertyValue.Property.Name.Equals("Montant") || propertyValue.Property.Name.Equals("Сумма") || propertyValue.Property.Name.Equals("Amount")) selectedCollateralAmount = new OCurrency(Converter.CustomFieldValueToDecimal(propertyValue.Value)); string selectedCollateralDescription = string.Empty; foreach (CollateralPropertyValue propertyValue in selectedCollateral.PropertyValues) if (propertyValue.Property.Name.Equals(GetString("FrmAddCollateralProduct", "propertyDescription")) || propertyValue.Property.Name.Equals("Description") || propertyValue.Property.Name.Equals("Описание")) selectedCollateralDescription = propertyValue.Value; var listViewItem = new ListViewItem(collateralProduct.Name) { Tag = selectedCollateral }; listViewItem.SubItems.Add(selectedCollateralAmount.GetFormatedValue(_credit.UseCents)); if (_credit.Amount.HasValue) listViewItem.SubItems.Add((selectedCollateralAmount / _credit.Amount * (double)100).ToString()); else listViewItem.SubItems.Add("-"); listViewItem.SubItems.Add(selectedCollateralDescription); _totalCollateralAmount += selectedCollateralAmount; totalCollateralAmountPercent += selectedCollateralAmount / _credit.Amount * (double)100; listViewCollaterals.Items.Add(listViewItem); } var totalItem = new ListViewItem(""); totalItem.Font = listViewCollaterals.Font; totalItem.Font = new Font(totalItem.Font, FontStyle.Bold); totalItem.SubItems.Add(_totalCollateralAmount.GetFormatedValue(_credit.UseCents)); totalItem.SubItems.Add(totalCollateralAmountPercent.GetFormatedValue(true)); listViewCollaterals.Items.Add(totalItem); }
private void DisplayAmountLabel() { _lbICName.Text = _loan.Product.Currency.Name; _maximumAmount = _loan.CalculateMaximumAmountAuthorizedToRepay(_instalmentNumber, _date.Date, _disableFees, _manualPenalties, _manualCommission, _disableInterests, _manualInterests, _keepExpectedInstallment); _regradingAmount = _loan.CalculateMaximumAmountToRegradingLoan(_instalmentNumber, _date.Date, _disableFees, _manualPenalties, _manualCommission, _disableInterests, _manualInterests, _keepExpectedInstallment); _lbICAmountMinMax.Text = string.Format("{0}0\r\n{1}{2}", MultiLanguageStrings.GetString(Ressource.CreditContractRepayForm, "min.Text"), MultiLanguageStrings.GetString(Ressource.CreditContractRepayForm, "max.Text"), _maximumAmount.GetFormatedValue(_loan.UseCents)); nudICAmount.Maximum = _maximumAmount.Value; if (checkBoxTotalAmount.Checked && _disableFees) { nudICAmount.Value = _maximumAmount.Value; } if (_disableFees && ServicesHelper.ConvertStringToDecimal(nudICAmount.Text, 0, _loan.UseCents) > _maximumAmount) { nudICAmount.Text = _maximumAmount.GetFormatedValue(_loan.UseCents); } lblAmountToGoBackNormal.Text = string.Format("{0} {1}", MultiLanguageStrings.GetString(Ressource.CreditContractRepayForm, "amountToGoNormal.Text"),_regradingAmount.GetFormatedValue(_loan.UseCents)); if (_loan.Product.LoanType == OLoanTypes.DecliningFixedPrincipalWithRealInterest) nudICAmount.Value = _regradingAmount.Value; if (_exchangeRate != null && ServicesProvider.GetInstance().GetCurrencyServices().FindAllCurrencies().Count != 1) { _lbECName.Text = ServicesProvider.GetInstance().GetCurrencyServices().GetPivot().Name; _lbECAmountMinMax.Text = string.Format("{0}0\r\n{1}{2}", MultiLanguageStrings.GetString(Ressource.CreditContractRepayForm, "min.Text"), MultiLanguageStrings.GetString(Ressource.CreditContractRepayForm, "max.Text"), (_maximumAmount / _exchangeRate.Rate).GetFormatedValue(_loan.UseCents)); nudECAmount.Maximum = (_maximumAmount / _exchangeRate.Rate).Value; _lbECAmountToGoBackNormal.Text = string.Format("{0} {1}", MultiLanguageStrings.GetString(Ressource.CreditContractRepayForm, "amountToGoNormal.Text"), (_regradingAmount / _exchangeRate.Rate).GetFormatedValue(_loan.UseCents)); } }
//convert OCurrency to string public static string ConvertNullableDecimalToString(OCurrency number) { if (number.HasValue) { try { return number.GetFormatedValue(true); } catch { return String.Empty; } } return String.Empty; }