Exemple #1
0
 public bool ModificarReg(int pos)
 {
     try
     {
         ClsCuenta nuevaCuenta = LeerRegistro(pos);
         EscribirRegistro(pos, nuevaCuenta); return(true);
     }
     catch (IOException e) { CerrarFichero(); return(false); }
 }
Exemple #2
0
 public static string RecargarCuenta(ClsCuenta cuenta, double cantidad)
 {
     if (cantidad > 0)
     {
         cuenta.Cantidad += cantidad;
         return($"Se han recargado: $ {darFormato(cantidad)} pesos.");
     }
     else
     {
         return("No se permiten valores negativos.");
     }
 }
Exemple #3
0
 public static string RetirarDinero(ClsCuenta cuenta, double cantidad)
 {
     if (cantidad > 0)
     {
         if (cantidad > cuenta.Cantidad)
         {
             return("Fondos insuficientes");
         }
         else
         {
             cuenta.Cantidad -= cantidad;
             return($"Retiro existoso de $ {darFormato(cantidad)} pesos.");
         }
     }
     else
     {
         return("No se permiten valores negativos.");
     }
 }
Exemple #4
0
 public static string ConsultarSaldo(ClsCuenta cuenta)
 {
     return($"$ {darFormato(cuenta.Cantidad)}");
 }