private void setIdCliente() { var seleccion = new AbmCliente.ListadoSeleccion(); seleccion.dataGridViewCliente = dataGridViewCliente; seleccion.MostrarSoloHabilitados(); seleccion.ShowDialog(); if (seleccion.existeCliente) { if (seleccion.SelectedClient != null) { idCliente = seleccion.SelectedClient.idCliente; } else { MessageBox.Show("Si no se encuentra registrado, vuelva a elegir la opcion seleccionar cliente y toque el botón 'agregar cliente' para poder registrarse", "Atención", MessageBoxButtons.OK, MessageBoxIcon.Information); } } else { var alta = new AbmCliente.Alta(); alta.dataGridViewCliente = dataGridViewCliente; alta.ShowDialog(); if (alta.InsertedClient != null) { idCliente = alta.InsertedClient.idCliente; } } }
private void button2_Click(object sender, EventArgs e) { var dialog = new AbmCliente.Alta(); if (dialog.ShowDialog(this) == System.Windows.Forms.DialogResult.OK) { AddHuesped(dialog.InsertedClient); } }