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


C# SavingBookContract.Withdraw方法代码示例

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


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

示例1: Charge_agio_fees

        public void Charge_agio_fees()
        {
            SavingBookContract saving = new SavingBookContract(ApplicationSettings.GetInstance(""),
                                       new User(), new DateTime(2009, 01, 01), null)
            {
                Product = _bookProduct,
                AgioFees = 0.01,
                ChequeDepositFees = 100,
                DepositFees = 50,
                CloseFees = 100,
                ReopenFees = 100,
                OverdraftFees = 100
            };
            saving.FirstDeposit(1000, new DateTime(2009, 01, 01), null, new User(), Teller.CurrentTeller);

            Currency currency = new Currency() { UseCents = true, Code = "SOM", Id = 1, IsPivot = true, Name = "SOM" };

            Assert.AreEqual(1000, saving.GetBalance().Value);

            //Below, we explicitly implement withdraw method from <Saving services>.<Withdraw>, since withdraw method of 'saving' object doesn't implement
            // overdraft fee by default

            List<SavingEvent> withdrawEvents = saving.Withdraw(1100, new DateTime(2009, 1, 2), "withdraw", new User(), false, null);
            saving.Closure(new DateTime(2009, 1, 12), new User());

            //agio for ten days
            Assert.AreEqual(-111.55, saving.GetBalance().Value);
        }
开发者ID:TalasZh,项目名称:opencbs,代码行数:28,代码来源:TestSavingFees.cs

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

示例3: 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);
        }
开发者ID:TalasZh,项目名称:opencbs,代码行数:18,代码来源:TestSavingFees.cs

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

示例5: CalculateInterest_OneWeek_Withdraw_FirstDayOfMonth

        public void CalculateInterest_OneWeek_Withdraw_FirstDayOfMonth()
        {
            SavingsBookProduct product = new SavingsBookProduct
            {
                Id = 1,
                InterestBase = OSavingInterestBase.Weekly,
                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(100, new DateTime(2009, 01, 01), "retrait", new User(), false, null, new PaymentMethod());

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

            Assert.AreEqual(list.Count, 1);
            Assert.AreEqual(list[0].Amount, 90);
        }
开发者ID:aelhadi,项目名称:opencbs,代码行数:23,代码来源:Weekly.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_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

示例8: FlatWithdrawFees

        public void FlatWithdrawFees()
        {
            SavingsBookProduct product = new SavingsBookProduct()
            {
                WithdrawFeesType = OSavingsFeesType.Flat,
                FlatWithdrawFeesMin = 1,
                FlatWithdrawFeesMax = 5
            };

            SavingBookContract saving = new SavingBookContract(ApplicationSettings.GetInstance(""),
                                       new User(), new DateTime(2009, 01, 01), product, null) {FlatWithdrawFees = 2, };
            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,new PaymentMethod());

            Assert.AreEqual(1, withdrawEvents.Count);
            Assert.AreEqual(10, withdrawEvents[0].Amount.Value);
            Assert.AreEqual(2, ((ISavingsFees)withdrawEvents[0]).Fee.Value);
            Assert.AreEqual(988, saving.GetBalance().Value);
        }
开发者ID:aelhadi,项目名称:opencbs,代码行数:20,代码来源:TestSavingFees.cs


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