本文整理汇总了C#中OpenCBS.CoreDomain.Products.SavingsBookProduct类的典型用法代码示例。如果您正苦于以下问题:C# SavingsBookProduct类的具体用法?C# SavingsBookProduct怎么用?C# SavingsBookProduct使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
SavingsBookProduct类属于OpenCBS.CoreDomain.Products命名空间,在下文中一共展示了SavingsBookProduct类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: PostingInterests_NoPosting
public void PostingInterests_NoPosting()
{
// Assert.Ignore();
SavingsBookProduct product = new SavingsBookProduct
{
Id = 1,
InterestBase = OSavingInterestBase.Daily,
InterestFrequency = OSavingInterestFrequency.EndOfYear,
Periodicity = new InstallmentType("Yearly", 0, 12)
};
SavingBookContract saving = new SavingBookContract(
ApplicationSettings.GetInstance(""),
new User(),
new DateTime(2009, 01, 01),
null)
{
Product = product,
InterestRate = 0.1,
NextMaturity = new DateTime(2009, 01, 01)
};
List<SavingInterestsPostingEvent> list = new List<SavingInterestsPostingEvent>();
list = saving.PostingInterests(new DateTime(2009, 02, 01), new User { Id = 1 });
Assert.AreEqual(list.Count, 0);
}
示例2: PostingInterests_OnePosting
public void PostingInterests_OnePosting()
{
SavingsBookProduct product = new SavingsBookProduct
{
Id = 1,
InterestBase = OSavingInterestBase.Daily,
InterestFrequency = OSavingInterestFrequency.EndOfDay,
Periodicity = new InstallmentType("Daily", 1, 0)
};
SavingBookContract saving = new SavingBookContract(
ApplicationSettings.GetInstance(""),
new User(),
new DateTime(2009, 01, 01), null)
{
Product = product,
InterestRate = 0.1
};
saving.NextMaturity = saving.CreationDate;
List<SavingInterestsPostingEvent> list = new List<SavingInterestsPostingEvent>();
list = saving.PostingInterests(
saving.NextMaturity.Value,
new User { Id = 1 }
);
Assert.AreEqual(1, list.Count);
}
示例3: PostingInterests_12Posting
public void PostingInterests_12Posting()
{
// Assert.Ignore();
SavingsBookProduct product = new SavingsBookProduct
{
Id = 1,
InterestBase = OSavingInterestBase.Daily,
InterestFrequency = OSavingInterestFrequency.EndOfMonth,
Periodicity = new InstallmentType("Monthly", 0, 1)
};
User user = new User() {Id = 1};
DateTime creationDate = new DateTime(2009, 01, 01);
SavingBookContract saving = new SavingBookContract(
ApplicationSettings.GetInstance(""),
user,
creationDate,
null
)
{
Product = product,
InterestRate = 0.1
};
DateTime closureDate = new DateTime(2010, 01, 01);
saving.NextMaturity = saving.CreationDate.Date;
saving.NumberOfPeriods = 1;
saving.FirstDeposit(1000, creationDate, 0, user, new Teller());
saving.NextMaturity = DateCalculationStrategy.GetNextMaturity(
saving.CreationDate.Date,
saving.Product.Periodicity,
saving.NumberOfPeriods);
List<SavingInterestsAccrualEvent> interestsAccrualEvents =
saving.CalculateInterest(closureDate, new User {Id = 1});
foreach (var accrualEvent in interestsAccrualEvents)
{
saving.Events.Add(accrualEvent);
}
List<SavingInterestsPostingEvent> list = new List<SavingInterestsPostingEvent>();
List<SavingInterestsPostingEvent> postingEvents = new List<SavingInterestsPostingEvent>();
while (saving.NextMaturity.Value <= closureDate)
{
list = saving.PostingInterests(saving.NextMaturity.Value, new User() {Id = 1});
postingEvents.AddRange(list);
foreach (var postingEvent in list)
{
saving.Events.Add(postingEvent);
}
saving.NextMaturity = DateCalculationStrategy.GetNextMaturity(saving.NextMaturity.Value, saving.Periodicity, 1);
}
list = saving.PostingInterests(new DateTime(2010, 01, 01), new User { Id = 1 });
Assert.AreEqual(12, postingEvents.Count);
}
示例4: SavingBookContract
public SavingBookContract(ApplicationSettings pApplicationSettings, User pUser, SavingsBookProduct pProduct)
{
base.Product = pProduct;
Events = new List<SavingEvent>();
ApplicationSettings = pApplicationSettings;
User = pUser;
_loans = new List<Loan>();
UseTermDeposit = pProduct.UseTermDeposit;
}
示例5: PostingInterests_TenPosting
public void PostingInterests_TenPosting()
{
// Assert.Ignore();
SavingsBookProduct product = new SavingsBookProduct
{
Id = 1,
InterestBase = OSavingInterestBase.Daily,
InterestFrequency = OSavingInterestFrequency.EndOfDay,
Periodicity = new InstallmentType("Daily", 1, 0)
};
DateTime postingDate = new DateTime(2009, 01, 10);
SavingBookContract saving = new SavingBookContract(
ApplicationSettings.GetInstance(""),
new User(),
new DateTime(2009, 01, 01),
null)
{
Product = product,
InterestRate = 0.1,
NextMaturity = new DateTime(2009, 01, 01)
};
List<SavingInterestsPostingEvent> list = new List<SavingInterestsPostingEvent>();
List<SavingInterestsAccrualEvent> savingInterestsAccrualEvents = saving.CalculateInterest(
new DateTime(2009, 01, 10),
new User {Id = 1});
foreach (SavingInterestsAccrualEvent accrualEvent in savingInterestsAccrualEvents)
{
saving.Events.Add(accrualEvent);
}
saving.NextMaturity = saving.CreationDate.AddDays(-1);
while (
DateCalculationStrategy.GetNextMaturity(saving.NextMaturity.Value, saving.Product.Periodicity, 1)
<=
postingDate)
{
saving.NextMaturity = DateCalculationStrategy.GetNextMaturity(saving.NextMaturity.Value,
saving.Product.Periodicity, 1);
list.AddRange(saving.PostingInterests(saving.NextMaturity.Value, new User { Id = 1 }));
foreach (var postingEvent in list)
{
saving.Events.Add(postingEvent);
}
list.Clear();
}
Assert.AreEqual(10, saving.Events.FindAll(item =>item is SavingInterestsPostingEvent).Count);
}
示例6: CloseSavingsForm
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();
}
示例7: FrmAddSavingBookProduct
public FrmAddSavingBookProduct(SavingsBookProduct product)
{
InitializeComponent();
_savingsProduct = product;
InitializeComboBoxCurrencies();
LoadInterestComboBox();
LoadManagementFeeFreq();
LoadAgioFeesFrequency();
InitializeClientTypes();
InitializeControls(product);
LoadPostingFrequency();
InitializeTabPageTermDeposit();
_savingsProduct.PackageMode = OPackageMode.Edit;
}
示例8: CalculateInterest_NoDay
public void CalculateInterest_NoDay()
{
SavingsBookProduct product = new SavingsBookProduct
{
Id = 1,
InterestBase = OSavingInterestBase.Daily,
InterestFrequency = OSavingInterestFrequency.EndOfYear
};
SavingBookContract saving = new SavingBookContract(ApplicationSettings.GetInstance(""), new User(),
new DateTime(2009, 07, 01), null) { Product = product, InterestRate = 0.1 };
List<SavingInterestsAccrualEvent> list = new List<SavingInterestsAccrualEvent>();
list = saving.CalculateInterest(new DateTime(2009, 07, 01), new User { Id = 1 });
Assert.AreEqual(list.Count, 0);
}
示例9: OpenSavingsForm
public OpenSavingsForm(OCurrency pInitialAmount, OCurrency pEntryFees,
SavingsBookProduct savingsProduct, bool isReopen)
{
_savingsProduct = savingsProduct;
_initialAmount = pInitialAmount;
_entryFees = pEntryFees;
_isReopen = isReopen;
InitializeComponent();
Initialize();
if (_isReopen)
{
lbEntryFees.Text = GetString("lbReopenFees.Text");
lbEntryFeesConfirmation.Text = GetString("lbReopenFeesConfirmation.Text");
gbModifyInitialAmountEntryFees.Text = GetString("gbModifyInitialAmountReopenFees.Text");
}
}
示例10: PostingInterests_OnePosting
public void PostingInterests_OnePosting()
{
SavingsBookProduct product = new SavingsBookProduct
{
Id = 1,
InterestBase = OSavingInterestBase.Daily,
InterestFrequency = OSavingInterestFrequency.EndOfWeek,
Periodicity = new InstallmentType("Weekly", 7, 0)
};
User user = new User(){Id=1};
SavingBookContract saving = new SavingBookContract(
ApplicationSettings.GetInstance(""),
user,
new DateTime(2009, 01, 01),
null)
{
Product = product, InterestRate = 0.1
};
saving.NextMaturity = saving.GetNextMaturity(saving.CreationDate, saving.Periodicity);
saving.FirstDeposit(1000, saving.CreationDate, 0, user, new Teller());
List<SavingInterestsPostingEvent> list = new List<SavingInterestsPostingEvent>();
List<SavingInterestsPostingEvent> postingEvents = new List<SavingInterestsPostingEvent>();
DateTime closureDate = new DateTime(2009, 01, 05);
List<SavingInterestsAccrualEvent> accrualEvents = saving.CalculateInterest(closureDate, user);
foreach (var accrualEvent in accrualEvents)
{
saving.Events.Add(accrualEvent);
}
list = saving.PostingInterests(saving.NextMaturity.Value, user);
postingEvents.AddRange(list);
foreach (var postingEvent in list)
{
saving.Events.Add(postingEvent);
}
Assert.AreEqual( 1, postingEvents.Count);
}
示例11: PostingInterests_OnePosting
public void PostingInterests_OnePosting()
{
SavingsBookProduct product = new SavingsBookProduct
{
Id = 1,
InterestBase = OSavingInterestBase.Daily,
InterestFrequency = OSavingInterestFrequency.EndOfYear
};
SavingBookContract saving = new SavingBookContract(
ApplicationSettings.GetInstance(""),
new User(),
new DateTime(2009, 01, 01),
null)
{
Product = product,
InterestRate = 0.1
};
List<SavingInterestsPostingEvent> list = new List<SavingInterestsPostingEvent>();
list = saving.PostingInterests(new DateTime(2010, 01, 01), new User { Id = 1 });
Assert.AreEqual(list.Count, 1);
}
示例12: InitializeControls
private void InitializeControls(SavingsBookProduct product)
{
cbCurrency.SelectedItem = _savingsProduct.Currency;
tbName.Text = _savingsProduct.Name;
tbCodeSavingProduct.Text = _savingsProduct.Code;
tbBalanceMax.Text = _savingsProduct.BalanceMax.GetFormatedValue(_savingsProduct.UseCents);
tbBalanceMin.Text = _savingsProduct.BalanceMin.GetFormatedValue(_savingsProduct.UseCents);
tbDrawingMax.Text = _savingsProduct.WithdrawingMax.GetFormatedValue(_savingsProduct.UseCents);
tbWithDrawingMin.Text = _savingsProduct.WithdrawingMin.GetFormatedValue(_savingsProduct.UseCents);
tbInitialAmountMax.Text = _savingsProduct.InitialAmountMax.GetFormatedValue(_savingsProduct.UseCents);
tbInitialAmountMin.Text = _savingsProduct.InitialAmountMin.GetFormatedValue(_savingsProduct.UseCents);
tbTransferMin.Text = _savingsProduct.TransferMin.GetFormatedValue(_savingsProduct.UseCents);
tbTransferMax.Text = _savingsProduct.TransferMax.GetFormatedValue(_savingsProduct.UseCents);
if (_savingsProduct.InterestRateMax.HasValue) tbInterestRateMax.Text = (_savingsProduct.InterestRateMax.Value * 100).ToString();
if (_savingsProduct.InterestRateMin.HasValue) tbInterestRateMin.Text = (_savingsProduct.InterestRateMin.Value * 100).ToString();
if (_savingsProduct.InterestRate.HasValue) tbInterestRateValue.Text = (_savingsProduct.InterestRate.Value * 100).ToString();
cbPosting.SelectedValue = _savingsProduct.InterestFrequency.ToString();
cbAccrual.Text = _savingsProduct.InterestBase.ToString();
if (_savingsProduct.InterestBase == OSavingInterestBase.Monthly
|| _savingsProduct.InterestBase == OSavingInterestBase.Weekly)
cbCalculAmount.SelectedValue = _savingsProduct.CalculAmountBase.ToString();
if (_savingsProduct.EntryFees.HasValue) tbEntryFeesValue.Text = _savingsProduct.EntryFees.GetFormatedValue(_savingsProduct.UseCents);
if (_savingsProduct.EntryFeesMin.HasValue) tbEntryFeesMin.Text = _savingsProduct.EntryFeesMin.GetFormatedValue(_savingsProduct.UseCents);
if (_savingsProduct.EntryFeesMax.HasValue) tbEntryFeesMax.Text = _savingsProduct.EntryFeesMax.GetFormatedValue(_savingsProduct.UseCents);
if (_savingsProduct.WithdrawFeesType == OSavingsFeesType.Flat)
{
if (_savingsProduct.FlatWithdrawFees.HasValue)
tbWithdrawFees.Text = _savingsProduct.FlatWithdrawFees.GetFormatedValue(_savingsProduct.UseCents);
if (_savingsProduct.FlatWithdrawFeesMin.HasValue)
tbWithdrawFeesMin.Text = _savingsProduct.FlatWithdrawFeesMin.GetFormatedValue(_savingsProduct.UseCents);
if (_savingsProduct.FlatWithdrawFeesMax.HasValue)
tbWithdrawFeesMax.Text = _savingsProduct.FlatWithdrawFeesMax.GetFormatedValue(_savingsProduct.UseCents);
rbFlatWithdrawFees.Checked = true;
}
else
{
if (_savingsProduct.RateWithdrawFees.HasValue)
tbWithdrawFees.Text = (_savingsProduct.RateWithdrawFees.Value * 100).ToString();
if (_savingsProduct.RateWithdrawFeesMin.HasValue)
tbWithdrawFeesMin.Text = (_savingsProduct.RateWithdrawFeesMin.Value * 100).ToString();
if (_savingsProduct.RateWithdrawFeesMax.HasValue)
tbWithdrawFeesMax.Text = (_savingsProduct.RateWithdrawFeesMax.Value * 100).ToString();
rbRateWithdrawFees.Checked = true;
}
if (_savingsProduct.TransferFeesType == OSavingsFeesType.Flat)
{
if (_savingsProduct.FlatTransferFees.HasValue)
tbTransferFees.Text = _savingsProduct.FlatTransferFees.GetFormatedValue(_savingsProduct.UseCents);
if (_savingsProduct.FlatTransferFeesMin.HasValue)
tbTransferFeesMin.Text = _savingsProduct.FlatTransferFeesMin.GetFormatedValue(_savingsProduct.UseCents);
if (_savingsProduct.FlatTransferFeesMax.HasValue)
tbTransferFeesMax.Text = _savingsProduct.FlatTransferFeesMax.GetFormatedValue(_savingsProduct.UseCents);
rbFlatTransferFees.Checked = true;
}
else
{
if (_savingsProduct.RateTransferFees.HasValue)
tbTransferFees.Text = (_savingsProduct.RateTransferFees.Value * 100).ToString();
if (_savingsProduct.RateTransferFeesMin.HasValue)
tbTransferFeesMin.Text = (_savingsProduct.RateTransferFeesMin.Value * 100).ToString();
if (_savingsProduct.RateTransferFeesMax.HasValue)
tbTransferFeesMax.Text = (_savingsProduct.RateTransferFeesMax.Value * 100).ToString();
rbRateTransferFees.Checked = true;
}
if (ServicesProvider.GetInstance().GetSavingProductServices().IsThisProductAlreadyUsed(product.Id))
{
tbName.Enabled = false;
tbCodeSavingProduct.Enabled = false;
cbCurrency.Enabled = false;
gbFrequency.Enabled = false;
rbFlatTransferFees.Enabled = false;
rbFlatWithdrawFees.Enabled = false;
rbRateTransferFees.Enabled = false;
rbRateWithdrawFees.Enabled = false;
}
if (_savingsProduct.CloseFees.HasValue)
tbCloseFees.Text = _savingsProduct.CloseFees.GetFormatedValue(_savingsProduct.UseCents);
if (_savingsProduct.CloseFeesMin.HasValue)
tbCloseFeesMin.Text = _savingsProduct.CloseFeesMin.GetFormatedValue(_savingsProduct.UseCents);
if (_savingsProduct.CloseFeesMax.HasValue)
tbCloseFeesMax.Text = _savingsProduct.CloseFeesMax.GetFormatedValue(_savingsProduct.UseCents);
if (_savingsProduct.ManagementFees.HasValue)
tbManagementFees.Text = _savingsProduct.ManagementFees.GetFormatedValue(_savingsProduct.UseCents);
if (_savingsProduct.ManagementFeesMin.HasValue)
tbManagementFeesMin.Text = _savingsProduct.ManagementFeesMin.GetFormatedValue(_savingsProduct.UseCents);
if (_savingsProduct.ManagementFeesMax.HasValue)
tbManagementFeesMax.Text = _savingsProduct.ManagementFeesMax.GetFormatedValue(_savingsProduct.UseCents);
if (_savingsProduct.OverdraftFees.HasValue)
tbOverdraftFees.Text = _savingsProduct.OverdraftFees.GetFormatedValue(_savingsProduct.UseCents);
if (_savingsProduct.OverdraftFeesMin.HasValue)
tbOverdraftFeesMin.Text = _savingsProduct.OverdraftFeesMin.GetFormatedValue(_savingsProduct.UseCents);
if (_savingsProduct.OverdraftFeesMax.HasValue)
tbOverdraftFeesMax.Text = _savingsProduct.OverdraftFeesMax.GetFormatedValue(_savingsProduct.UseCents);
//.........这里部分代码省略.........
示例13: GetSavingContract
private SavingBookContract GetSavingContract(IClient client)
{
User user = ServicesProvider.GetInstance().GetUserServices().FindAll(false)[0];
User.CurrentUser = user;
SavingBookContract savingContract = new SavingBookContract(
ServicesProvider.GetInstance().GetGeneralSettings(),
user);
client.Branch = new Branch() { Id = 1, Code = "Test" };
SavingsBookProduct product = new SavingsBookProduct();
product.AgioFees = 0;
product.BalanceMin = 0;
product.BalanceMax = 5000;
product.ChequeDepositFees = 0;
product.ClientType = OClientTypes.All;
product.CloseFees = 0;
product.InterestRate = 0;
product.TransferMin = 1;
product.TransferMax = 5000;
product.WithdrawingMin = 1;
product.WithdrawingMax = 5000;
product.ReopenFees = 0;
product.RateWithdrawFees = 0;
product.TransferFeesType = OSavingsFeesType.Flat;
product.FlatTransferFees = 0;
product.FlatWithdrawFees = 0;
product.WithdrawFeesType = OSavingsFeesType.Flat;
product.EntryFees = 0;
product.DepositFees = 0;
product.DepositMin = 1;
product.DepositMax = 5000;
product.ManagementFees = 0;
product.Code = "test";
product.Name = "Test";
product.InitialAmountMin = 0;
product.InitialAmountMax = 5000;
product.Currency = new Currency(){Id=1};
product.InterestFrequency = OSavingInterestFrequency.EndOfMonth;
product.InterestBase = OSavingInterestBase.Daily;
product.OverdraftFees = 0;
product.InterBranchTransferFee.Value = 0;
product.ManagementFeeFreq = new InstallmentType(1,"Test",30,1);
product.AgioFeesFreq = new InstallmentType(1,"test",30,1);
ServicesProvider.GetInstance().GetSavingProductServices().SaveProduct(product);
savingContract.Product = product;
savingContract.InterestRate = 0;
savingContract.FlatTransferFees = 0;
savingContract.FlatWithdrawFees = 0;
savingContract.DepositFees = 0;
savingContract.CloseFees = 0;
savingContract.ReopenFees = 0;
savingContract.ManagementFees = 0;
savingContract.AgioFees = 0;
savingContract.Branch = client.Branch;
savingContract.SavingsOfficer = user;
savingContract.CreationDate = DateTime.Now;
savingContract.Code = "test";
savingContract.InitialAmount = 1;
savingContract.EntryFees = 0;
ServicesProvider.GetInstance().GetSavingServices().SaveContract(savingContract, (Client) client);
ServicesProvider.GetInstance().GetSavingServices().Deposit(savingContract, DateTime.Now, 4000, string.Empty,
user, false, OSavingsMethods.Cash, null,
new Teller());
return savingContract;
}
示例14: RateWithdrawFees
public void RateWithdrawFees()
{
SavingsBookProduct product = new SavingsBookProduct()
{
WithdrawFeesType = OSavingsFeesType.Rate,
RateWithdrawFeesMin = 0.01,
RateWithdrawFeesMax = 0.05
};
SavingBookContract saving = new SavingBookContract(ApplicationSettings.GetInstance(""), new User(), new DateTime(2009, 01, 01), product, null) { RateWithdrawFees = 0.03 };
saving.FirstDeposit(1000, new DateTime(2009, 01, 01), null, new User(), Teller.CurrentTeller);
List<SavingEvent> withdrawEvents = saving.Withdraw(10, new DateTime(2009, 01, 02), "withdraw", new User(), false, null);
Assert.AreEqual(1, withdrawEvents.Count);
Assert.AreEqual(10, withdrawEvents[0].Amount.Value);
Assert.AreEqual(0.3, ((ISavingsFees)withdrawEvents[0]).Fee.Value);
Assert.AreEqual(989.7, saving.GetBalance().Value);
}
示例15: SetUp
public void SetUp()
{
ApplicationSettings dataParam = ApplicationSettings.GetInstance("");
dataParam.DeleteAllParameters();
dataParam.AddParameter(OGeneralSettings.ACCOUNTINGPROCESS, OAccountingProcesses.Cash);
Currency currency = new Currency() { UseCents = true, Code = "SOM", Id = 1, IsPivot = true, Name = "SOM" };
_bookProduct = new SavingsBookProduct
{
CalculAmountBase = OSavingCalculAmountBase.MinimalAmount,
Id = 1,
InterestBase = OSavingInterestBase.Daily,
InterestFrequency = OSavingInterestFrequency.EndOfWeek,
ManagementFeeFreq = new InstallmentType
{
Id = 1,
Name = "Monthly",
NbOfDays = 0,
NbOfMonths = 1
},
AgioFeesFreq = new InstallmentType
{
Id = 2,
Name = "Daily",
NbOfDays = 1,
NbOfMonths = 0
},
WithdrawFeesType = OSavingsFeesType.Flat,
FlatWithdrawFees = 0,
Currency = currency
};
_saving = new SavingBookContract(ApplicationSettings.GetInstance(""),
new User(),
new DateTime(2007, 08, 11), _bookProduct, null);
}