private void btnAgregar_Click(object sender, EventArgs e) { CN_Municipio _CN_Municipio = new CN_Municipio(); _CN_Municipio.AgregarMunicipio(Convert.ToInt32(txtNumero.Text), Convert.ToInt32(cbEstado.SelectedValue.ToString()), txtNombre.Text); MostrarMunicipio(); }
private void btnAgregar_Click(object sender, EventArgs e) { if (txtNombre.TextLength <= 0 || txtNumero.TextLength <= 0 || cbEstado.Text.Length <= 0) { MessageBox.Show("Faltan datos por ingresar"); } else { CN_Municipio _CN_Municipio = new CN_Municipio(); _CN_Municipio.AgregarMunicipio(Convert.ToInt32(txtNumero.Text), Convert.ToInt32(cbEstado.SelectedValue.ToString()), txtNombre.Text); MostrarMunicipio(); limpiar(); } }