//en el evento clic revisamos que todo en los contenedores este de la forma correcta para poder seguir //si no es asi no podemos avanzar private void button1_Click(object sender, EventArgs e) { if (rb_F.Checked) { x = "F"; } else { x = "M"; } if (string.IsNullOrWhiteSpace(txt_matricula.Text) || string.IsNullOrWhiteSpace(txt_nombre.Text) || string.IsNullOrWhiteSpace(txt_correo.Text) || string.IsNullOrWhiteSpace(txt_apP.Text) || string.IsNullOrWhiteSpace(txt_apM.Text) || string.IsNullOrWhiteSpace(cmb_carrera.Text)) { MessageBox.Show("Campos Vacios", "Sistema", MessageBoxButtons.OK, MessageBoxIcon.Warning); } else { if (obj.ValidaCorreo(txt_correo.Text, @"^\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*") == true) { if (MessageBox.Show("¿Desea relizar la actualización?", "Confirmacion", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) { obj.Actualizar_Alumnos(txt_matricula.Text, txt_nombre.Text, txt_apP.Text, txt_apM.Text, txt_telefono.Text, txt_correo.Text, cmb_carrera.SelectedValue.ToString(), x); } } } }
private void button1_Click(object sender, EventArgs e) { if (string.IsNullOrWhiteSpace(txtCveAsesor.Text) || string.IsNullOrWhiteSpace(txtNombre.Text) || string.IsNullOrWhiteSpace(txtapPaterno.Text) || string.IsNullOrWhiteSpace(txtapMaterno.Text) || string.IsNullOrWhiteSpace(txtCorreo.Text) || string.IsNullOrWhiteSpace(txtTitulo.Text) /*&& string.IsNullOrWhiteSpace(mstxTelefono.Text)*/) { MessageBox.Show("Campos vacios", "Sistema", MessageBoxButtons.OK, MessageBoxIcon.Warning); } else { if (AA.ValidaCorreo(txtCorreo.Text, @"^\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*") == true) { if (MessageBox.Show("¿Desea relizar el registro?", "Confirmacion", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) { AA.ActualizarAsesor(txtCveAsesor.Text, txtNombre.Text, txtapPaterno.Text, txtapMaterno.Text, txtCorreo.Text, mstxTelefono.Text, cbxCveCarrera.SelectedValue.ToString(), txtTitulo.Text); } } } }
private void button1_Click(object sender, EventArgs e) { if (string.IsNullOrWhiteSpace(txt_matricula.Text) || string.IsNullOrWhiteSpace(txt_nombre.Text) || string.IsNullOrWhiteSpace(txt_correo.Text) || string.IsNullOrWhiteSpace(txt_apP.Text) || string.IsNullOrWhiteSpace(txt_apM.Text)) { MessageBox.Show("Campos Vacios", "Sistema", MessageBoxButtons.OK, MessageBoxIcon.Warning); } else { if (CA.ValidaCorreo(txt_correo.Text, @"^\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*") == true) { if (MessageBox.Show("¿Desea relizar el registro?", "Confirmacion", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) { CA.insertarAlumno(txt_matricula.Text, txt_nombre.Text, txt_apP.Text, txt_apM.Text, txt_telefono.Text, txt_correo.Text, comboBox1.SelectedValue.ToString(), sexo); txt_matricula.Clear(); txt_nombre.Clear(); txt_apP.Clear(); txt_apM.Clear(); txt_telefono.Clear(); txt_correo.Clear(); } } } }