private void btnAceptar_Click(object sender, EventArgs e) { try { if ((cbPrimero.SelectedIndex.Equals(-1)) && (cbSegundo.SelectedIndex.Equals(-1)) && (cbTercero.SelectedIndex.Equals(-1)) && (cbSorteo.SelectedIndex.Equals(-1))) { MessageBox.Show("Llene todos los datos"); return; } Object selectedItem = cbSorteo.SelectedItem; string sorteo = selectedItem.ToString(); int id = log.buscarID(sorteo); int numUno = Convert.ToInt32(cbPrimero.SelectedItem.ToString()); int numDos = Convert.ToInt32(cbSegundo.SelectedItem.ToString()); int numTres = Convert.ToInt32(cbTercero.SelectedItem.ToString()); sorPre.Insert(sorteo, numUno, numDos, numTres, id); log.informacionPersonaConNumero(sorteo, numUno, numDos, numTres); if (this.sorteo.isError) { MessageBox.Show(this.sorteo.errorDescription); } refrecar(); } catch (Exception) { MessageBox.Show("Problema, Intentelo nuevamente."); } }
private void btnAceptar_Click(object sender, EventArgs e) { Object selectedItem = cbSorteo.SelectedItem; string sorteo = selectedItem.ToString(); int id = log.buscarID(sorteo); int numUno = Convert.ToInt32(cbPrimero.SelectedItem.ToString()); int numDos = Convert.ToInt32(cbSegundo.SelectedItem.ToString()); int numTres = Convert.ToInt32(cbTercero.SelectedItem.ToString()); sorPre.Insert(sorteo, numUno, numDos, numTres, id); if (this.sorteo.isError) { MessageBox.Show(this.sorteo.errorDescription); } refrecar(); }