private void listadoToolStripMenuItem_Click(object sender, EventArgs e) { PacienteListar f = new PacienteListar(); f.MdiParent = this; f.Show(); }
private void btnCancelar_Click(object sender, EventArgs e) { this.Close(); PacienteListar f = new PacienteListar(); f.MdiParent = this.MdiParent; f.Show(); }
//Eventos private void btnRegistrar_Click(object sender, EventArgs e) { if (txtNombre.Text == "") { MessageBox.Show("Ingrese nombre"); } else if (txtApellido.Text == "") { MessageBox.Show("Ingrese apellido"); } else if (cboSex.SelectedIndex.ToString() == "0") { MessageBox.Show("Elija sexo"); } else if (cboDepartamento.SelectedIndex.ToString() == "0") { MessageBox.Show("Elija departamento"); } else if (cboProvincia.SelectedIndex.ToString() == "0") { MessageBox.Show("Elija provincia"); } else if (cboDistrito.SelectedIndex.ToString() == "0") { MessageBox.Show("Elija distrito"); } else if (cboComCon.SelectedIndex.ToString() == "0") { MessageBox.Show("Elija cómo conoció el consultorio"); } else { string mensaje = paciente.Agregar_Paciente( txtId.Text, DateTime.Today, txtNombre.Text, txtApellido.Text, txtDni.Text, dtpFecNac.Value, cboSex.SelectedValue.ToString(), txtMovil.Text, txtFijo.Text, txtEmail.Text, cboDepartamento.SelectedValue.ToString(), cboProvincia.SelectedValue.ToString(), cboDistrito.SelectedValue.ToString(), txtDireccion.Text, txtMotCon.Text, txtAlergia.Text, txtMed.Text, txtEnf.Text, txtECE.Text, txtECI.Text, cboComCon.SelectedValue.ToString() ); MessageBox.Show(mensaje); this.Close(); PacienteListar f = new PacienteListar(); f.MdiParent = this.MdiParent; f.Show(); } }