private void btSalir_Click(object sender, EventArgs e) { if (Cargado == true) { DialogResult Res = new DialogResult(); Res = MessageBox.Show("¿Agregar equipo seleccionado?", "¡Atención!", MessageBoxButtons.YesNo, MessageBoxIcon.Question); if (Res == DialogResult.Yes) { String Query = NuevaLinea(); try { using (MySqlConnection sqlConnection = new MySqlConnection(strConnection)) { MySqlCommand sqlCmd = new MySqlCommand(Query, sqlConnection); sqlConnection.Open(); sqlCmd.ExecuteNonQuery(); sqlConnection.Close(); } } catch (Exception exc) { MessageBox.Show(exc.Message); } fBalanceCargas aux = (fBalanceCargas)this.Owner; aux.RecargarEscenario(); } } Close(); }
private void btSalir_Click(object sender, EventArgs e) { fBalanceCargas aux = (fBalanceCargas)this.Owner; aux.RecargarEscenario(); Close(); }
private void btAgregar_Click(object sender, EventArgs e) { String Query = NuevaLinea(); try { using (MySqlConnection sqlConnection = new MySqlConnection(strConnection)) { MySqlCommand sqlCmd = new MySqlCommand(Query, sqlConnection); sqlConnection.Open(); sqlCmd.ExecuteNonQuery(); sqlConnection.Close(); } } catch (Exception exc) { MessageBox.Show(exc.Message); } fBalanceCargas aux = (fBalanceCargas)this.Owner; aux.RecargarEscenario(); Cargado = false; cbEquipos.Focus(); }