Exemplo n.º 1
0
 public Purse()
 {
     cash = new Money();
     cash.SetCash(5000);
     goldCard = new GoldenCard();
     credCard = new CreditCard();
 }
Exemplo n.º 2
0
        void Pay(int amount)
        {
            int current = money.GetCash();

            if (current < amount)
            {
                MessageBox.Show("Not enough money.");
            }
            else
            {
                money.SetCash(current - amount);
            }
        }
Exemplo n.º 3
0
 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);
     }
 }
Exemplo n.º 4
0
 /*!
  *  \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.");
 }
Exemplo n.º 5
0
 public void Fill(int cash)
 {
     money1.SetCash(cash);
     MessageBox.Show("Your balance filled.");
 }
Exemplo n.º 6
0
 public void PayCredit(IMoney m)
 {
     m.SetCash(m.GetCash() - GetCredit());
     SetCredit(0);
 }