示例#1
0
        private void btnGuardar_Click(object sender, EventArgs e)
        {
            Validaciones.ValidarCampos(ref txtBoxNombre, "string");
            Validaciones.ValidarCampos(ref txtBoxApellido, "string");
            Validaciones.ValidarCampos(ref txtBoxDni, "int");
            Validaciones.ValidarCampos(ref txtBoxNacionalidad, "string");
            Validaciones.ValidarCampos(ref txtBoxEmail, "string");
            Validaciones.ValidarCampos(ref txtBoxDireccion, "string");
            Validaciones.ValidarCampos(ref txtBoxTelefono, "double");
            Validaciones.ValidarCampoCombo(ref comboBoxPago, "string");
            Validaciones.ValidarCampoCombo(ref comboBoxEstcivil, "string");
            Validaciones.ValidarCampoCombo(ref comboBoxSexo, "string");
            Validaciones.ValidarCampoCombo(ref comboBoxTipoPlan, "string");

            try
            {
                SocioPleno socio = new SocioPleno();

                socio.InsertarSocioPleno(Convert.ToInt32(txtBoxIdSocio.Text), comboBoxTipoPlan.Text);
                FormExito.ConfirmarForm("Se ha guardado correctamente");

                Close();
            }
            catch (Exception ex)
            {
                //MessageBox.Show("PASO ESTO PAI: " + ex);
                FormNotificacion.VerificarForm("Atención. Uno o más datos son incorrectos");
            }
        }
示例#2
0
 private void btnCalcularPrecioFinal_Click(object sender, EventArgs e)
 {
     Validaciones.ValidarCampos(ref txtBoxPrecioBase, "double");
     try
     {
         SocioDeportivo socio = new SocioDeportivo(lblTipoPago.Text, Convert.ToDouble(txtBoxPrecioBase.Text), lblInscripcion.Text);
         this.precioFinal    = socio.Calcularpreciofinal();
         lblPrecioFinal.Text = Convert.ToString(this.precioFinal);
     }
     catch (Exception)
     {
         FormNotificacion.VerificarForm("Los datos ingresados son incorrectos");
     }
 }
示例#3
0
        private void btnGuardar_Click(object sender, EventArgs e)
        {
            Validaciones.ValidarCampos(ref txtBoxNombre, "string");
            Validaciones.ValidarCampos(ref txtBoxApellido, "string");
            Validaciones.ValidarCampos(ref txtBoxDireccion, "string");
            Validaciones.ValidarCampos(ref txtBoxDni, "int");
            Validaciones.ValidarCampos(ref txtBoxTelefono, "long");
            Validaciones.ValidarCampos(ref txtBoxEmail, "string");
            Validaciones.ValidarCampos(ref txtBoxNacionalidad, "string");
            Validaciones.ValidarCampoCombo(ref comboBoxSexo, "string");
            Validaciones.ValidarCampoCombo(ref comboBoxEstcivil, "string");
            Validaciones.ValidarCampoCombo(ref comboBoxPago, "string");

            if (!editar)
            {
                try
                {
                    Socio socio = new Socio();
                    socio.InsertarSocio(txtBoxNombre.Text, txtBoxApellido.Text, comboBoxSexo.Text, Convert.ToInt32(txtBoxDni.Text), datePickerFechaNac.Value.Date, txtBoxNacionalidad.Text, comboBoxEstcivil.Text, txtBoxDireccion.Text, Convert.ToInt64(txtBoxTelefono.Text), txtBoxEmail.Text, comboBoxPago.Text);

                    FormExito.ConfirmarForm("Se ha guardado correctamente");

                    Close();
                }
                catch (Exception ex)
                {
                    FormNotificacion.VerificarForm("Atención. Uno o más datos son incorrectos");
                }
            }
            if (editar)
            {
                try
                {
                    Socio socio = new Socio();

                    socio.EditarSocio(Convert.ToInt32(txtBoxIdSocio.Text), txtBoxNombre.Text, txtBoxApellido.Text, comboBoxSexo.Text, Convert.ToInt32(txtBoxDni.Text), datePickerFechaNac.Value.Date, txtBoxNacionalidad.Text, comboBoxEstcivil.Text, txtBoxDireccion.Text, Convert.ToInt64(txtBoxTelefono.Text), txtBoxEmail.Text, comboBoxPago.Text);

                    FormExito.ConfirmarForm("Se ha editado correctamente");

                    Close();

                    editar = false;
                }
                catch (Exception ex)
                {
                    FormNotificacion.VerificarForm("Atención. Uno o más datos son incorrectos");
                }
            }
        }
示例#4
0
        private void btnGuardarProfesor_Click(object sender, EventArgs e)
        {
            Validaciones.ValidarCampos(ref txtBoxNombreProfesor, "string");
            Validaciones.ValidarCampos(ref txtBoxApellidoProfesor, "string");
            Validaciones.ValidarCampos(ref txtBoxDireccionProfesor, "string");
            Validaciones.ValidarCampos(ref txtBoxDniProfesor, "int");
            Validaciones.ValidarCampos(ref txtBoxTelefonoProfesor, "long");
            Validaciones.ValidarCampos(ref txtBoxEmailProfesor, "string");
            //Validaciones.ValidarCampoCombo(ref comboBoxSexoProfesor, "string");

            if (!editar)
            {
                try
                {
                    Profesor profesor = new Profesor();

                    profesor.InsertarProfesor(txtBoxNombreProfesor.Text, txtBoxApellidoProfesor.Text, comboBoxSexoProfesor.Text, Convert.ToInt32(txtBoxDniProfesor.Text), datePickerFechaNacProfesor.Value.Date, txtBoxDireccionProfesor.Text, Convert.ToInt64(txtBoxTelefonoProfesor.Text), txtBoxEmailProfesor.Text);

                    FormExito.ConfirmarForm("Se ha guardado correctamente");

                    Close();
                }
                catch (Exception ex)
                {
                    FormNotificacion.VerificarForm("Atención. Uno o más datos son incorrectos");
                }
            }
            if (editar)
            {
                try
                {
                    Profesor profesor = new Profesor();

                    profesor.EditarProfesor(Convert.ToInt32(txtBoxIdProfesor.Text), txtBoxNombreProfesor.Text, txtBoxApellidoProfesor.Text, comboBoxSexoProfesor.Text, Convert.ToInt32(txtBoxDniProfesor.Text), datePickerFechaNacProfesor.Value.Date, txtBoxDireccionProfesor.Text, Convert.ToInt64(txtBoxTelefonoProfesor.Text), txtBoxEmailProfesor.Text);

                    FormExito.ConfirmarForm("Se ha editado correctamente");
                    Close();
                    editar = false;
                }
                catch (Exception ex)
                {
                    FormNotificacion.VerificarForm("Atención. Uno o más datos son incorrectos");
                }
            }
        }
        private void btnGuardarDeporte_Click(object sender, EventArgs e)
        {
            Validaciones.ValidarCampos(ref txtBoxNombreDeporte, "string");

            if (!editar)
            {
                try
                {
                    if (tablaListaProfesores.SelectedRows.Count > 0)
                    {
                        Deporte depo = new Deporte();
                        txtBoxIdProfesor.Text = tablaListaProfesores.CurrentRow.Cells[0].Value.ToString();

                        string nombre     = txtBoxNombreDeporte.Text;
                        string horarios   = comboBoxHorarios.Text;
                        string dias       = comboBoxDiasDeporte.Text;
                        int    idProfesor = Convert.ToInt32(idProf);

                        depo.InsertarDeporte(txtBoxNombreDeporte.Text, comboBoxDiasDeporte.Text, comboBoxHorarios.Text, Convert.ToInt32(txtBoxIdProfesor.Text));

                        FormExito.ConfirmarForm("Se ha guardado correctamente");
                        Close();
                    }
                    else
                    {
                        MessageBox.Show("Elige un profesor");
                    }
                }
                catch (Exception ex)
                {
                    FormNotificacion.VerificarForm("Atención. Uno o más datos son incorrectos");
                }
            }
            if (editar)
            {
                try
                {
                    if (tablaListaProfesores.SelectedRows.Count > 0)
                    {
                        FormDeporte form = new FormDeporte();

                        string idProfe = tablaListaProfesores.CurrentRow.Cells[0].Value.ToString();

                        Deporte depo = new Deporte();



                        depo.EditarDeporte(Convert.ToInt32(txtBoxIdDeporte.Text), txtBoxNombreDeporte.Text, comboBoxDiasDeporte.Text, comboBoxHorarios.Text, Convert.ToInt32(tablaListaProfesores.CurrentRow.Cells[0].Value.ToString()));

                        Close();
                        editar = false;
                    }
                    else
                    {
                        MessageBox.Show("Elija una fila");
                    }
                }
                catch (Exception ex)
                {
                    MessageBox.Show("No se pudo editar" + ex);
                }
            }
        }