public static void mostrarDatosEmpleado(Empleado[] empleados) { int numcli = 0; int opcion; if (empleados != null) { numcli = empleados.Length; } if (numcli > 0) { // 1. listar todos los clientes // 2. pedir el cliente // 3. mostrar toString cliente InterfazDireccion.listarEmpleadosIndice(empleados); opcion = InterfazDireccion.pedirCliente(numcli, "Elige un cliente de la lista"); CH.lcd(empleados[opcion - 1].ToString()); if (empleados[opcion - 1].lista_contratos != null) { InterfazComercial.listarContratos(empleados[opcion - 1]); } } else { CH.lcd("!> No hay empleados en la banka!"); } CH.pausa(); }
public static void consultarContratosCliente(Banka banka) { // 1. Mostrar clientes con indice // 2. Elegir clientes // 3. Mostrar contratos del clientes int opcion; int numcli = 0; if (banka != null) { numcli = banka.lista_clientes.Length; } if (numcli > 0) { InterfazDireccion.listarClientesIndice(banka.lista_clientes); opcion = InterfazDireccion.pedirCliente(numcli, "Elige un cliente de la lista"); Cliente cliente = banka.lista_clientes[opcion - 1]; if (cliente.lista_contratos != null) { InterfazComercial.listarContratos(cliente); } else { CH.lcd("!> El cliente no tiene ningun contrato"); } } else { CH.lcd("i> No hay clientes que mostrar!"); } CH.pausa(); }
public static void listarProductos(Producto[] productos) { if (productos != null) { InterfazComercial.listarProductos(productos); } else { CH.lcdColor("!> NO HAY PRODUCTOS EN LA BANKA", ConsoleColor.Red); } CH.pausa(); }
public static void consultarProductos(Producto[] productos) { byte opcion; // dado que no habra muchos productos, le ponemos un byte Producto producto; if (productos != null) { Byte.TryParse(productos.Length.ToString(), out opcion); InterfazComercial.listarProductos(productos); opcion = CH.leerOpcionMsg(opcion, "Elije un producto de la lista"); producto = productos[opcion - 1]; CH.lcd("\n" + producto.ToString()); } else { CH.lcd("i> No hay productos en la banka!!"); } CH.pausa(); }
public static void ingreso(ref Banka banka) { // 1. Pedir dni // 2. LocalizarCliente // - SI ENCONTRADO - // 3. Listar Cuentas Ahorros (indice) // 3. Pedir Cuenta de Ahorro (indice) // -REPETIR ESTO HASTA CANTIDAD O.K.- // 4. Pedir cantidad // 5. Evaluar limite segun tipoCliente // 6. Si ok, ingresar Cantidad string dni = ""; Cliente cliente = null; byte numc = 0; float cantidad = 0.0F; dni = CH.leerDni(); cliente = banka.obtenerClienteXDNI(dni); if (cliente != null) { if (cliente.lista_contratos != null) { InterfazComercial.listarContratos(cliente); Byte.TryParse(cliente.lista_contratos.Length.ToString(), out numc); numc = CH.leerOpcionMsg(numc, "Elije un contrato de la lista"); cantidad = CH.leerCantidad("CANTIDAD A INGRESAR"); cliente.lista_contratos[numc - 1].ingreso(cantidad); CH.lcdColor("\ni> Se ha ingresado la cantidad en cuenta", ConsoleColor.Green); } else { CH.lcdColor("!> EL CLIENTE NO TIENE CONTRATOS!!", ConsoleColor.Red); } } else { CH.lcdColor("!> CLIENTE NO ENCONTRADO", ConsoleColor.Red); } CH.pausa(); }