Exemplo n.º 1
0
        public void Deposit(Account account)
        {
            bool false_input = false;

            // Gui tien
            while (true)
            {
                Console.Clear();
                Console.WriteLine("Nhập vào số lượng bạn muốn gửi vào :");
                if (false_input)
                {
                    Console.WriteLine("----- ! Xin hãy nhập vào chữ số ! -----");
                }
                string input    = Console.ReadLine();
                bool   isDouble = _customHelper.IsNumeric(input);
                if (isDouble)
                {
                    false_input = false;
                    double amount = double.Parse(input);
                    bool   status = _userModel.Desposit(account, amount);
                    if (status)
                    {
                        Console.WriteLine("Gửi tiền thành công .");
                        Console.WriteLine("Nhấn phím bất kỳ để xác nhận");
                        Console.ReadKey();
                    }
                    else
                    {
                        Console.WriteLine("Một số lỗi đã xảy ra, vui lòng thử lại sau !");
                        Console.WriteLine("Nhấn phím bất kỳ để xác nhận");
                        Console.ReadKey();
                    }
                    break;
                }
                false_input = true;
            }
        }