當前位置: 首頁>>代碼示例>>C#>>正文


C# SavingBookContract.Deposit方法代碼示例

本文整理匯總了C#中OpenCBS.CoreDomain.Contracts.Savings.SavingBookContract.Deposit方法的典型用法代碼示例。如果您正苦於以下問題:C# SavingBookContract.Deposit方法的具體用法?C# SavingBookContract.Deposit怎麽用?C# SavingBookContract.Deposit使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在OpenCBS.CoreDomain.Contracts.Savings.SavingBookContract的用法示例。


在下文中一共展示了SavingBookContract.Deposit方法的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的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: Charge_deposit_fees

        public void Charge_deposit_fees()
        {
            SavingBookContract saving = new SavingBookContract(ApplicationSettings.GetInstance(""),
                                       new User(), new DateTime(2009, 1, 1), null)
            {
                Product = _bookProduct,
                AgioFees = 0.01,
                ChequeDepositFees = 100,
                DepositFees = 50,
                CloseFees = 100,
                ReopenFees = 100,
                OverdraftFees = 100
            };
            Currency currency = new Currency() { UseCents = true, Code = "SOM", Id = 1, IsPivot = true, Name = "SOM" };

            //            List<SavingEvent> cashDepositEvents = saving.Deposit(100, new DateTime(2009, 1, 2), "cash deposit", new User(), false,
            //                                                             false, OPaymentMethods.Cash, null, null);
            List<SavingEvent> cashDepositEvents = saving.Deposit(100, new DateTime(2009, 1, 2), "cash deposit", new User(), false,
                                                             false, OSavingsMethods.Cash, null, null);
            //            List<SavingEvent> chequeDepositEvents = saving.Deposit(100, new DateTime(2009, 1, 2), "cheque deposit", new User(), false,
            //                                                             false, OPaymentMethods.Cheque, null, null);
            List<SavingEvent> chequeDepositEvents = saving.Deposit(100, new DateTime(2009, 1, 2), "cheque deposit", new User(), false,
                                                             false, OSavingsMethods.Cheque, null, null);
            foreach (SavingEvent cashEvent in cashDepositEvents)
            {
                Assert.AreEqual(cashEvent.Fee, saving.DepositFees);
            }
            foreach (SavingEvent chequeEvent in chequeDepositEvents)
            {
                Assert.AreEqual(chequeEvent.Fee, saving.ChequeDepositFees);
            }
        }
開發者ID:TalasZh,項目名稱:opencbs,代碼行數:32,代碼來源:TestSavingFees.cs

示例3: CalculateInterest_TwoOperation_In_OneDay

        public void CalculateInterest_TwoOperation_In_OneDay()
        {
            SavingsBookProduct product = new SavingsBookProduct
            {
                Id = 1,
                InterestBase = OSavingInterestBase.Monthly,
                InterestFrequency = OSavingInterestFrequency.EndOfYear,
                CalculAmountBase = OSavingCalculAmountBase.MinimalAmount,
                WithdrawFeesType = OSavingsFeesType.Flat,
                FlatWithdrawFees = 0
            };
            SavingBookContract saving = new SavingBookContract(ApplicationSettings.GetInstance(""), new User(),
                new DateTime(2009, 01, 01), null) { Product = product, InterestRate = 0.1, FlatWithdrawFees = 0 };
            saving.FirstDeposit(1000, new DateTime(2009, 01, 01), null, new User(), Teller.CurrentTeller);

            saving.Withdraw(250, new DateTime(2009, 01, 15), "retrait", new User(), false, null);
            //            saving.Deposit(100, new DateTime(2009, 01, 15), "depot", new User(), true, false, OPaymentMethods.Cash, null, null);
            saving.Deposit(100, new DateTime(2009, 01, 15), "depot", new User(), true, false, OSavingsMethods.Cash, null, null);

            List<SavingInterestsAccrualEvent> list = new List<SavingInterestsAccrualEvent>();
            list = saving.CalculateInterest(new DateTime(2009, 02, 01), new User { Id = 1 });

            Assert.AreEqual(list.Count, 1);
            Assert.AreEqual(list[0].Amount, 75);
        }
開發者ID:TalasZh,項目名稱:opencbs,代碼行數:25,代碼來源:Monthly.cs

示例4: CalculateInterest_OneMonth

        public void CalculateInterest_OneMonth()
        {
            SavingsBookProduct product = new SavingsBookProduct
            {
                Id = 1,
                InterestBase = OSavingInterestBase.Weekly,
                InterestFrequency = OSavingInterestFrequency.EndOfYear,
                CalculAmountBase = OSavingCalculAmountBase.MinimalAmount
            };
            SavingBookContract saving = new SavingBookContract(ApplicationSettings.GetInstance(""), new User(),
                new DateTime(2009, 01, 01), null) { Product = product, InterestRate = 0.1 };
            saving.FirstDeposit(1000, new DateTime(2009, 01, 01), null, new User(), Teller.CurrentTeller);

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

            List<SavingInterestsAccrualEvent> list = new List<SavingInterestsAccrualEvent>();
            list = saving.CalculateInterest(new DateTime(2009, 02, 01), new User { Id = 1 });

            Assert.AreEqual(list.Count, 4);
            Assert.AreEqual(list[0].Amount, 100);
        }
開發者ID:aelhadi,項目名稱:opencbs,代碼行數:22,代碼來源:Weekly.cs

示例5: 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

示例6: Get_Balance_At_Date

        public void Get_Balance_At_Date()
        {
            SavingsBookProduct product = new SavingsBookProduct()
            {
                WithdrawFeesType = OSavingsFeesType.Flat,
                FlatWithdrawFees = 0
            };

            SavingBookContract saving = new SavingBookContract(ApplicationSettings.GetInstance(""),  new User(), new DateTime(2009, 01, 01),
                product, null) { FlatWithdrawFees = 0, DepositFees = 5, CloseFees = 6, ManagementFees = 7};
            saving.FirstDeposit(1000, new DateTime(2009, 01, 01), null, new User(), Teller.CurrentTeller);

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

            Assert.AreEqual(saving.GetBalance(new DateTime(2009, 01, 31)), 1000);
            Assert.AreEqual(saving.GetBalance(new DateTime(2009, 02, 01)), 1100);
            Assert.AreEqual(saving.GetBalance(new DateTime(2009, 02, 02)), 1100);
            Assert.AreEqual(saving.GetBalance(new DateTime(2009, 02, 03)), 870);
        }
開發者ID:himmelreich-it,項目名稱:opencbs,代碼行數:21,代碼來源:TestSaving.cs

示例7: 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.Deposit方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。