예제 #1
0
        public static void SpendMoney(Client client)
        {
            int choise = ConsoleWriteAndRead.ChoiseCard(client);

            if (choise == 0)
            {
                return;
            }
            int howMoney = ConsoleWriteAndRead.WriteYourChoise(1, 1000, message: "Введите сумму: ");

            ConsoleWriteAndRead.MessageAboutSpendMoney(client.ClientCards[choise - 1].BankOfCard.PossibilityToUse(client.ClientCards[choise - 1], howMoney));
        }
예제 #2
0
        public static void AddCashOnCard(Client client)
        {
            int choise = ConsoleWriteAndRead.ChoiseCard(client);    //Выбор карты

            if (choise == 0)
            {
                return;
            }
            ConsoleWriteAndRead.YourBalance(client);                                                              //Вывод баланса
            int howMoney = ConsoleWriteAndRead.WriteYourChoise(1, (int)client.Money, message: "Введите сумму: "); //Ввод суммы от 1 до balance

            client.ClientCards[choise - 1].CardBalance += howMoney;
            client.Money -= howMoney;
        }
예제 #3
0
        public void DeleteCard()                               //Удаление карточки
        {
            int choise = ConsoleWriteAndRead.ChoiseCard(this); //Вывод списка карт и выбор необходимой

            if (choise == 0)
            {
                return;
            }
            else if (ClientCards[choise - 1].CardBalance < 0)   //Если отрицательный баланс
            {
                ConsoleWriteAndRead.NegativeBalance(this);
            }
            else
            {
                ClientCards.RemoveAt(choise - 1);
            }
        }