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); }
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); }
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(); }
public void RequestMoneyFrom(AClient client, SqlMoney money) { if (client.Amount >= money) { InputMoney(money); client.WithdrawMoney(money); MoneyReceived?.Invoke(this, client, money); } else { MessageBox.Show("На счете данного клиента недостаточно средств."); } }
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); } }
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(); }
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 = "Запросить"; } }
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; } }
public void DeleteClient(AClient client) { Clients.Remove(client); }
public void AddClient(AClient client) { Clients.Add(client); }
private void AClient_MoneyReceived(AClient arg1, AClient arg2, System.Data.SqlTypes.SqlMoney arg3) { var pattern = $"Клиент {arg1} \nполучил {arg3} руб. \nот клиента {arg2}"; transactionListBox.Items.Add(pattern); }
private void AClient_MoneySent(AClient arg1, AClient arg2, System.Data.SqlTypes.SqlMoney arg3) { var pattern = $"Клиент {arg1} отправил\n{arg3} руб.\nклиенту {arg2}"; transactionListBox.Items.Add(pattern); }
private void Credit_CreditClosed(AClient arg1, Credit arg2) { var pattern = $"Клиент {arg1} закрыл кредит."; transactionListBox.Items.Add(pattern); }
private void Deposit_DepositOpend(AClient arg1, Deposit arg2) { var pattern = $"Клиент {arg1} открыл депозит:\nСрок: {arg2.Month}\nСумма: {arg2.Amount}\nПроцент: {arg2.Percent}"; transactionListBox.Items.Add(pattern); }
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); }