当前位置: 首页>>代码示例>>C#>>正文


C# SavingBookContract.Closure方法代码示例

本文整理汇总了C#中OpenCBS.CoreDomain.Contracts.Savings.SavingBookContract.Closure方法的典型用法代码示例。如果您正苦于以下问题:C# SavingBookContract.Closure方法的具体用法?C# SavingBookContract.Closure怎么用?C# SavingBookContract.Closure使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在OpenCBS.CoreDomain.Contracts.Savings.SavingBookContract的用法示例。


在下文中一共展示了SavingBookContract.Closure方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: CalculateInterest_AccrualhMode_Daily_EndOfYear_OneClosure_AfterOneWeek_Agio

        public void CalculateInterest_AccrualhMode_Daily_EndOfYear_OneClosure_AfterOneWeek_Agio()
        {
            Assert.Ignore();
            ApplicationSettings.GetInstance("").UpdateParameter(OGeneralSettings.ACCOUNTINGPROCESS, OAccountingProcesses.Accrual);
            _bookProduct.InterestFrequency = OSavingInterestFrequency.EndOfYear;
            SavingBookContract saving = new SavingBookContract(ApplicationSettings.GetInstance(""),  new User(),
                new DateTime(2009, 01, 01), null) { Product = _bookProduct, InterestRate = 0.1, AgioFees = 0.1 };

            saving.Closure(new DateTime(2009, 01, 08), new User() { Id = 1 });

            int accrualEvents = saving.Events.FindAll(item => item is SavingInterestsAccrualEvent).Count;
            int postingEvents = saving.Events.FindAll(items => items is SavingInterestsPostingEvent).Count;

            List<SavingEvent> agioEvents = saving.Events.FindAll(items => items is SavingAgioEvent);
            Assert.AreEqual(agioEvents.Count, 7);
            Assert.AreEqual(agioEvents[0].Fee, 10);
            Assert.AreEqual(saving.GetBalance(), -170);

            //            saving.Deposit(200, new DateTime(2009, 01, 08), "depot", new User(), false, false, OPaymentMethods.Cash, null, null);
            saving.Deposit(200, new DateTime(2009, 01, 08), "depot", new User(), false, false, OSavingsMethods.Cash, null, null);
            //saving.Withdraw(230, new DateTime(2009, 02, 03), "retrait", new User(), false);

            saving.Closure(new DateTime(2009, 01, 15), new User() { Id = 1 });
            List<SavingEvent> agioEvents2 = saving.Events.FindAll(items => items is SavingAgioEvent);
            Assert.AreEqual(agioEvents2.Count, 13);
            Assert.AreEqual(agioEvents2[9].Fee, 13);
            Assert.AreEqual(saving.GetBalance(), -51);
        }
开发者ID:TalasZh,项目名称:opencbs,代码行数:28,代码来源:TestSavingFees.cs

示例2: CalculateInterest_AccrualhMode_Daily_EndOfYear_OneClosure_AfterOneWeek

        public void CalculateInterest_AccrualhMode_Daily_EndOfYear_OneClosure_AfterOneWeek()
        {
            ApplicationSettings.GetInstance("").UpdateParameter(OGeneralSettings.ACCOUNTINGPROCESS, OAccountingProcesses.Accrual);
            _product.InterestFrequency = OSavingInterestFrequency.EndOfYear;
            SavingBookContract saving =
                new SavingBookContract(
                    ApplicationSettings.GetInstance(""),
                     new User(),
                    new DateTime(2009, 01, 01),
                    null)
                    {
                        Product = _product,
                        InterestRate = 0.1,
                        AgioFees = 8
                    };
            saving.FirstDeposit(1000, new DateTime(2009, 01, 01), null, new User(), Teller.CurrentTeller);

            saving.Closure(new DateTime(2009, 01, 08), new User() { Id = 1 });

            int accrualEvents = saving.Events.FindAll(item => item is SavingInterestsAccrualEvent).Count;
            int postingEvents = saving.Events.FindAll(items => items is SavingInterestsPostingEvent).Count;

            Assert.AreEqual(7, accrualEvents);
            Assert.AreEqual(0, postingEvents);
            Assert.AreEqual(1000m, saving.GetBalance().Value);
        }
开发者ID:himmelreich-it,项目名称:opencbs,代码行数:26,代码来源:TestSaving.cs

示例3: SeveralMgmtFeeEvents

 public void SeveralMgmtFeeEvents()
 {
     _saving = new SavingBookContract(ApplicationSettings.GetInstance(""),  new User(), new DateTime(2007, 08, 11), _bookProduct, null);
     _saving.AgioFees = 0.1;
     _saving.ManagementFees = 50;
     _saving.FirstDeposit(10000, new DateTime(2007, 08, 01), null, new User(), Teller.CurrentTeller);
     _saving.Closure(new DateTime(2007, 12, 31), new User());
     List<SavingEvent> events = _saving.Events.FindAll(item => item is SavingManagementFeeEvent);
     Assert.AreEqual(events.Count, 4);
     Assert.AreEqual(9800,_saving.GetBalance().Value);
 }
开发者ID:TalasZh,项目名称:opencbs,代码行数:11,代码来源:TestSavingFees.cs

示例4: UpdateAccountsBalanceSaving

        public void UpdateAccountsBalanceSaving()
        {
            Assert.Ignore(); // Ru55
            SavingBookContract saving = new SavingBookContract(ApplicationSettings.GetInstance(""),  new User() { Id = 1 },
                new DateTime(2009, 01, 01), _savingsBookProduct, null)
            {
                Code = "S/CR/2009/SAVIN-1/BAR-2",
                Status = OSavingsStatus.Active,
                InterestRate = 0.01,
                FlatWithdrawFees = 3,
                FlatTransferFees = 3,
                AgioFees = 0.1
            };
            saving.Events[0].User = new User() { Id = 1 };
            saving.Id = _savingManager.Add(saving, new Person { Id = 6 });

            saving = (SavingBookContract)_savingManager.Select(saving.Id);

            saving.Closure(new DateTime(2009, 02, 01), new User { Id = 1 });
            saving.Withdraw(50, new DateTime(2009, 02, 01), "testWithdraw", new User { Id = 1 }, false, null);
            saving.Closure(new DateTime(2010, 01, 01), new User { Id = 1 });

            SavingBookContract retrievedSaving = (SavingBookContract)_savingManager.Select(saving.Id);
        }
开发者ID:TalasZh,项目名称:opencbs,代码行数:24,代码来源:TestSavingsManager.cs

示例5: CalculateInterest_AccrualMode_Weekly_EndOfYear_OneClosure_DayOfCreation

        public void CalculateInterest_AccrualMode_Weekly_EndOfYear_OneClosure_DayOfCreation()
        {
            ApplicationSettings.GetInstance("").UpdateParameter(OGeneralSettings.ACCOUNTINGPROCESS, OAccountingProcesses.Accrual);

            _product.InterestBase = OSavingInterestBase.Weekly;
            _product.InterestFrequency = OSavingInterestFrequency.EndOfYear;
            SavingBookContract saving = new SavingBookContract(ApplicationSettings.GetInstance(""), new User(),
                new DateTime(2009, 01, 15), null) { Product = _product, InterestRate = 0.1 };
            saving.FirstDeposit(1000, new DateTime(2009, 01, 15), null, new User(), Teller.CurrentTeller);

            List<SavingEvent> events = saving.Closure(new DateTime(2009, 01, 15, 1, 1, 1), new User() { Id = 1 });

            int accrualEvents = saving.Events.FindAll(item => item is SavingInterestsAccrualEvent).Count;
            int postingEvents = saving.Events.FindAll(item => item is SavingInterestsPostingEvent).Count;

            Assert.AreEqual(events.Count, 1);
            Assert.AreEqual(accrualEvents, 0);
            Assert.AreEqual(postingEvents, 0);
            Assert.AreEqual(saving.GetBalance(), 1000);
        }
开发者ID:himmelreich-it,项目名称:opencbs,代码行数:20,代码来源:TestSaving.cs

示例6: CalculateInterest_AccrualMode_Weekly_EndOfWeek_OneClosure_AfterOneWeek

        public void CalculateInterest_AccrualMode_Weekly_EndOfWeek_OneClosure_AfterOneWeek()
        {
            ApplicationSettings.GetInstance("").UpdateParameter(OGeneralSettings.ACCOUNTINGPROCESS, OAccountingProcesses.Accrual);
            _product.InterestBase = OSavingInterestBase.Weekly;
            SavingBookContract saving = new SavingBookContract(ApplicationSettings.GetInstance(""), new User(),
                new DateTime(2009, 01, 01), null) { Product = _product, InterestRate = 0.1, ManagementFees = 10, AgioFees = 0.1 };
            saving.FirstDeposit(1000, new DateTime(2009, 01, 01), null, new User(), Teller.CurrentTeller);

            List<SavingEvent> events = saving.Closure(new DateTime(2009, 01, 08, 1, 1, 1), new User() { Id = 1 });

            int accrualEvents = saving.Events.FindAll(item => item is SavingInterestsAccrualEvent).Count;
            int postingEvents = saving.Events.FindAll(item => item is SavingInterestsPostingEvent).Count;

            Assert.AreEqual(3, events.Count);
            Assert.AreEqual(1, accrualEvents);
            Assert.AreEqual(1, postingEvents);
            Assert.AreEqual(1100m, saving.GetBalance().Value);
        }
开发者ID:himmelreich-it,项目名称:opencbs,代码行数:18,代码来源:TestSaving.cs

示例7: CalculateInterest_AccrualhMode_Daily_EndOfYear_OneClosure_AfterOneWeek_Agio

        public void CalculateInterest_AccrualhMode_Daily_EndOfYear_OneClosure_AfterOneWeek_Agio()
        {
            ApplicationSettings.GetInstance("").UpdateParameter(OGeneralSettings.ACCOUNTINGPROCESS, OAccountingProcesses.Accrual);
            _product.InterestFrequency = OSavingInterestFrequency.EndOfYear;
            SavingBookContract saving = new SavingBookContract(ApplicationSettings.GetInstance(""),
                                                               new User(),
                                                               new DateTime(2009, 01, 01), null)
                                            {Product = _product, InterestRate = 0.1, AgioFees = 0.1};
            saving.FirstDeposit(-100, new DateTime(2009, 01, 01), 0, new User(), Teller.CurrentTeller);

            saving.Closure(new DateTime(2009, 01, 08), new User() { Id = 1 });

            int accrualEvents = saving.Events.FindAll(item => item is SavingInterestsAccrualEvent).Count;
            int postingEvents = saving.Events.FindAll(items => items is SavingInterestsPostingEvent).Count;

            /*Assert.AreEqual(accrualEvents, 7);
            Assert.AreEqual(postingEvents, 0);
            Assert.AreEqual(saving.ChartOfAccounts.GetAccountByNumber(OAccounts.ACCOUNT_PAYABLE_INTERESTS_ON_SAVINGS_BOOKS, 1).Balance.Value, 700);
            Assert.AreEqual(saving.ChartOfAccounts.GetAccountByNumber(OAccounts.SAVINGS, 1).Balance.Value, 1000);
            Assert.AreEqual(saving.ChartOfAccounts.GetAccountByNumber(OAccounts.CASH, 1).Balance.Value, 1000);
            Assert.AreEqual(saving.ChartOfAccounts.GetAccountByNumber(OAccounts.INTERESTS_ON_DEPOSIT_ACCOUNT, 1).Balance.Value, 700);
             */

            List<SavingEvent> agioEvents = saving.Events.FindAll(items => items is SavingAgioEvent);
            Assert.AreEqual(agioEvents.Count, 7);
            Assert.AreEqual(agioEvents[0].Fee, 10);
            Assert.AreEqual(saving.GetBalance(), -194.88);

            //            saving.Deposit(200, new DateTime(2009, 01, 08), "depot", new User(), false, false, OPaymentMethods.Cash, null, null);
            saving.Deposit(200, new DateTime(2009, 01, 08), "depot", new User(), false, false, OSavingsMethods.Cash, null, null);
            //saving.Withdraw(230, new DateTime(2009, 02, 03), "retrait", new User(), false);

            saving.Closure(new DateTime(2009, 01, 15), new User() { Id = 1 });
            List<SavingEvent> agioEvents2 = saving.Events.FindAll(items => items is SavingAgioEvent);
            Assert.AreEqual(agioEvents2.Count, 7);
            Assert.AreEqual(saving.GetBalance(), 5.12);
        }
开发者ID:himmelreich-it,项目名称:opencbs,代码行数:37,代码来源:TestSaving.cs

示例8: CalculateInterest_AccrualMode_Monthly_EndOfYear_OneClosure_On_PostingDate

        public void CalculateInterest_AccrualMode_Monthly_EndOfYear_OneClosure_On_PostingDate()
        {
            ApplicationSettings.GetInstance("").UpdateParameter(OGeneralSettings.ACCOUNTINGPROCESS, OAccountingProcesses.Accrual);
            _product.InterestBase = OSavingInterestBase.Monthly;
            _product.InterestFrequency = OSavingInterestFrequency.EndOfYear;
            SavingBookContract saving = new SavingBookContract(ApplicationSettings.GetInstance(""),  new User(),
                new DateTime(2009, 01, 01), null) { Product = _product, InterestRate = 0.1, ManagementFees = 10, AgioFees = 0.1 };
            saving.FirstDeposit(1000, new DateTime(2009, 01, 01), null, new User(), Teller.CurrentTeller);

            saving.Closure(new DateTime(2010, 01, 01, 1, 1, 1), new User() { Id = 1 });

            int accrualEvents = saving.Events.FindAll(item => item is SavingInterestsAccrualEvent).Count;
            int postingEvents = saving.Events.FindAll(item => item is SavingInterestsPostingEvent).Count;

            Assert.AreEqual(accrualEvents, 12);
            Assert.AreEqual(postingEvents, 1);
            Assert.AreEqual(2014.0, saving.GetBalance().Value);
        }
开发者ID:himmelreich-it,项目名称:opencbs,代码行数:18,代码来源:TestSaving.cs

示例9: CalculateInterest_CashMode_Daily_EndOfWeek_OneClosure_DayOfCreation

        public void CalculateInterest_CashMode_Daily_EndOfWeek_OneClosure_DayOfCreation()
        {
            SavingBookContract saving = new SavingBookContract(ApplicationSettings.GetInstance(""), new User(),
                new DateTime(2009, 01, 15), null) { Product = _product, InterestRate = 0.1 };
            saving.FirstDeposit(1000, new DateTime(2009, 01, 15), null, new User(), Teller.CurrentTeller);

            List<SavingEvent> events = saving.Closure(new DateTime(2009, 01, 15, 1, 1, 1), new User() { Id = 1 });

            int accrualEvents = saving.Events.FindAll(item => item is SavingInterestsAccrualEvent).Count;
            int postingEvents = saving.Events.FindAll(item => item is SavingInterestsPostingEvent).Count;

            Assert.AreEqual(events.Count, 1);
            Assert.AreEqual(accrualEvents, 0);
            Assert.AreEqual(postingEvents, 0);
            Assert.AreEqual(saving.GetBalance(), 1000);
        }
开发者ID:himmelreich-it,项目名称:opencbs,代码行数:16,代码来源:TestSaving.cs

示例10: CalculateInterest_AccrualMode_Daily_EndOfWeek_OneClosure_On_PostingDate

        public void CalculateInterest_AccrualMode_Daily_EndOfWeek_OneClosure_On_PostingDate()
        {
            ApplicationSettings.GetInstance("").UpdateParameter(OGeneralSettings.ACCOUNTINGPROCESS, OAccountingProcesses.Accrual);
            SavingBookContract saving = new SavingBookContract(ApplicationSettings.GetInstance(""), new User(),
                new DateTime(2009, 01, 01), null) { Product = _product, InterestRate = 0.01, AgioFees = 0 };
            saving.FirstDeposit(1000, new DateTime(2009, 01, 01), null, new User(), Teller.CurrentTeller);

            saving.Closure(new DateTime(2009, 01, 05), new User() { Id = 1 });

            int accrualEvents = saving.Events.FindAll(item => item is SavingInterestsAccrualEvent).Count;
            int postingEvents = saving.Events.FindAll(items => items is SavingInterestsPostingEvent).Count;
            OCurrency interests = saving.Events.Where(item => item is SavingInterestsAccrualEvent).Sum(item => item.Amount.Value);

            Assert.AreEqual(accrualEvents, 4);
            Assert.AreEqual(postingEvents, 0);
            Assert.AreEqual(saving.GetBalance(), 1000);
        }
开发者ID:himmelreich-it,项目名称:opencbs,代码行数:17,代码来源:TestSaving.cs

示例11: CalculateInterest_AccrualMode_Daily_EndOfMonth_OneClosure_TwoMonthsAndOneBrouette_AfterCreation

        public void CalculateInterest_AccrualMode_Daily_EndOfMonth_OneClosure_TwoMonthsAndOneBrouette_AfterCreation()
        {
            ApplicationSettings.GetInstance("").UpdateParameter(OGeneralSettings.ACCOUNTINGPROCESS, OAccountingProcesses.Accrual);
            _product.InterestFrequency = OSavingInterestFrequency.EndOfMonth;
            SavingBookContract saving = new SavingBookContract(ApplicationSettings.GetInstance(""),  new User(),
                new DateTime(2009, 01, 01), null) { Product = _product, InterestRate = 0.01, ManagementFees = 10, AgioFees = 0.1 };
            saving.FirstDeposit(1000, new DateTime(2009, 01, 01), null, new User(), Teller.CurrentTeller);

            saving.Closure(new DateTime(2009, 02, 04), new User() { Id = 1 });

            int accrualEvents = saving.Events.FindAll(item => item is SavingInterestsAccrualEvent).Count;
            int postingEvents = saving.Events.FindAll(items => items is SavingInterestsPostingEvent).Count;

            Assert.AreEqual(accrualEvents, 34);
            Assert.AreEqual(postingEvents, 1);
            Assert.AreEqual(saving.GetBalance(), 1299.9);
        }
开发者ID:himmelreich-it,项目名称:opencbs,代码行数:17,代码来源:TestSaving.cs

示例12: CalculateInterest_AccrualMode_Daily_EndOfMonth_OneClosure_65Days_AfterCreation

        public void CalculateInterest_AccrualMode_Daily_EndOfMonth_OneClosure_65Days_AfterCreation()
        {
            ApplicationSettings.GetInstance("").UpdateParameter(OGeneralSettings.ACCOUNTINGPROCESS, OAccountingProcesses.Accrual);
            _product.InterestFrequency = OSavingInterestFrequency.EndOfMonth;
            SavingBookContract saving = new SavingBookContract(ApplicationSettings.GetInstance(""),  new User(),
                new DateTime(2009, 01, 01), null) { Product = _product, InterestRate = 1, ManagementFees = 0, AgioFees = 0 };
            saving.FirstDeposit(1000, new DateTime(2009, 01, 01), null, new User(), Teller.CurrentTeller);

            saving.Closure(new DateTime(2009, 03, 07), new User() { Id = 1 });

            int accrualEvents = saving.Events.FindAll(item => item is SavingInterestsAccrualEvent).Count;
            int postingEvents = saving.Events.FindAll(items => items is SavingInterestsPostingEvent).Count;
            //OCurrency interests = saving.Events.Where(item => item is SavingInterestsAccrualEvent).Sum(item => item.Amount.Value);

            Assert.AreEqual(accrualEvents, 65);
            Assert.AreEqual(postingEvents, 2);
            Assert.AreEqual(saving.GetBalance(), 929000);
        }
开发者ID:himmelreich-it,项目名称:opencbs,代码行数:18,代码来源:TestSaving.cs

示例13: OneMgmtFeeEvent

        public void OneMgmtFeeEvent()
        {
            // Fix
            //            Assert.Ignore();

            _saving = new SavingBookContract(
                                                ApplicationSettings.GetInstance(""),

                                                new User(),
                                                new DateTime(2007, 08, 11),
                                                _product,
                                                null
                                            );
            _saving.FirstDeposit(10000m, new DateTime(2007, 08, 11), 0, new User(), Teller.CurrentTeller);
            _saving.AgioFees = 0.1;
            _saving.ManagementFees = 50;
            _saving.Closure(new DateTime(2007, 9, 11), new User());
            List<SavingEvent> events = _saving.Events.FindAll(item => item is SavingManagementFeeEvent);
            Assert.AreEqual(events.Count, 1);
        }
开发者ID:himmelreich-it,项目名称:opencbs,代码行数:20,代码来源:TestSaving.cs

示例14: Cancel_Last_Withdraw_Event_After_Closure

        public void Cancel_Last_Withdraw_Event_After_Closure()
        {
            SavingBookContract saving = new SavingBookContract(ApplicationSettings.GetInstance(""),  new User(), new DateTime(2009, 01, 01),
                _product, null) { InterestRate = 0.1, FlatWithdrawFees = 0, AgioFees = 0.1 };
            saving.FirstDeposit(100, new DateTime(2009, 01, 01), null, new User(), Teller.CurrentTeller);

            saving.Closure(new DateTime(2009, 01, 02), new User());
            saving.Withdraw(50, new DateTime(2009, 01, 02), "retrait", new User(), false, null);

            Assert.AreEqual(saving.GetBalance(), 50);

            saving.Closure(new DateTime(2009, 01, 05), new User());
            Assert.AreEqual(saving.GetBalance(), 50);
            saving.CancelLastEvent();
            Assert.AreEqual(saving.GetBalance(), 50);
        }
开发者ID:himmelreich-it,项目名称:opencbs,代码行数:16,代码来源:TestSaving.cs

示例15: Cancel_Last_Deposit_Event_After_Closure

        public void Cancel_Last_Deposit_Event_After_Closure()
        {
            SavingBookContract saving = new SavingBookContract(ApplicationSettings.GetInstance(""),  new User(), new DateTime(2009, 01, 01),
                _product, null) { InterestRate = 0.1, DepositFees = 5, CloseFees = 6, ManagementFees = 7, AgioFees = 8, OverdraftFees = 9};
            saving.FirstDeposit(100, new DateTime(2009, 01, 01), null, new User(), Teller.CurrentTeller);

            saving.Closure(new DateTime(2009, 01, 02), new User());
            //            saving.Deposit(50, new DateTime(2009, 01, 02), "depot", new User(), false, false, OPaymentMethods.Cash, null, null);
            saving.Deposit(50, new DateTime(2009, 01, 02), "depot", new User(), false, false, OSavingsMethods.Cash, null, null);

            Assert.AreEqual(saving.GetBalance(), 150);

            saving.Closure(new DateTime(2009, 01, 05), new User());
            Assert.AreEqual(saving.GetBalance(), 150);

            saving.CancelLastEvent();
            Assert.AreEqual(saving.GetBalance(), 150);
        }
开发者ID:himmelreich-it,项目名称:opencbs,代码行数:18,代码来源:TestSaving.cs


注:本文中的OpenCBS.CoreDomain.Contracts.Savings.SavingBookContract.Closure方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。