public void identificarCliente(ServiciosCliente serviceCliente) { Console.WriteLine("Ingrese su numero de dni: "); string stringDni = Console.ReadLine(); int intDni = Int32.Parse(stringDni); ArrayList Clientes = serviceCliente.ObtenerClientes; Cliente clienteExistente = null; bool clienteExiste = false; foreach (Cliente cliente in Clientes) { if (cliente.DNI == intDni) { clienteExiste = true; clienteExistente = cliente; } } if (clienteExiste && clienteExistente != null) { Console.WriteLine("Cliente existe"); Console.WriteLine(clienteExistente.InfoCliente); Comprar(clienteExistente); } else { Console.WriteLine("Nuevo cliente, ingrese sus datos: "); Cliente clienteNuevo = serviceCliente.registrarCliente(intDni); Console.WriteLine("Cliente registrado. Presione una tecla para seguir.."); Console.ReadKey(); Comprar(clienteNuevo); } }
public VistaCompras(Dibujante dibujante, VistaGestionCarro vistaGestionCarro, ServiciosCompra serviceCompra, ServiciosCliente serviceCliente) { this.vistaGestionCarro = vistaGestionCarro; this.serviceCompra = serviceCompra; this.serviceCliente = serviceCliente; this.dibujante = dibujante; this.opciones = new string[] { "1 - Agregar productos al carro", "2 - Identificar cliente", "3 - Volver" }; }
public VistaAdministracion(ServiciosCompra serviceCompra, ServiciosCliente serviceCliente, ServiciosTarjeta serviceTarjeta) { this.serviceCliente = serviceCliente; this.serviceCompra = serviceCompra; this.serviceTarjeta = serviceTarjeta; this.dibujante = new Dibujante(); this.opciones = new string[] { "1 - Total vendido en la tienda On-line", "2 - Total vendido por cliente", "3 - Total vendido por tarjeta", "4 - Volver" }; }