コード例 #1
0
ファイル: ClientsWindow.xaml.cs プロジェクト: Aynur11/BankV2
        private void OpenLegalPersonDepositButton_OnClick(object sender, RoutedEventArgs e)
        {
            AddingAnyAccountWindow accountWindow = new AddingAnyAccountWindow();

            if (LegalPersonsDataGrid.CurrentItem != null)
            {
                LegalPersonClient client = (LegalPersonClient)LegalPersonsDataGrid.SelectedItem;
                if (accountWindow.ShowDialog() == true)
                {
                    using (var repo = new LegalPersonClientRepository())
                    {
                        repo.AddDeposit(client.Id, accountWindow.Currency, accountWindow.Amount, accountWindow.Period,
                                        accountWindow.WithCapitalization, rate.CalcLegalPersonDepositRate(client.Type));
                    }
                }
            }
            else
            {
                MessageBox.Show("Выберите нужного клиента!");
            }
        }
コード例 #2
0
ファイル: ClientsWindow.xaml.cs プロジェクト: Aynur11/BankV2
        private void OpenLegalPersonAccountButton_OnClick(object sender, RoutedEventArgs e)
        {
            AddingAnyAccountWindow accountWindow = new AddingAnyAccountWindow();

            accountWindow.CapitalizationCheckBox.IsEnabled = false;
            accountWindow.PeriodTextBox.IsEnabled          = false;
            if (LegalPersonsDataGrid.CurrentItem != null)
            {
                LegalPersonClient client = (LegalPersonClient)LegalPersonsDataGrid.SelectedItem;
                if (accountWindow.ShowDialog() == true)
                {
                    using (var repo = new LegalPersonClientRepository())
                    {
                        repo.AddAccount(client.Id, accountWindow.Currency, accountWindow.Amount);
                    }
                }
            }
            else
            {
                MessageBox.Show("Выберите нужного клиента!");
            }
        }
コード例 #3
0
ファイル: ClientsWindow.xaml.cs プロジェクト: Aynur11/BankV2
        private void IssuePhysicalPersonCreditButton_OnClick(object sender, RoutedEventArgs e)
        {
            AddingAnyAccountWindow accountWindow = new AddingAnyAccountWindow();

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