コード例 #1
0
        private void Credit_MakedPayment(AClient arg1, Credit arg2, System.Data.SqlTypes.SqlMoney arg3)
        {
            var creditInfo = $"Сумма: {arg2.Amount} \nСрок: {arg2.Month} \nПроцент: {arg2.Percent}";
            var pattern    = $"Клиент {arg1} сделал взнос по кредиту\nна сумму {arg3}. Credit: \n{creditInfo}";

            transactionListBox.Items.Add(pattern);
        }
コード例 #2
0
        private void Credit_CreditOpend(AClient arg1, Credit arg2)
        {
            var creditInfo = $"Сумма: {arg2.Amount} \nСрок: {arg2.Month}";
            var pattern    = $"Клиент {arg1} Открыл кредит. Credit: \n{creditInfo}";

            transactionListBox.Items.Add(pattern);
        }
コード例 #3
0
 public Deposit(AClient Holder, SqlMoney Amount, int Month = 12)
 {
     this.Holder = Holder;
     this.Amount = Amount;
     this.Month  = Month;
     Payment     = (decimal)Percent / 100;
 }
        public OpenCredits_Deposits(object holder, bool credit, Label label, SqlConnectionStringBuilder stringBuilder)
        {
            InitializeComponent();
            this.stringBuilder = stringBuilder;
            Client             = (holder as AClient);
            isCredit           = credit;
            info = label;

            Configurate();
        }
コード例 #5
0
 public void RequestMoneyFrom(AClient client, SqlMoney money)
 {
     if (client.Amount >= money)
     {
         InputMoney(money);
         client.WithdrawMoney(money);
         MoneyReceived?.Invoke(this, client, money);
     }
     else
     {
         MessageBox.Show("На счете данного клиента недостаточно средств.");
     }
 }
コード例 #6
0
        public void SendMoneyTo(AClient client, SqlMoney money)
        {
            if (Amount >= money)
            {
                WithdrawMoney(money);

                client.InputMoney(money);
                MoneySent?.Invoke(this, client, money);
            }
            else
            {
                var msg = $"У Клиента{this}\nНедостаточно средств, \nдля перевода клиенту{client}";
                NotEnoughMoney?.Invoke(msg);
            }
        }
コード例 #7
0
        private void operation_btn_Click(object sender, RoutedEventArgs e)
        {
            AClient secondClient = (clients_cb.SelectedItem as AClient);

            int sum;

            if (clients_cb.SelectedItem == null)
            {
                MessageBox.Show("Клиент не выбран.");
                return;
            }

            if (String.IsNullOrEmpty(Sum_tb.Text))
            {
                MessageBox.Show("Сумма не введена или введена неверно.");
                return;
            }

            if (int.TryParse(Sum_tb.Text, out sum))
            {
                if (sum <= 0)
                {
                    MessageBox.Show("Сумма не введена или введена неверно.");
                }
                else
                {
                    if (To)
                    {
                        Client.SendMoneyTo(secondClient, sum);
                    }
                    else
                    {
                        Client.RequestMoneyFrom(secondClient, sum);
                    }
                }
            }
            else
            {
                MessageBox.Show("Сумма не введена или введена неверно.");
                return;
            }

            info.Content = Client.Info;

            this.Close();
        }
コード例 #8
0
        public TransactToWindow(object bank, object client, bool To, Label lbl)
        {
            InitializeComponent();
            Client  = (client as AClient);
            Bank    = (bank as Bank);
            this.To = To;
            info    = lbl;

            var clients = Bank.Clients.Where(x => x != Client).ToList();

            clients_cb.ItemsSource = clients;
            if (To)
            {
                helper_lbl.Content    = "Выберите клиента, которому хотите перевести деньги:";
                operation_btn.Content = "Перевести";
            }
            else
            {
                helper_lbl.Content    = "Выберите клиента, со счета которого хотите перевести деньги себе:";
                operation_btn.Content = "Запросить";
            }
        }
コード例 #9
0
        private void DeleteAClient(AClient item)
        {
            bank.DeleteClient(item as AClient);

            if (item is Client)
            {
                if ((item as Client).isVIP)
                {
                    var clients = bank.GetClients(x => (x is Client) && (x as Client).isVIP == true);
                    (tv_Clients.Items[1] as TreeViewItem).ItemsSource = clients;
                }
                else
                {
                    var clients = bank.GetClients(x => (x is Client) && (x as Client).isVIP == false);
                    (tv_Clients.Items[0] as TreeViewItem).ItemsSource = clients;
                }
            }
            else if (item is Entity)
            {
                var entitys = bank.GetClients(x => x is Entity);
                (tv_Clients.Items[2] as TreeViewItem).ItemsSource = entitys;
            }
        }
コード例 #10
0
 public void DeleteClient(AClient client)
 {
     Clients.Remove(client);
 }
コード例 #11
0
 public void AddClient(AClient client)
 {
     Clients.Add(client);
 }
コード例 #12
0
        private void AClient_MoneyReceived(AClient arg1, AClient arg2, System.Data.SqlTypes.SqlMoney arg3)
        {
            var pattern = $"Клиент {arg1} \nполучил {arg3} руб. \nот клиента {arg2}";

            transactionListBox.Items.Add(pattern);
        }
コード例 #13
0
        private void AClient_MoneySent(AClient arg1, AClient arg2, System.Data.SqlTypes.SqlMoney arg3)
        {
            var pattern = $"Клиент {arg1} отправил\n{arg3} руб.\nклиенту {arg2}";

            transactionListBox.Items.Add(pattern);
        }
コード例 #14
0
        private void Credit_CreditClosed(AClient arg1, Credit arg2)
        {
            var pattern = $"Клиент {arg1} закрыл кредит.";

            transactionListBox.Items.Add(pattern);
        }
コード例 #15
0
        private void Deposit_DepositOpend(AClient arg1, Deposit arg2)
        {
            var pattern = $"Клиент {arg1} открыл депозит:\nСрок: {arg2.Month}\nСумма: {arg2.Amount}\nПроцент: {arg2.Percent}";

            transactionListBox.Items.Add(pattern);
        }
コード例 #16
0
        private void Deposit_MakedPayment(AClient arg1, Deposit arg2, System.Data.SqlTypes.SqlMoney arg3)
        {
            var pattern = $"Клиент {arg1} закрыл депозит.\nСумма: {arg2.Amount}\nПроцент: {arg2.Percent}";

            transactionListBox.Items.Add(pattern);
        }