Пример #1
0
        public void CalcLegalPersonCreditRateVipClientTest()
        {
            var     rate       = new Rate();
            decimal actualRate = rate.CalcLegalPersonCreditRate(ClientType.Vip);

            Assert.AreEqual(14.65m, actualRate, "Ставка не является ожидаемой.");
        }
Пример #2
0
        private void IssueLegalPersonCreditButton_OnClick(object sender, RoutedEventArgs e)
        {
            AddingAnyAccountWindow accountWindow = new AddingAnyAccountWindow();

            accountWindow.CapitalizationCheckBox.IsEnabled = false;
            if (LegalPersonsDataGrid.CurrentItem != null)
            {
                LegalPersonClient client = (LegalPersonClient)LegalPersonsDataGrid.SelectedItem;
                if (accountWindow.ShowDialog() == true)
                {
                    using (var repo = new LegalPersonClientRepository())
                    {
                        repo.AddCredit(client.Id, accountWindow.Currency, accountWindow.Amount, accountWindow.Period,
                                       rate.CalcLegalPersonCreditRate(client.Type));
                    }
                }
            }
            else
            {
                MessageBox.Show("Выберите нужного клиента!");
            }
        }