public Purse() { cash = new Money(); cash.SetCash(5000); goldCard = new GoldenCard(); credCard = new CreditCard(); }
void Pay(int amount) { int current = money.GetCash(); if (current < amount) { MessageBox.Show("Not enough money."); } else { money.SetCash(current - amount); } }
public double Withdraw(double cash) { /*if ((money.GetCash() - cash) < 0) * { * MessageBox.Show("Your balance is too small to make a withdraw."); * return 0; * } * else*/ { money.SetCash(money.GetCash() - cash); MessageBox.Show("Succsess."); return(cash); } }
/*! * \param double * User enter value of money, wich after will be filled. */ public void Fill(double cash) { if (valuta == "UAH") { money1.SetCash(money1.GetCash() + cash); } else { ConvertToUAH(); money1.SetCash(money1.GetCash() + cash); } MessageBox.Show("Your balance filled."); }
public void Fill(int cash) { money1.SetCash(cash); MessageBox.Show("Your balance filled."); }
public void PayCredit(IMoney m) { m.SetCash(m.GetCash() - GetCredit()); SetCredit(0); }