private async void BuscarCuenta(object sender, RoutedEventArgs e) { string msj = ""; UsuarioController usc = new UsuarioController(); string rutBuscar = txtRutBuscar.Text; if (rutBuscar != "") { var empleado = usc.BuscarCuentaEmpleado(Convert.ToInt32(txtRutBuscar.Text)); if (empleado != null) { PropertyInfo piNombre = empleado.GetType().GetProperty("Nombre"); string nombre = (string)(piNombre.GetValue(empleado, null)); txtNombre.Text = nombre; msj = "Cuenta Encontrada"; } else { var cliente = usc.BuscarCuentaCliente(Convert.ToInt32(txtRutBuscar.Text)); if (cliente != null) { PropertyInfo piNombre = cliente.GetType().GetProperty("Nombre"); string nombre = (string)(piNombre.GetValue(cliente, null)); txtNombre.Text = nombre; msj = "Cuenta Encontrada"; } else { msj = "Cuenta No Encontrada"; } } } else { msj = "Ingrese Rut a buscar"; } await this.ShowMessageAsync("Alerta", msj); }