Example #1
0
        private void btnEditar_Click(object sender, EventArgs e)
        {
            var         fe           = dtpFechaNac.Value;
            var         fe2          = DateTime.Parse(fe.ToString());
            var         final        = fe2.ToShortDateString();
            CN_Personas _CN_Personas = new CN_Personas();

            IDPersona = _CN_Personas.ultimoID();

            _CN_Personas.EditarPersonas(Convert.ToString(IDPersona), txtPaterno.Text, txtMaterno.Text, txtNombre.Text,
                                        dtpFechaNac.Value, cbSexo.SelectedIndex.ToString(), txtCurp.Text, txtTelefono.Text, txtExt.Text,
                                        txtInt.Text, txtCP.Text, cbEdoCivil.SelectedIndex.ToString(), cbDiscapacidad.SelectedIndex.ToString(), txtCalle.Text, cbLocalidad.SelectedIndex.ToString());



            _CN_Alumnos.editar_alumno(txtMatricula.Text, IDPersona, Convert.ToInt32(cbCarrera.SelectedValue.ToString()), IDProfesor, Convert.ToInt32(cbEspecialidad.SelectedValue.ToString()), Convert.ToInt32(cbEstatus.SelectedIndex));
            mostrar_alumnos();
            limpiar();
        }
Example #2
0
        private void btnEditar_Click_1(object sender, EventArgs e)
        {
            try
            {
                if (txtPaterno.Text == "" || txtMaterno.Text == "" || txtNombre.Text == "" || txtCurp.Text == "" ||
                    txtTelefono.Text == "" || txtExt.Text == "" || txtInt.Text == "" || txtCP.Text == "" ||
                    txtCalle.Text == "" || cbLocalidad.Text == "" || txtMatricula.Text == "" || cbCarrera.Text == ""
                    )
                {
                    MessageBox.Show("No puede editar Alumno, aún faltan datos por completar", "Datos incompletos",
                                    MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                }
                else
                {
                    var         fe           = dtpFechaNac.Value;
                    var         fe2          = DateTime.Parse(fe.ToString());
                    var         final        = fe2.ToShortDateString();
                    CN_Personas _CN_Personas = new CN_Personas();
                    IDPersona = _CN_Personas.ultimoID();

                    IDPersona = Convert.ToInt32(dgvAlumnos.CurrentRow.Cells["idPersona"].Value.ToString());

                    _CN_Personas.EditarPersonas(Convert.ToString(IDPersona), txtPaterno.Text, txtMaterno.Text, txtNombre.Text,
                                                dtpFechaNac.Value, cbSexo.SelectedIndex.ToString(), txtCurp.Text, txtTelefono.Text, txtExt.Text,
                                                txtInt.Text, txtCP.Text, cbEdoCivil.SelectedIndex.ToString(), cbDiscapacidad.SelectedIndex.ToString(), txtCalle.Text, cbLocalidad.SelectedIndex.ToString());

                    deshabilitarEdicion();

                    _CN_Alumnos.editar_alumno(txtMatricula.Text, IDPersona, Convert.ToInt32(cbCarrera.SelectedValue.ToString()), IDProfesor, Convert.ToInt32(cbEspecialidad.SelectedValue.ToString()), Convert.ToInt32(cbEstatus.SelectedIndex));
                    mostrar_alumnos();
                    limpiar();
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show("", "", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }