public void RequestCard(string BankName, int Type) { Bank tmpBank = PaymentCardServiceCenter.FindBank(BankName); PaymentCard tmpCard = tmpBank.AuthorizeCard(Name, KRS, Type); AddCard(tmpCard); }
public BankForm(string name, LoginForm LogForm) { InitializeComponent(); this.LogForm = LogForm; LoggedBank = PaymentCardServiceCenter.FindBank(name); foreach (Client c in LoggedBank.GetClients()) { dataGridView1.Rows.Add(c.GetName(), c.GetKRS(), c.GetType()); } }
private void Creditbtn_Click(object sender, EventArgs e) { try { PaymentCard card = PaymentCardServiceCenter.FindBank(BankNameBox.Text).AuthorizeCard(LoggedClient.GetName(), LoggedClient.GetKRS(), 2); dataGridView1.Rows.Add(card.GetNr(), card.CheckFunds(), card.GetBank(), card.CardType()); LoggedClient.AddCard(card); } catch (RequestRejectedException ex) { ErrorLabel.Text = $"Bank {ex.BankName} has rejected Your request"; } catch (BanknotFoundException ex) { ErrorLabel.Text = $"Bank {ex.bank} not found"; } }