Пример #1
0
        private void btnIngresar_Click(object sender, EventArgs e)
        {
            // Boton para ingresar al formSintomas
            Form Formulario_sintomas = new FormSintomas();

            Formulario_sintomas.Show();
        }
Пример #2
0
        private void btnGuardar_Click(object sender, EventArgs e)
        {
            //Validacion de cuadros de texto vacios
            if (txtCedula.Text == "")
            {
                errorTextoVacio.SetError(txtCedula, "Debe Ingresar una Cédula ");
                txtCedula.Focus();
                return;
            }
            errorTextoVacio.SetError(txtCedula, "");

            if (txtNombre.Text == "")
            {
                errorTextoVacio.SetError(txtNombre, "Debe Ingresar una Nombre ");
                txtNombre.Focus();
                return;
            }
            errorTextoVacio.SetError(txtNombre, "");
            if (txtEdad.Text == "")
            {
                errorTextoVacio.SetError(txtEdad, "Debe Ingresar una Edad ");
                txtEdad.Focus();
                return;
            }
            errorTextoVacio.SetError(txtEdad, "");
            if (txtSexo.Text == "")
            {
                errorTextoVacio.SetError(txtSexo, "Debe Ingresar el Sexo ");
                txtSexo.Focus();
                return;
            }
            errorTextoVacio.SetError(txtSexo, "");


            //Leyendo los datos de la clase y llamando los respectivos cuadros de texto del formIngreso

            myPaciente.Cedula = txtCedula.Text;
            myPaciente.Nombre = txtNombre.Text;
            myPaciente.Edad   = txtEdad.Text;
            myPaciente.Sexo   = txtSexo.Text;
            MessageBox.Show("El registro se ha realizado correctamente, tus datos son: "
                            + " Cédula: " + txtCedula.Text
                            + " Nombre: " + txtNombre.Text
                            + " Edad: " + txtEdad.Text
                            + " Sexo: " + txtSexo.Text, "REGISTRO EXITOSO", MessageBoxButtons.OK, MessageBoxIcon.Information);

            //PASANDO DATOS AL FORMULARIO INGRESO
            FormSintomas Fsintomas = new FormSintomas();

            Fsintomas.txtNombreFormIngreso.Text = txtNombre.Text;
            Fsintomas.Show();
        }