Esempio n. 1
0
        public NotEnoughMoneyView(NotEnoughMoney data)
        {
            if (data == null)
            {
                throw new ArgumentNullException(nameof(data));
            }

            this.Data = data;
        }
        public int MakePayment(SqlMoney money)
        {
            if (WithdrawMoney(money) == 0)
            {
                var msg = $"У Клиента{this}\nНедостаточно средств, \nдля платы по кредиту.";
                NotEnoughMoney?.Invoke(msg);
            }

            return(WithdrawMoney(money));
        }
 public void GetMoney(float money)
 {
     if (Money >= money)
     {
         Console.WriteLine("Emeliyyat icra olundu, balansinizda " + (Money - money) + " AZN qaldi");
     }
     else
     {
         NotEnoughMoney.Invoke(money);
     }
 }
 public void SendMoneyTo(AClient client, SqlMoney money)
 {
     try
     {
         WithdrawMoney(money);
         client.InputMoney(money);
         MoneySent?.Invoke(this, client, money);
     }
     catch (NotEnoughtMoneyExeption)
     {
         var msg = $"У Клиента{this}\nНедостаточно средств, \nдля перевода клиенту{client}";
         NotEnoughMoney?.Invoke(msg);
     }
 }
 public int MakePayment(SqlMoney money)
 {
     try
     {
         var res = WithdrawMoney(money);
         return(res);
     }
     catch (NotEnoughtMoneyExeption)
     {
         var msg = $"У Клиента{this}\nНедостаточно средств, \nдля платы по кредиту.";
         NotEnoughMoney?.Invoke(msg);
         return(-1);
     }
 }
        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);
            }
        }
 public void CloseCredit(Credit credit)
 {
     if (Amount >= credit.Amount)
     {
         Amount -= credit.Amount;
         Credits.Remove(credit);
         Bank.CloseCredit(credit);
         CreditClosed?.Invoke(this, credit);
     }
     else
     {
         var msg = $"У Клиента{this}\nНедостаточно средств, \nдля заркытия кредита!";
         NotEnoughMoney?.Invoke(msg);
     }
 }
 public void CloseCredit(Credit credit)
 {
     try
     {
         WithdrawMoney(credit.Amount);
         Amount -= credit.Amount;
         Credits.Remove(credit);
         Bank.CloseCredit(credit);
         CreditClosed?.Invoke(this, credit);
     }
     catch (NotEnoughtMoneyExeption)
     {
         var msg = $"У Клиента{this}\nНедостаточно средств, \nдля заркытия кредита!";
         NotEnoughMoney?.Invoke(msg);
     }
 }
Esempio n. 9
0
 public void ActivateNotEnoughMoneyEvent(Transform t)
 {
     NotEnoughMoney?.Invoke(t);
 }